diff --git a/bld_test_linux.sh b/bld_test_linux.sh index bd0070e0..e12e8128 100755 --- a/bld_test_linux.sh +++ b/bld_test_linux.sh @@ -1,25 +1,16 @@ #!/usr/bin/env bash +python setup.py build bdist_wheel - +# pip install dist/ImageD11-1.7.0-cp27-none-linux_x86_64.whl --user +# PYTHONPATH=$HOME/.local/lib/python2.7/site-packages +PYT=python SRC=`pwd` PYTHONPATH=$SRC/build/lib.linux-x86-64-2.7:$PYTHONPATH echo "Running tests from " $SRC " with PYTHONPATH " $PYTHONPATH -# Hmm - needs a switch case - -case `hostname` in - lapwright) PYT=python2.5 ;; - *) PYT=python ;; -esac - -cd $SRC -$PYT setup.py build -echo test_put_incr.py -cd $SRC/test -$PYT test_put_incr.py cd $SRC/test/demo @@ -28,9 +19,11 @@ $PYT latred_new.py echo `pwd` test.py $PYT test.py -cd $SRC/test/test_index_unknown -echo `pwd` test_index_unknown.py -$PYT test_index_unknown.py + +cd $SRC/test +python run_tests.py + + cd $SRC/test/quantix/ echo `pwd` testfitfilt.py @@ -44,23 +37,10 @@ cd $SRC/test ## takes really ages #python2.5 test_peaksearch.py ALL - -cd $SRC/test/gv_general -$PYT test_gv_general.py - -cd $SRC/test/testconnectedpixels -$PYT testconnectedpixels.py - -cd $SRC/test/testlabelimage -$PYT testlabelimage.py - cd $SRC/test/ken_simul $PYT idx.py cd $SRC/test/ -$PYT test_ubito.py -$PYT testcolumnfile.py -$PYT testscale.py $PYT testcol.py diff --git a/test/index_demos/generate_gv.py b/test/index_demos/generate_gv.py index ec7ec7b4..93e57ba2 100644 --- a/test/index_demos/generate_gv.py +++ b/test/index_demos/generate_gv.py @@ -124,7 +124,9 @@ def write_gve( gvecs, name): gv = makedata() + makedata() + makedata() + makedata() + makedata() write_gve( gv, "test.vecs") -import os -os.system("c:\python27\python c:\python27\Scripts\index_unknown.py -g test.vecs" + +import os, sys +cmd = sys.executable + " " + os.path.join("..","..","scripts","index_unknown.py") +print cmd +os.system(cmd + " -g test.vecs" + " -t 0.1 -f 0.05 --fft -s 20 -v 100 -m 40 -r 1. -k 10 -n 256") diff --git a/test/peaksearchtiftest/make_test_data.py b/test/peaksearchtiftest/make_test_data.py index 29bdc14e..a10eaaf7 100644 --- a/test/peaksearchtiftest/make_test_data.py +++ b/test/peaksearchtiftest/make_test_data.py @@ -2,7 +2,7 @@ from fabio import tifimage from ImageD11 import columnfile import numpy as np -import os, unittest +import os, unittest, sys class test_tifs(unittest.TestCase): @@ -11,6 +11,9 @@ class test_tifs(unittest.TestCase): LAST =16 NPK =0 + CMD = sys.executable + " " + os.path.join( + "..","..", "scripts", "peaksearch.py " ) + def setUp(self): blank = np.zeros((24,24),np.uint16) peak = blank.copy() @@ -37,7 +40,7 @@ def tearDown(self): def testpeaksearch(self): - os.system("peaksearch.py -n tiftest " + \ + os.system(self.CMD + " -n tiftest " + \ " -t 5 -F .tif -S 0.3 " + \ " -T 11 -p Y --OmegaOverRide " +\ " -f %d -l %d"%(self.FIRST, self.LAST)) @@ -48,7 +51,7 @@ def testpeaksearch(self): open( 'peaks_t6.flt').read().rstrip() ) def testpeaksearch_nooverride(self): - os.system("peaksearch.py -n tiftest " + \ + os.system(self.CMD + " -n tiftest " + \ " -t 6 -F .tif -S 0.3 " + \ " -T 11 -p Y " +\ " -f %d -l %d"%(self.FIRST, self.LAST)) @@ -59,7 +62,7 @@ def testpeaksearch_nooverride(self): open( 'peaks_t6.flt').read().rstrip() ) def testpeaksearch_singlethread(self): - os.system("peaksearch.py -n tiftest " + \ + os.system(self.CMD + " -n tiftest " + \ " -t 7 -F .tif -S 0.3 " + \ " -T 11 -p Y --singleThread " +\ " -f %d -l %d"%(self.FIRST, self.LAST)) diff --git a/test/run_tests.py b/test/run_tests.py index 91bbe7c8..5a47bbdf 100644 --- a/test/run_tests.py +++ b/test/run_tests.py @@ -32,4 +32,7 @@ MOD = importlib.import_module(M) mySuite = unittest.loader.findTestCases( MOD ) runner = unittest.TextTestRunner() - runner.run(mySuite) + try: + runner.run(mySuite) + except: + raise