-
Notifications
You must be signed in to change notification settings - Fork 34
/
start_end-to-end-test.sh
executable file
·45 lines (35 loc) · 1.65 KB
/
start_end-to-end-test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh -e
## this script calls each unit test script
## if no error is found, the final success statement is shown
## if error occurs, this script stops at the error
## activate Python3 virtualenv:
test ! -d venv || . ./venv/bin/activate
end_to_end_test()
{
## End-to-end test with multiple Org-mode files resulting
## in several different blog files with all kinds of tests:
echo "\n====> Runing end-to-end test ...\n"
cd ~/src/lazyblorg
rm -rf testdata/end_to_end_test/result
mkdir -p testdata/end_to_end_test/result
PYTHONPATH="~/src/lazyblorg:" ./lazyblorg.py \
--targetdir testdata/end_to_end_test/result \
--autotag-language \
--previous-metadata testdata/end_to_end_test/lazyblorg-e2e-test-previous-metadata.pk \
--new-metadata testdata/end_to_end_test/lazyblorg-e2e-test-new-metadata.pk \
--logfile testdata/end_to_end_test/lazyblorg-e2e-test-logfile.org \
--orgfiles templates/blog-format.org \
testdata/end_to_end_test/orgfiles/*.org $@ && \
echo "\n====> Comparing result of end-to-end test ...\n" && \
if [ `diff -ar testdata/end_to_end_test/result testdata/end_to_end_test/comparison | egrep -vi '(published|updated)' | wc -l` -gt 15 ]; then
diff -ar testdata/end_to_end_test/result testdata/end_to_end_test/comparison | grep -v '<updated>'
echo "End-to-end test FAILED! Check result!"
exit 1
else
## a couple of difference are OK since there are new time-stamps for generation time
echo "End-to-end test: success."
fi
}
end_to_end_test "$@" && \
echo "\n\n End-to-end tests ended successfully! :-)\n\n"
#end