diff options
-rw-r--r-- | meson.build | 8 | ||||
-rwxr-xr-x | tests/file-wait | 38 | ||||
-rw-r--r-- | tests/meson.build | 8 |
3 files changed, 50 insertions, 4 deletions
diff --git a/meson.build b/meson.build index 604b70a2..c796411f 100644 --- a/meson.build +++ b/meson.build @@ -178,10 +178,10 @@ if zmqdep.found() indexamajig_sources += ['src/im-zmq.c'] endif -executable('indexamajig', indexamajig_sources, - dependencies: [mdep, libcrystfeldep, gsldep, pthreaddep, zmqdep], - install: true, - install_rpath: '$ORIGIN/../lib64/:$ORIGIN/../lib') +indexamajig = executable('indexamajig', indexamajig_sources, + dependencies: [mdep, libcrystfeldep, gsldep, pthreaddep, zmqdep], + install: true, + install_rpath: '$ORIGIN/../lib64/:$ORIGIN/../lib') # make_pixelmap executable('make_pixelmap', diff --git a/tests/file-wait b/tests/file-wait new file mode 100755 index 00000000..69c11c90 --- /dev/null +++ b/tests/file-wait @@ -0,0 +1,38 @@ +#!/bin/sh + +INDEXAMAJIG=$1 +INFILE=$2 +GEOM=$3 + +function make_link { + sleep 5 + ln -s $INFILE file_wait_input.h5 +} + +if [ -f file_wait_input.h5 ]; then + echo file_wait_input.h5 exists. Not proceeding! + exit 1 +fi + +if [ -f file_wait_input.lst ]; then + echo file_wait_input.lst exists. Not proceeding! + exit 1 +fi + +if [ -f file_wait_input.stream ]; then + echo file_wait_input.stream exists. Not proceeding! + exit 1 +fi + +make_link & + +echo "file_wait_input.h5" > file_wait_input.lst +$INDEXAMAJIG -i file_wait_input.lst -o file_wait_input.stream -g $GEOM --wait-for-file=10 +OUTVAL=$? + +wait +rm -f file_wait_input.h5 file_wait_input.lst file_wait_input.stream + +if [ $OUTVAL -ne 0 ]; then + exit 1; +fi diff --git a/tests/meson.build b/tests/meson.build index 6f2822b7..9165a666 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -23,6 +23,14 @@ foreach name : partialator_tests endforeach +# Test of waiting for files +test('file-wait', + find_program('file-wait'), + args : [indexamajig.full_path(), + files('wavelength_geom.h5'), + files('wavelength_geom1.geom')]) + + # Easy unit tests of libcrystfel functions simple_tests = ['ambi_check', 'cell_check', |