Skip to content

Commit c09bcfe

Browse files
committed
Add useful tests script
1 parent 74b5583 commit c09bcfe

File tree

3 files changed

+62
-9
lines changed

3 files changed

+62
-9
lines changed

README.rst

+9-9
Original file line numberDiff line numberDiff line change
@@ -65,23 +65,23 @@ Quickly test ?
6565

6666
Download plonetheme.drupal and use virtualenv and buildout to test the theme::
6767

68-
easy_install virtualenv
69-
cd plonetheme.drupal
70-
virtualenv .
71-
source bin/activate
72-
(plonetheme.drupal) easy_install zc.buildout
68+
easy_install virtualenv
69+
cd plonetheme.drupal
70+
virtualenv .
71+
source bin/activate
72+
(plonetheme.drupal) easy_install zc.buildout
7373
!!! check the buildout config file ``test-plone-base.cfg`` before running !!!
7474
(plonetheme.drupal) ln -s test-plone-4.2.x.cfg buildout.cfg
7575
(plonetheme.drupal) python bootstrap.py
76-
(plonetheme.drupal) bin/buildout
77-
[...] be patient... [...]
78-
(plonetheme.drupal) ./bin/instance fg
76+
(plonetheme.drupal) bin/buildout
77+
[...] be patient... [...]
78+
(plonetheme.drupal) ./bin/instance fg
7979

8080
Go to http://localhost:8080, add a new Plone Site and install plonetheme.drupal
8181

8282
Launch tests::
8383

84-
(plonetheme.drupal) ./bin/test -s plonetheme.drupal
84+
(plonetheme.drupal) ./bin/test -s plonetheme.drupal
8585

8686
Launch code coverage::
8787

test-coverage.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
# ./test-coverage.sh
3+
4+
bin/coverage
5+
bin/report
6+
open htmlcov/index.html

test-set-buildout.sh

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
# ./test-set-buildout.sh 4.2.x
3+
# ===> change and execute buildout
4+
# ./test-set-buildout.sh 4.2.x clean
5+
# ===> ATTENTION: remove the Data.fs file, remove virtualenv files, change and execute buildout
6+
7+
function print()
8+
{
9+
echo ''
10+
echo '================================================'
11+
echo $1
12+
echo '================================================'
13+
echo ''
14+
}
15+
16+
if [ $2 == clean ]; then
17+
if [ -f var/filestorage/Data.fs ]; then
18+
print "Remove Data.fs file"
19+
rm var/filestorage/Data.fs
20+
fi
21+
if [ -f bin/python ]; then
22+
print "Remove virtualenv files"
23+
rm -rf bin develop-eggs include lib parts var
24+
fi
25+
fi
26+
27+
if [ ! -f bin/python ]; then
28+
print "Install a virtual in the current directory"
29+
virtualenv .
30+
source bin/activate
31+
easy_install -U zc.buildout
32+
easy_install -U setuptools
33+
easy_install -U distribute
34+
fi
35+
36+
print "Change buildout for test-plone-$1.cfg"
37+
if [ -f buildout.cfg ]; then
38+
rm buildout.cfg
39+
fi
40+
ln -s test-plone-$1.cfg buildout.cfg
41+
42+
print "Lauch buildout"
43+
python bootstrap.py
44+
bin/buildout
45+
46+
print "Lauch Zope instance"
47+
./bin/instance fg

0 commit comments

Comments
 (0)