Browse files

Allow test scripts to run in any directory.

This allows the test to ensure it is not accidentally loading the
package from the current directory, but instead from the installed
  • Loading branch information...
QuLogic committed May 13, 2015
1 parent 976a3ba commit d2c7d5bb05336e0fac66764e9cb70a9563dbfe6e
Showing with 12 additions and 6 deletions.
  1. +6 −4 run-coverage
  2. +3 −1 run-rtrain
  3. +3 −1 run-test
@@ -1,17 +1,19 @@
#!/bin/bash -e
+BASE=$(dirname $0)
rm -rf .coverage
rm -rf .coverage.*
rm -rf temp
-python -m coverage run -p ocropus-nlbin tests/testpage.png -o temp
+python -m coverage run -p ocropus-nlbin $BASE/tests/testpage.png -o temp
python -m coverage run -p ocropus-gpageseg 'temp/????.bin.png'
python -m coverage run -p ocropus-rpred -n 'temp/????/??????.bin.png'
python -m coverage run -p ocropus-hocr 'temp/????.bin.png' -o temp.html
python -m coverage run -p ocropus-visualize-results temp
python -m coverage run -p ocropus-gtedit html temp/????/??????.bin.png -o temp-correction.html
-python -m coverage run -p ocropus-rpred tests/0079-01000d.png
-python -m coverage run -p ocropus-errs tests/
-python -m coverage run -p ocropus-econf tests/
+python -m coverage run -p ocropus-rpred $BASE/tests/0079-01000d.png
+python -m coverage run -p ocropus-errs $BASE/tests/
+python -m coverage run -p ocropus-econf $BASE/tests/
python -m coverage merge
rm -rf htmlcov
python -m coverage html
@@ -1,4 +1,6 @@
#!/bin/bash -ex
-tar -zxf tests/uw3-500.tgz
+BASE=$(dirname $0)
+tar -zxf $BASE/tests/uw3-500.tgz
ocropus-rtrain 'book/*/*.bin.png' -d 5 -o uw3-500-model
@@ -1,7 +1,9 @@
#!/bin/bash -e
+BASE=$(dirname $0)
rm -rf temp
-ocropus-nlbin tests/testpage.png -o temp
+ocropus-nlbin $BASE/tests/testpage.png -o temp
ocropus-gpageseg 'temp/????.bin.png'
ocropus-rpred -n 'temp/????/??????.bin.png'
ocropus-hocr 'temp/????.bin.png' -o temp.html

0 comments on commit d2c7d5b

Please sign in to comment.