Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jonwright committed Apr 7, 2017
1 parent 4cf4f81 commit a7ecff9
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 36 deletions.
38 changes: 9 additions & 29 deletions bld_test_linux.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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


Expand Down
6 changes: 4 additions & 2 deletions test/index_demos/generate_gv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

11 changes: 7 additions & 4 deletions test/peaksearchtiftest/make_test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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()
Expand All @@ -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))
Expand All @@ -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))
Expand All @@ -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))
Expand Down
5 changes: 4 additions & 1 deletion test/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a7ecff9

Please sign in to comment.