Commit e4d589d1 authored by Mikaël Salson's avatar Mikaël Salson
Browse files

Merge branch 'feature-ga/3035-gapped-J+3036-3039-tests' into 'dev'

Germline tests, regenerate germlines

Closes #3036, #3039, and #3083

See merge request !158
parents 08546844 a7c68f2e
Pipeline #19766 passed with stages
in 47 seconds
......@@ -36,9 +36,9 @@ test_germlines:
stage: test_germlines
script:
- make -C germline get-all-data
- make -C algo/tests should_germline
- make -C germline/tests
only:
- /^feature-g\/.*$/
- /^feature-.*g.*\/.*$/
# Algorithm
......@@ -47,31 +47,31 @@ test_algo_unit:
stage: test_unit
script: make -C algo unit
only:
- /^feature-a\/.*$/
- /^feature-.*a.*\/.*$/
test_tools_unit:
stage: test_unit
script: make -C tools/tests
only:
- /^feature-a\/.*$/
- /^feature-.*a.*\/.*$/
test_algo_should:
stage: test_functional
script: make -C algo should
only:
- /^feature-a\/.*$/
- /^feature-.*a.*\/.*$/
test_algo_shouldvdj:
stage: test_shouldvdj
script: make -C algo shouldvdj
only:
- /^feature-a\/.*$/
- /^feature-.*a.*\/.*$/
algo_valgrind_unit:
stage: valgrind_unit
script: make -C algo valgrind_unit
only:
- /^feature-a\/.*$/
- /^feature-.*a.*\/.*$/
tags:
- valgrind
......@@ -80,7 +80,7 @@ algo_valgrind_functional:
script: make -C algo valgrind_should
when: manual
only:
- /^feature-a\/.*$/
- /^feature-.*a.*\/.*$/
tags:
- valgrind
......@@ -89,14 +89,14 @@ prepare_release:
script: make -C algo release RELEASE_TAG='rc'
when: manual
only:
- /^feature-a\/.*$/
- /^feature-.*a.*\/.*$/
release:
stage: release
script: make -C algo release RELEASE_TAG=`cat algo/release`
when: manual
only:
- /^feature-a\/release$/
- /^feature-.*a.*\/release$/
artifacts:
paths:
- algo/releases/vidjil-algo-`cat algo/release`.tar.gz
......@@ -113,8 +113,8 @@ test_browser_unit:
paths:
- browser/
only:
- /^feature-[cw]\/.*$/
- /^hotfix-[cw]\/.*$/
- /^feature-.*c.*\/.*$/
- /^hotfix-.*c.*\/.*$/
- prod-client
- dev
tags:
......@@ -131,8 +131,8 @@ test_browser-functional:
paths:
- browser/
only:
- /^feature-[cw]\/.*$/
- /^hotfix-[cw]\/.*$/
- /^feature-.*c.*\/.*$/
- /^hotfix-.*c.*\/.*$/
- prod-client
tags:
- web
......@@ -149,8 +149,8 @@ test_browser-functional-external:
paths:
- browser/
only:
- /^feature-[cw]\/.*$/
- /^hotfix-[cw]\/.*$/
- /^feature-.*c.*\/.*$/
- /^hotfix-.*c.*\/.*$/
- prod-client
tags:
- web
......@@ -159,8 +159,8 @@ code_quality:
stage: test_quality
script: make -C browser quality
only:
- /^feature-[cw]\/.*$/
- /^hotfix-[cw]\/.*$/
- /^feature-.*c.*\/.*$/
- /^hotfix-.*c.*\/.*$/
- prod-client
- dev
tags:
......@@ -199,8 +199,8 @@ deploy_review:
url: http://$CI_BUILD_REF_SLUG.ci.vidjil.org/?data=analysis-example.vidjil
on_stop: stop_deploy_review
only:
- /^feature-[cw]\/.*$/
- /^hotfix-[cw]\/.*$/
- /^feature-.*c.*\/.*$/
- /^hotfix-.*c.*\/.*$/
tags:
- web
......@@ -233,7 +233,7 @@ stop_deploy_review:
name: review/$CI_BUILD_REF_NAME
action: stop
only:
- /^feature-[cw]\/.*$/
- /^hotfix-[cw]\/.*$/
- /^feature-.*c.*\/.*$/
- /^hotfix-.*c.*\/.*$/
tags:
- web
......@@ -8,8 +8,6 @@ EXEC=$(SRC:.cpp=)
OBJ=$(SRC:.cpp=.o)
OTHER_SRC=$(wildcard unit-tests/*.cpp)
LIB=../core/vidjil.a ../lib/lib.a
SHOULD_GERMLINE=$(wildcard should-get-tests/10-germlines-*.should-get)
SHOULD_GERMLINE_LOG=$(SHOULD_GERMLINE:.should-get=.tap)
SHOULD=$(wildcard should-get-tests/*.should-get) $(wildcard bugs/*.should-get)
SHOULD_LOG=$(SHOULD:.should-get=.tap)
SHOULD_VDJ=$(wildcard should-vdj-tests/*.should-vdj.fa)
......@@ -69,8 +67,6 @@ snapshot_diff_current:
-diff -u -I ".*20..-..-...*" snapshot-last $(SNAPSHOT_CURRENT)
should_germline: $(SHOULD_GERMLINE_LOG)
should_raw: vidjil $(SHOULD_LOG)
should:
......
......@@ -45,7 +45,7 @@ $ Check md5 in germline/, sequences split and processed from germline and other
$ Check md5 in germline/, other sequences
1:9112d6975669ccb59970fa79ceef599d homo-sapiens/CD-sorting.fa
1:61dfe19ec7af93f0d85c17248f2b0429 homo-sapiens/CD.fa
1:e6540659d36fa37f83f7e1463dde906f homo-sapiens/CD.fa
1:eb32e780af5a4b8c0d1e9d780bacac43 homo-sapiens/IGHC=A1.fa
1:b1ea36c4255c63d775ecdb03967ec89e homo-sapiens/IGHC=A2.fa
1:43c54f3ddedfde87f70b0e0bea2d6d5f homo-sapiens/IGHC=D.fa
......@@ -56,20 +56,20 @@ $ Check md5 in germline/, other sequences
1:d5123a856e2dedacfcfcd5fd11ebc2bc homo-sapiens/IGHC=G4.fa
1:6c1e3e61d5824a03f71a5527ccdbb35c homo-sapiens/IGHC=GP.fa
1:dd2263230c64abb9a22f5f8b7a979275 homo-sapiens/IGHC=M.fa
1:ee931390172a155c57e5102becc61a94 homo-sapiens/IGHD_upstream.fa
1:a5908f30af350a1addc2b32b6c0a3687 homo-sapiens/IGHJ_downstream.fa
1:2ed67cdd3d8f8fe3096afe747a0df205 homo-sapiens/IGHD.up.fa
1:a13a4c31570952c6c7fc1e7161051675 homo-sapiens/IGHJ.down.fa
1:7d6247262807ad5478b7a4e52a59c568 homo-sapiens/IGK-INTRON.fa
1:1147a04c4e8a8dd534aae65db1ae13ca homo-sapiens/IGK-KDE.fa
1:8bcc31b17b2b189cf63b777b2d265429 homo-sapiens/IGKJ_downstream.fa
1:ce3c1393aaecd458f699f7d6033f52e1 homo-sapiens/IGLJ_downstream.fa
1:cc8387faed2ed512aace00fa3da2237b homo-sapiens/TRAJ_downstream.fa
1:d651bd2f53e63bcbdd0212296c863e7f homo-sapiens/TRBD_upstream.fa
1:da84091de4d8b3eb5d45597761c23214 homo-sapiens/TRBJ_downstream.fa
1:1323fa3a4ff0e9633d1f56fd8dfeae73 homo-sapiens/TRDD2_upstream.fa
1:d22703bc2d88f2b8e540b02d27a7c2cb homo-sapiens/TRDD3_downstream.fa
1:cad48f69caadd2d1bf49ee770b494f87 homo-sapiens/TRDD_upstream.fa
1:93ef44f3b523cc1f31309fa8155ee6f4 homo-sapiens/TRDJ_downstream.fa
1:bca56d51783e873afce73a0064d13841 homo-sapiens/TRGJ_downstream.fa
1:805f326b92db78d8276b5a58b0f93fa2 homo-sapiens/IGKJ.down.fa
1:9f37008bdabf1d7102d753845e36309e homo-sapiens/IGLJ.down.fa
1:68e06198c4f41898533fecd30b86a446 homo-sapiens/TRAJ.down.fa
1:79f9526d456d4550c1451a67e34efa51 homo-sapiens/TRBD.up.fa
1:052da0d01539810a3ede514ade7ec988 homo-sapiens/TRBJ.down.fa
1:e0a1860c5f9f937800c4b9d090f0c8aa homo-sapiens/TRDD.up.fa
1:4f1d8f0e508e7e40adbd8896b64a905c homo-sapiens/TRDD2.up.fa
1:d8017c8ee68383b874f7ff00efab0db6 homo-sapiens/TRDD3.down.fa
1:a0a77c861cb4abc5222fad9da143e2b9 homo-sapiens/TRDJ.down.fa
1:f1ae8b4f91c3ab3cad31e490f09eeff0 homo-sapiens/TRGJ.down.fa
1:48f54c5af4f8d748ab2f02b2a6ea3370 mus-musculus/IGHC=A.fa
1:25cb0451d31ca5337d462eb648914fe7 mus-musculus/IGHC=D.fa
1:8f2ec40bc77a4e7f0c7b19655812ddbc mus-musculus/IGHC=E.fa
......@@ -79,17 +79,17 @@ $ Check md5 in germline/, other sequences
1:03cd9b5729ec3de23b302c476a51c9d3 mus-musculus/IGHC=G2C.fa
1:744e59a4b5d1fc53beae91a0bee8f34a mus-musculus/IGHC=G3.fa
1:b72bc2ed53226dd68519bb0cb679f608 mus-musculus/IGHC=M.fa
1:6999c4b5e2e6826db38c2b7031898549 mus-musculus/IGHD_upstream.fa
1:0d08472c439919e7f1ff3f94e219ce06 mus-musculus/IGHJ_downstream.fa
1:1a78ebfac3014fb315e351be5a47cd6d mus-musculus/IGKJ_downstream.fa
1:fed03cc1dd8db74e7ca0f8a096684c43 mus-musculus/IGLJ_downstream.fa
1:49d297ec599be873ecff7e87d6d18280 mus-musculus/TRAJ_downstream.fa
1:636b7f7e5218c0873bceca4383de854e mus-musculus/TRBD_upstream.fa
1:5fa4ab0abd39a77570c20d091bd44125 mus-musculus/TRBJ_downstream.fa
1:d30451ef4f292ed3dfa530305601f44b mus-musculus/TRDD2_upstream.fa
1:c1cf00ac2d5d602b1b091c24efd0f8d8 mus-musculus/TRDD_upstream.fa
1:86c419035414b6a90d5a6ef3d8befbf5 mus-musculus/TRDJ_downstream.fa
1:b251b775573a57383133b7736bf4a9cd mus-musculus/TRGJ_downstream.fa
1:bacb56a07cfcd93a4734fa25a832a805 mus-musculus/IGHD.up.fa
1:07cd7e934d5ad5b804b5e8008c3f6662 mus-musculus/IGHJ.down.fa
1:94cb5eaa7f9b1732fe9f21bfaee11af7 mus-musculus/IGKJ.down.fa
1:8b2a0ea8303c8bc21ca6c9669a91cc7a mus-musculus/IGLJ.down.fa
1:f3840f00f202cafd36d2cd3b17608bbd mus-musculus/TRAJ.down.fa
1:60ad210f435d4f31b37f0254bf9d96fe mus-musculus/TRBD.up.fa
1:8be584820144e5f8960ac71361752f10 mus-musculus/TRBJ.down.fa
1:97a0118ff5659b8e46e937e3b4afa43c mus-musculus/TRDD.up.fa
1:b1e00c7630580fd3c79801ae9174734d mus-musculus/TRDD2.up.fa
1:5481f5e78573695406baa58a04689d2c mus-musculus/TRDJ.down.fa
1:1d823716238ad85afe903fa7db8604c2 mus-musculus/TRGJ.down.fa
1:90075c7d51bd1d08892163848a8f2ecc rattus-norvegicus/IGHC=A.fa
1:e0d2d3e90980bf783e35d3775a3c327d rattus-norvegicus/IGHC=D.fa
1:8461bb440ad2264eb638d948bda186ab rattus-norvegicus/IGHC=E.fa
......@@ -98,6 +98,6 @@ $ Check md5 in germline/, other sequences
1:6f2605929ae226fd7ebaf9b40d948a85 rattus-norvegicus/IGHC=G2B.fa
1:36f7704ea32dbc0eb71c4ffbe459c23c rattus-norvegicus/IGHC=G2C.fa
1:a27b6fc827063a041062a8b4b2945232 rattus-norvegicus/IGHC=M.fa
1:9083a8624f30a489d8629a00ad583acb rattus-norvegicus/IGHD_upstream.fa
1:e033a04d204536607efc008046060857 rattus-norvegicus/IGHJ_downstream.fa
1:9ea41ae8e5c74dd579dacf04d2069e64 rattus-norvegicus/IGLJ_downstream.fa
1:a122818ff4b6ef5e2013a1ae1c493425 rattus-norvegicus/IGHD.up.fa
1:3445516778ab4fbf96cf4008a40e6fe2 rattus-norvegicus/IGHJ.down.fa
1:69aa6db3bb8a332289ab3b5cf5ab3b5a rattus-norvegicus/IGLJ.down.fa
#!/usr/bin/env bash
if [ $# -eq 0 -o "$1" == "-h" -o "$1" == "--help" ]; then
echo "Usage: $0 <file.should_get>
This script takes as input a .should_get file. Don't know what it is? Read this!
In the .should_get format, every line starting with a # is a comment
every line starting with a $ is a description of the test
non empty lines, must be of the following form:
<info>:<regexp>
where <regexp> is a regular expression passed to `grep -E`
(beware to escape backslashes).
info is the number of times this regular expression should occur in the file.
the info can be prefixed by a letter either s or f or e (they can be mixed):
s: if the test fails, we skip it
f: even if the test fails, the script will not exit with an error code.
e: the pattern must be searched exactly, regexp-specific characters will
automatically be escaped if they're not already escaped.
The script must contain a !LAUNCH: line stating what command line to be
launched (the working directory is the directory where the input file is). A
line starting with !LOG: is the filename used for redirecting STDOUT from the
command line. By default it is the input should_get filename where the extension
is replaced by .log. If !OUTPUT_FILE: is provided then the program is assumed to
produce a file whose filename is given after !OUTPUT_FILE:. This file will be
parsed by the script. The !LOG: file won't be used. By default, output files
are produced in the working directory, to change this behavior, specify an
option after the option !OUTPUT_DIR:
By default spaces can be replaced by any whitespaces. You can override this by
specifying !IGNORE_WHITESPACES: 0
* Exit code
The exit code of the launched command line is also checked. By default, an
exit code of 0 is expected. The .should_get file can specify an option
!EXIT_CODE: indacting another expected value.
* Requirements
Sometimes, to launch a test some requirements must be met. If the requirements
are not met we may want to skip the test. To do so, specify in the file
an option !REQUIRES: which will be followed by a command that is supposed
to exit with the error code 0. If the error code is different from 0 all the
tests in the file will be skipped.
* Environment
** Debug
If the environment variable DEBUG is defined, then some debug information
is output.
** Launcher
If one wants to use a launcher that will execute the program, then
environment variable LAUNCHER must be defined, with the program name to
use as a launcher (eg. valgrind).
A .should_get file may specify an option !NO_LAUNCHER: to tell that this
must not be launched using a launcher. Also, in the !LAUNCH option,
$LAUNCHER may be specified if the launcher must not be put at the start
of the command line, but somewhere else.
* Output
The output is in TAP format and consists of a file whose name is the same
as the input file, where .should_get is replaced by .tap
" >&2
exit 1
fi
debug() {
if [ ! -z "$DEBUG" ]; then
echo $* >&2
fi
}
file=$1
DIR=$(dirname $file)
BASE=$(basename $file)
cd "$DIR"
EXEC=vidjil-algo
VIDJIL_DIR=../../../
VIDJIL_DEFAULT_OPTIONS=""
VIDJIL_DATA=../data/
OUTPUT_DIR=.
TAP_FILE=${BASE%.*}.tap
LOG_FILE=${BASE%.*}.log
EXPECTED_EXIT_CODE=0
EXIT_CODE=
OUTPUT_FILE=
FILE_TO_GREP=
NO_LAUNCHER=
REQUIRE=
IGNORE_WHITESPACES=1
SEPARATOR_LINE="========================================================================"
TMP_TAP_FILE=$(mktemp tap.XXXX)
{
nb_tests=0
# Count number of tests to be performed
nb_tests=`grep -Ec '^[^$#!]' $BASE`
nb_tests=$((nb_tests+1))
echo "1.."$nb_tests
test_nb=1
error=0
not_ok=$?
line_nb=1
failed_lines=()
launched=0 # Did we launch the program yet?
cmd=
while read line; do
if [ ! -z "$line" ]; then
if [ ${line:0:1} == "!" ]; then
line=${line:1}
type=${line%%:*}
if [ "$type" == "LAUNCH" ]; then
eval cmd=\"${line#*:}\"
elif [ "$type" == "EXIT_CODE" ]; then
EXPECTED_EXIT_CODE=${line#*:}
elif [ "$type" == "LOG" ]; then
eval LOG_FILE=\"${line#*:}\"
elif [ "$type" == "OUTPUT_FILE" ]; then
eval OUTPUT_FILE=\"${line#*:}\"
elif [ "$type" == "OUTPUT_DIR" ]; then
eval OUTPUT_DIR=\"${line#*:}\"
elif [ "$type" == "NO_LAUNCHER" ]; then
NO_LAUNCHER=1
elif [ "$type" == "IGNORE_WHITESPACES" ]; then
IGNORE_WHITESPACES=${line#*:}
elif [ "$type" == "REQUIRES" ]; then
REQUIRE=${line#*:}
else
echo "Unknown option $type" >&2
fi
elif [ ${line:0:1} == '$' ]; then
msg=${line:1}
else
# This is not a comment
if [ ${line:0:1} != '#' ]; then
if [ $launched -eq 0 ]; then
if [ -z "$cmd" ]; then
echo "Error: you must specify a !LAUNCH: line in $file" >&2
exit 2
fi
# Should we use a launcher?
if [ ! -z "$LAUNCHER" -a -z "$NO_LAUNCHER" ]; then
# Yes, we should.
# Do we need to specify the place where LAUNCHER should be?
if [[ "$cmd" != *'$LAUNCHER'* && "$cmd" != *"$LAUNCHER"* ]]; then
cmd="$LAUNCHER ""$cmd"
fi
fi
echo "Launching '$cmd'" >&2
if [ -z "$OUTPUT_FILE" ]; then
mkdir -p "$(pwd)/$(dirname $LOG_FILE)"
eval $cmd > $LOG_FILE
EXIT_CODE=$?
FILE_TO_GREP=$LOG_FILE
else
eval $cmd > /dev/null
EXIT_CODE=$?
FILE_TO_GREP=$OUTPUT_FILE
fi
launched=1
TAP_FILE=$OUTPUT_DIR/$TAP_FILE
LOG_FILE=$OUTPUT_DIR/$LOG_FILE
echo "==>" $TAP_FILE >&2
fi
skip=0
know_to_fail=0
exact=0
pattern=$(cut -d: -f2- <<< "$line")
nb_hits=$(cut -d: -f1 <<< "$line")
# Remove trailing whitespaces.
# Depending on Bash version they are not handled in the same way → uniformize
pattern=$(sed -r 's/^[[:space:]]*//' <<< "$pattern")
# Escape special characters for sed
pattern=$(sed -r 's/[/&]/\\&/g' <<< $pattern)
while ! [ "${nb_hits:0:1}" -eq "${nb_hits:0:1}" ] 2> /dev/null; do
case ${nb_hits:0:1} in
"s")
skip=1;; # We skip the test if it fails
"f")
know_to_fail=1;; # We know the test fails, but don't fail globally
"e")
# Exact: protect any character that may be part of
# a regex
pattern=$(sed -r 's/([^\\])(\.|\||\-|\+|\*|\[|\]|\(|\)|\{|\})/\1\\\2/g' <<< $pattern);;
esac
nb_hits=${nb_hits:1}
done
if ! eval $REQUIRE > /dev/null 2> /dev/null; then
skip=1
fi
# Replace whitespaces if needed
if [ $IGNORE_WHITESPACES -ne 0 ]; then
pattern=$(sed -r 's/[[:space:]]+/[[:space:]]+/g' <<< $pattern)
fi
debug "Grepping \"$pattern\" in $FILE_TO_GREP"
nb_hits_found=$(sed -rn "/$pattern/p" < $FILE_TO_GREP | wc -l | sed "s/ //g")
if [ $nb_hits_found -eq $nb_hits -o $skip -eq 1 ]; then
if [ $know_to_fail -eq 1 ]; then
echo "Warning: test $test_nb should have failed, but has not!" >&2
fi
echo -n "ok"
else
echo -n "not ok"
if [ $know_to_fail -eq 0 ]; then
error=1
echo >&2; echo >&2; echo $SEPARATOR_LINE >&2
echo "$file failed ($nb_hits_found instead of $nb_hits)" >&2
echo "$line" >&2
echo $FILE_TO_GREP >&2
echo $SEPARATOR_LINE >&2
cat $FILE_TO_GREP | head -n 100 >&2
echo $SEPARATOR_LINE >&2; echo >&2; echo >&2
fi
fi
echo -n " "$test_nb" "
if [ $skip -eq 1 ]; then
echo -n "# SKIP "
fi
if [ $know_to_fail -eq 1 ]; then
echo -n "# TODO "
fi
echo "- " $msg
test_nb=$((test_nb+1))
fi
fi
fi
line_nb=$((line_nb+1))
done < $BASE
# Check exit code
if [ $EXIT_CODE -eq $EXPECTED_EXIT_CODE ]; then
echo "ok $test_nb - Exit code $EXIT_CODE"
else
echo -n "not ok $test_nb "
if ! eval $REQUIRE > /dev/null 2> /dev/null; then
echo -n "# SKIP "
else
error=1
echo >&2; echo >&2; echo $SEPARATOR_LINE >&2
echo "error: exit code $EXIT_CODE (expected $EXPECTED_EXIT_CODE)" >&2
echo $SEPARATOR_LINE >&2
cat $FILE_TO_GREP >&2
echo $SEPARATOR_LINE >&2; echo >&2; echo >&2
fi
echo "- Exit code $EXIT_CODE"
fi
} > $TMP_TAP_FILE
mv $TMP_TAP_FILE $TAP_FILE
echo >&2
exit $error
../../tools/should-to-tap.sh
\ No newline at end of file
{
"ref": "http://www.vidjil.org/germlines/germline-49.tar.gz",
"ref": "http://www.vidjil.org/germlines/germline-52.tar.gz",
"species": "Homo sapiens",
"species_taxon_id": 9606,
......
SHOULD=$(wildcard should-get-tests/*.should-get)
TAP=$(SHOULD:.should-get=.tap)
all: $(TAP)
%.tap: %.should-get force
./should-to-tap.sh $<
force:
../../tools/should-to-tap.sh
\ No newline at end of file
#!/usr/bin/env bash
if [ $# -eq 0 -o "$1" == "-h" -o "$1" == "--help" ]; then
echo "Usage: $0 <file.should_get>
This script takes as input a .should_get file. Don't know what it is? Read this!
In the .should_get format, every line starting with a # is a comment
every line starting with a $ is a description of the test
non empty lines, must be of the following form:
<info>:<regexp>
where <regexp> is a regular expression passed to `grep -E`
(beware to escape backslashes).
info is the number of times this regular expression should occur in the file.
the info can be prefixed by a letter either s or f or e (they can be mixed):
s: if the test fails, we skip it
f: even if the test fails, the script will not exit with an error code.
e: the pattern must be searched exactly, regexp-specific characters will
automatically be escaped if they're not already escaped.
The script must contain a !LAUNCH: line stating what command line to be
launched (the working directory is the directory where the input file is). A
line starting with !LOG: is the filename used for redirecting STDOUT from the
command line. By default it is the input should_get filename where the extension
is replaced by .log. If !OUTPUT_FILE: is provided then the program is assumed to
produce a file whose filename is given after !OUTPUT_FILE:. This file will be
parsed by the script. The !LOG: file won't be used. By default, output files
are produced in the working directory, to change this behavior, specify an
option after the option !OUTPUT_DIR:
By default spaces can be replaced by any whitespaces. You can override this by
specifying !IGNORE_WHITESPACES: 0
* Exit code
The exit code of the launched command line is also checked. By default, an
exit code of 0 is expected. The .should_get file can specify an option
!EXIT_CODE: indacting another expected value.
* Requirements
Sometimes, to launch a test some requirements must be met. If the requirements
are not met we may want to skip the test. To do so, specify in the file
an option !REQUIRES: which will be followed by a command that is supposed
to exit with the error code 0. If the error code is different from 0 all the
tests in the file will be skipped.
* Environment
** Debug
If the environment variable DEBUG is defined, then some debug information
is output.
** Launcher
If one wants to use a launcher that will execute the program, then
environment variable LAUNCHER must be defined, with the program name to
use as a launcher (eg. valgrind).
A .should_get file may specify an option !NO_LAUNCHER: to tell that this
must not be launched using a launcher. Also, in the !LAUNCH option,
$LAUNCHER may be specified if the launcher must not be put at the start
of the command line, but somewhere else.
* Output
The output is in TAP format and consists of a file whose name is the same
as the input file, where .should_get is replaced by .tap
" >&2
exit 1
fi
debug() {
if [ ! -z "$DEBUG" ]; then
echo $* >&2
fi
}
file=$1
DIR=$(dirname $file)
BASE=$(basename $file)
cd "$DIR"
EXEC=vidjil-algo
VIDJIL_DIR=../../../
VIDJIL_DEFAULT_OPTIONS=""
VIDJIL_DATA=../data/
OUTPUT_DIR=.
TAP_FILE=${BASE%.*}.tap
LOG_FILE=${BASE%.*}.log