summaryrefslogtreecommitdiff
path: root/shell/test
diff options
context:
space:
mode:
Diffstat (limited to 'shell/test')
-rw-r--r--shell/test/EXPRESSIONS40
-rw-r--r--shell/test/RULES6
-rwxr-xr-xshell/test/test_runner.sh1
3 files changed, 45 insertions, 2 deletions
diff --git a/shell/test/EXPRESSIONS b/shell/test/EXPRESSIONS
index d9b1fbc..ea36b32 100644
--- a/shell/test/EXPRESSIONS
+++ b/shell/test/EXPRESSIONS
@@ -12,6 +12,7 @@
, "imports":
{ "artifacts_list": ["./", "../..", "field_artifacts_list"]
, "runfiles_list": ["./", "../..", "field_runfiles_list"]
+ , "map_provider": ["./", "../..", "field_map_provider"]
}
, "expression":
{ "type": "let*"
@@ -66,6 +67,19 @@
}
}
]
+ , [ "run-libs"
+ , { "type": "TREE"
+ , "$1":
+ { "type": "let*"
+ , "bindings":
+ [ ["fieldname", {"type": "var", "name": "deps-fieldname"}]
+ , ["provider", "run-libs"]
+ , ["transition", {"type": "var", "name": "deps-transition"}]
+ ]
+ , "body": {"type": "CALL_EXPRESSION", "name": "map_provider"}
+ }
+ }
+ ]
, [ "attempt marker"
, { "type": "if"
, "cond":
@@ -104,6 +118,10 @@
, "key": "work"
, "value": {"type": "var", "name": "deps"}
}
+ , { "type": "singleton_map"
+ , "key": "libs"
+ , "value": {"type": "var", "name": "run-libs"}
+ }
, {"type": "var", "name": "runner"}
, {"type": "var", "name": "test.sh"}
, {"type": "var", "name": "attempt marker"}
@@ -114,7 +132,27 @@
, {"type": "++", "$1": [["./runner"], {"type": "var", "name": "keep"}]}
]
, [ "test_env"
- , {"type": "var", "name": "TEST_ENV", "default": {"type": "empty_map"}}
+ , { "type": "map_union"
+ , "$1":
+ [ { "type": "if"
+ , "cond":
+ { "type": "=="
+ , "$1": {"type": "var", "name": "ATTEMPT"}
+ , "$2": null
+ }
+ , "then": {"type": "empty_map"}
+ , "else":
+ { "type": "singelton_map"
+ , "key": "TEST_RUN_NUMBER"
+ , "value": {"type": "var", "name": "ATTEMPT"}
+ }
+ }
+ , { "type": "var"
+ , "name": "TEST_ENV"
+ , "default": {"type": "empty_map"}
+ }
+ ]
+ }
]
]
, "body":
diff --git a/shell/test/RULES b/shell/test/RULES
index 98bf27c..19f859f 100644
--- a/shell/test/RULES
+++ b/shell/test/RULES
@@ -12,6 +12,10 @@
, "TEST_TMPDIR. The test should not assume write permissions"
, "outside the working directory and the TEST_TMPDIR."
, "For convenience, the environment variable TMPDIR is also set to TEST_TMPDIR."
+ , ""
+ , "If the configuration variable RUNS_PER_TEST is set, the environment"
+ , "variable TEST_RUN_NUMBER will also be set to the number of the attempt,"
+ , "counting from 0."
]
, "name":
[ "A name for the test, used in reporting, as well as for staging"
@@ -32,7 +36,7 @@
[ "The number of times the test should be run in order to detect flakyness."
, "If set, no test action will be taken from cache."
]
- , "TEST_ENV": ["The environment for executing the test runner."]
+ , "TEST_ENV": ["Additional environment for executing the test runner."]
}
, "tainted": ["test"]
, "artifacts_doc":
diff --git a/shell/test/test_runner.sh b/shell/test/test_runner.sh
index a99d5b7..97c75ef 100755
--- a/shell/test/test_runner.sh
+++ b/shell/test/test_runner.sh
@@ -25,6 +25,7 @@ echo UNKNOWN > time-stop
mkdir scratch
export TEST_TMPDIR=$(realpath scratch)
export TMPDIR="${TEST_TMPDIR}"
+export LD_LIBRARY_PATH=$(realpath ./libs):$LD_LIBRARY_PATH
# Change to the working directory; note: while unlikely, the test
# might not have test data, so we have to ensure the presence of