Commit 9864d82b authored by Mathieu Giraud's avatar Mathieu Giraud

bug: !NO_LAUNCHER and !REQUIRES are not fully taken into account

parent 1f3f8d25
Pipeline #2724 canceled with stages
......@@ -11,13 +11,13 @@ $ The command is not run, several tests do fail
: failed
(cat demo/cal.should ; echo "!NO_LAUNCHER:" ; cat demo/hello.should) > demo/tests/no-launcher.should
(cat demo/tests/foo.should ; echo "!NO_LAUNCHER:" ; cat demo/tests/bar.should) > demo/tests/no-launcher.should
./should --launcher echo -v demo/tests/no-launcher.should ; true
$ The first part is launched with 'echo'
: LC_ALL=C cal 2001
0: October
: failed
$ The first tests, in foo.should, is launched with 'echo'
b: echo echo foo
: 1: foo
$ The second one runs are skipped
$ The second tests, in bar.should, are skipped
: Skipping tests: !NO_LAUNCHER:
0: bar
\ No newline at end of file
!OPTIONS: --var MIN_VERSION=(3,5)
# A !REQUIRES directive is executed before any test.
# The .should file is taken into account only if the !REQUIRES command exits with 0.
!REQUIRES: python3 -c "import sys; sys.exit(0 if sys.version_info >= $MIN_VERSION else 1)"
# Note that !REQUIRES directives may also use variables, defined above
(cat demo/tests/foo.should ; echo "!REQUIRES: exit 1" ; cat demo/tests/bar.should) > demo/tests/no-launcher.should
./should --launcher echo -v demo/tests/no-launcher.should ; true
$ The first tests, in foo.should, is launched with 'echo'
b: echo echo foo
: 1: foo
$ The second tests, in bar.should, are skipped
: Skipping tests: Condition is not met
0: bar
# !REQUIRES directives may also use variables
!OPTIONS: --var MIN_VERSION=(3,5)
!REQUIRES: python3 -c "import sys; sys.exit(0 if sys.version_info >= $MIN_VERSION else 1)"
# We test here a function that was introduced in Python 3.5.
python3 -c "import math; print(math.isclose(math.pi, 3.14, rel_tol=0.01))"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment