diff --git a/tests.aarbology.sh b/tests.aarbology.sh index c52f164b361e7a3221e455ce42f632a837da76fd..2dd0de4d74405d74a3f81abeb51a93cf654ffcfb 100755 --- a/tests.aarbology.sh +++ b/tests.aarbology.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +source bash_multithread.sh + # $1 test dir suffix (debug / release) # SETTINGS @@ -183,6 +185,7 @@ function runTestSubtree { echo -ne "\t" initResults + bgxgrp="" # predefined tests first for SUBJECT_FILE in `ls $TESTS_DIR/aarbology.test*.subject.xml`; do @@ -196,10 +199,12 @@ function runTestSubtree { Occs=`./aarbology2 -a exactSubtreeMatch -s "$SUBJECT_FILE_COPY" -p "$PATTERN_FILE_COPY" | ./astat2 -p size` - runTest2 "$Occs" "$2" "$SUBJECT_FILE_COPY" "$PATTERN_FILE_COPY" + bgxlimit ${JOBS} runTest2 "$Occs" "$2" "$SUBJECT_FILE_COPY" "$PATTERN_FILE_COPY" fi done + bgxwait + echo -n " | " # random tests @@ -213,10 +218,10 @@ function runTestSubtree { Occs=`./aarbology2 -a exactSubtreeMatch -s "$SUBJECT_FILE" -p "$PATTERN_FILE" | ./astat2 -p size` - runTest2 "$Occs" "$2" "$SUBJECT_FILE" "$PATTERN_FILE" & (( i%JOBS==0 )) && wait + bgxlimit ${JOBS} runTest2 "$Occs" "$2" "$SUBJECT_FILE" "$PATTERN_FILE" done - wait + bgxwait outputResults clearResults @@ -228,6 +233,7 @@ function runTestPattern { echo -ne "\t" initResults + bgxgrp="" # predefined tests first for SUBJECT_FILE in `ls $TESTS_DIR/aarbology.test*.subject.xml`; do @@ -241,10 +247,12 @@ function runTestPattern { Occs=`./aarbology2 -a exactPatternMatch -s "$SUBJECT_FILE_COPY" -p "$PATTERN_FILE_COPY" | ./astat2 -p size` - runTest2 "$Occs" "$2" "$SUBJECT_FILE_COPY" "$PATTERN_FILE_COPY" + bgxlimit ${JOBS} runTest2 "$Occs" "$2" "$SUBJECT_FILE_COPY" "$PATTERN_FILE_COPY" fi done + bgxwait + echo -n " | " # random tests @@ -258,10 +266,10 @@ function runTestPattern { Occs=`./aarbology2 -a exactPatternMatch -s "$SUBJECT_FILE" -p "$PATTERN_FILE" | ./astat2 -p size` - runTest2 "$Occs" "$2" "$SUBJECT_FILE" "$PATTERN_FILE" & (( i%JOBS==0 )) && wait + bgxlimit ${JOBS} runTest2 "$Occs" "$2" "$SUBJECT_FILE" "$PATTERN_FILE" done - wait + bgxwait outputResults clearResults @@ -273,6 +281,7 @@ function runTestNonlinearPattern { echo -ne "\t" initResults + bgxgrp="" # predefined tests first for SUBJECT_FILE in `ls $TESTS_DIR/aarbology.test*.subject.xml`; do @@ -286,10 +295,12 @@ function runTestNonlinearPattern { Occs=`./aarbology2 -a exactPatternMatch -s "$SUBJECT_FILE_COPY" -p "$PATTERN_FILE_COPY" | ./astat2 -p size` - runTest2 "$Occs" "$2" "$SUBJECT_FILE_COPY" "$PATTERN_FILE_COPY" + bgxlimit ${JOBS} runTest2 "$Occs" "$2" "$SUBJECT_FILE_COPY" "$PATTERN_FILE_COPY" fi done + bgxwait + echo -n " | " # random tests @@ -303,10 +314,10 @@ function runTestNonlinearPattern { Occs=`./aarbology2 -a exactPatternMatch -s "$SUBJECT_FILE" -p "$PATTERN_FILE" | ./astat2 -p size` - runTest2 "$Occs" "$2" "$SUBJECT_FILE" "$PATTERN_FILE" & (( i%JOBS==0 )) && wait + bgxlimit ${JOBS} runTest2 "$Occs" "$2" "$SUBJECT_FILE" "$PATTERN_FILE" done - wait + bgxwait outputResults clearResults @@ -318,6 +329,7 @@ function runTestPatternEnds { echo -ne "\t" initResults + bgxgrp="" # predefined tests first for SUBJECT_FILE in `ls $TESTS_DIR/aarbology.test*.subject.xml`; do @@ -331,10 +343,12 @@ function runTestPatternEnds { Occs=`./aarbology2 -e -a exactPatternMatch -s <(./acast2 -t PrefixRankedTree -i "$SUBJECT_FILE_COPY" ) -p <(./acast2 -t PrefixRankedPattern -i "$PATTERN_FILE_COPY" ) | ./astat2 -p size` - runTest2 "$Occs" "$2" "$SUBJECT_FILE_COPY" "$PATTERN_FILE_COPY" + bgxlimit ${JOBS} runTest2 "$Occs" "$2" "$SUBJECT_FILE_COPY" "$PATTERN_FILE_COPY" fi done + bgxwait + echo -n " | " # random tests @@ -348,10 +362,10 @@ function runTestPatternEnds { Occs=`./aarbology2 -e -a exactPatternMatch -s <(./acast2 -t PrefixRankedTree -i "$SUBJECT_FILE" ) -p <(./acast2 -t PrefixRankedPattern -i "$PATTERN_FILE" ) | ./astat2 -p size` - runTest2 "$Occs" "$2" "$SUBJECT_FILE" "$PATTERN_FILE" & (( i%JOBS==0 )) && wait + bgxlimit ${JOBS} runTest2 "$Occs" "$2" "$SUBJECT_FILE" "$PATTERN_FILE" done - wait + bgxwait outputResults clearResults @@ -363,6 +377,7 @@ function runTestNonlinearPatternEnds { echo -ne "\t" initResults + bgxgrp="" # predefined tests first for SUBJECT_FILE in `ls $TESTS_DIR/aarbology.test*.subject.xml`; do @@ -376,10 +391,12 @@ function runTestNonlinearPatternEnds { Occs=`./aarbology2 -e -a exactPatternMatch -s <(./acast2 -t PrefixRankedTree -i "$SUBJECT_FILE_COPY" ) -p <(./acast2 -t PrefixRankedNonlinearPattern -i "$PATTERN_FILE_COPY" ) | ./astat2 -p size` - runTest2 "$Occs" "$2" "$SUBJECT_FILE_COPY" "$PATTERN_FILE_COPY" + bgxlimit ${JOBS} runTest2 "$Occs" "$2" "$SUBJECT_FILE_COPY" "$PATTERN_FILE_COPY" fi done + bgxwait + echo -n " | " # random tests @@ -393,10 +410,10 @@ function runTestNonlinearPatternEnds { Occs=`./aarbology2 -e -a exactPatternMatch -s <(./acast2 -t PrefixRankedTree -i "$SUBJECT_FILE" ) -p <(./acast2 -t PrefixRankedNonlinearPattern -i "$PATTERN_FILE" ) | ./astat2 -p size` - runTest2 "$Occs" "$2" "$SUBJECT_FILE" "$PATTERN_FILE" & (( i%JOBS==0 )) && wait + bgxlimit ${JOBS} runTest2 "$Occs" "$2" "$SUBJECT_FILE" "$PATTERN_FILE" done - wait + bgxwait outputResults clearResults diff --git a/tests.aconversion.sh b/tests.aconversion.sh index 7f2839256a52b0b74eb4efab0cd5c2d996018a77..850f4b67b9790be47f6e781a83989c9224bd113e 100755 --- a/tests.aconversion.sh +++ b/tests.aconversion.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +source bash_multithread.sh + # $1 test dir suffix (debug / release) # SETTINGS @@ -152,6 +154,7 @@ function runTest { echo -ne "\t" initResults + bgxgrp="" # predefined tests first for FILE in `ls $TESTS_DIR/aconversion.test*`; do @@ -159,9 +162,11 @@ function runTest { cat $FILE > $FILE_COPY - runTest2 "$1" "$FILE_COPY" + bgxlimit ${JOBS} runTest2 "$1" "$FILE_COPY" done + bgxwait + echo -n " | " # random tests @@ -171,10 +176,10 @@ function runTest { cat <(generateNFA) > $NFA_FILE - runTest2 "$1" "$NFA_FILE" & (( i%JOBS==0 )) && wait + bgxlimit ${JOBS} runTest2 "$1" "$NFA_FILE" done - wait + bgxwait outputResults clearResults diff --git a/tests.anormalize.sh b/tests.anormalize.sh index 8172238f1ac74e541009738f60da4b0c3b0285ff..c7e7e6ea6d93cbbc768b08031d3bc2298277dae5 100755 --- a/tests.anormalize.sh +++ b/tests.anormalize.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +source bash_multithread.sh + # $1 test dir suffix (debug / release) # SETTINGS @@ -153,6 +155,7 @@ function runTest { echo -ne "\t" initResults + bgxgrp="" # predefined tests first for FILE in `ls $TESTS_DIR/anormalization.test*`; do @@ -160,9 +163,11 @@ function runTest { cat $FILE > $FILE_COPY - runTest2 "$1" "$FILE_COPY" + bgxlimit ${JOBS} runTest2 "$1" "$FILE_COPY" done + bgxwait + echo -n " | " # random tests @@ -172,10 +177,10 @@ function runTest { cat <(generateCFG) > $CFG_FILE - runTest2 "$1" "$CFG_FILE" & (( i%JOBS==0 )) && wait + bgxlimit ${JOBS} runTest2 "$1" "$CFG_FILE" done - wait + bgxwait outputResults clearResults diff --git a/tests.astringology.sh b/tests.astringology.sh index 8e4efe5310c0b97ddf7da9fe081fb0e0a95a889c..e4bef59bc526a17072816a2298562c8b2e43501e 100755 --- a/tests.astringology.sh +++ b/tests.astringology.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +source bash_multithread.sh + # $1 test dir suffix (debug / release) # SETTINGS @@ -169,6 +171,7 @@ function runTest { echo -ne "\t" initResults + bgxgrp="" # predefined tests first for SUBJECT_FILE in `ls $TESTS_DIR/astringology.test*.subject.xml`; do @@ -182,10 +185,12 @@ function runTest { Occs=`./astringology2 -a exactFactorMatch -s "$SUBJECT_FILE_COPY" -p "$PATTERN_FILE_COPY" | ./astat2 -p size` - runTest2 "$Occs" "$2" "$SUBJECT_FILE_COPY" "$PATTERN_FILE_COPY" + bgxlimit ${JOBS} runTest2 "$Occs" "$2" "$SUBJECT_FILE_COPY" "$PATTERN_FILE_COPY" fi done + bgxwait + echo -n " | " # random tests @@ -199,10 +204,10 @@ function runTest { Occs=`./astringology2 -a exactFactorMatch -s "$SUBJECT_FILE" -p "$PATTERN_FILE" | ./astat2 -p size` - runTest2 "$Occs" "$2" "$SUBJECT_FILE" "$PATTERN_FILE" & (( i%JOBS==0 )) && wait + bgxlimit ${JOBS} runTest2 "$Occs" "$2" "$SUBJECT_FILE" "$PATTERN_FILE" done - wait + bgxwait outputResults clearResults