diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-05-13 20:35:10 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-05-13 20:35:36 +0200 |
| commit | a5d355683e577f018ceba2fbfdfac98bcc88bb48 (patch) | |
| tree | e984e286f058e32d1088b4c781e15d8058516152 | |
| parent | 4d03b76ff759e30ea079944c31a87e2b3e7a21ac (diff) | |
Pass environment prefix to test runner.
| -rw-r--r-- | cscript | 2 | ||||
| -rwxr-xr-x | run/tests | 37 |
2 files changed, 32 insertions, 7 deletions
@@ -81,6 +81,8 @@ def make_doxygen(target): def test(target, options, test): target.set('LC_ALL', 'C') cmd = 'run\\tests ' if target.platform == 'windows' else 'run/tests ' + if target.environment_prefix: + cmd += '-e %s' % target.environment_prefix if test is not None: cmd += '-t %s' % test target.command(cmd) @@ -10,9 +10,35 @@ work=build/test dcpinfo=build/tools/dcpinfo dcpverify=build/tools/dcpverify +type="" +while [[ $# -gt 0 ]]; do + case $1 in + -e) + environment=$2 + shift + shift + ;; + --debug) + type="debug" + shift + ;; + --valgrind) + type="valgrind" + shift + ;; + --callgrind) + type="callgrind" + shift + ;; + *) + break + ;; + esac +done + export LD_LIBRARY_PATH=build/src:/usr/local/lib:/usr/local/lib64:$LD_LIBRARY_PATH # SIP stops this being passed in from the caller's environment -export DYLD_LIBRARY_PATH=/Users/ci/osx-environment/x86_64/10.10/lib:/Users/ci/workspace/lib +export DYLD_LIBRARY_PATH=$environment/x86_64/10.10/lib:/Users/ci/workspace/lib export LIBDCP_RESOURCES=. # Make sure we have the required tools @@ -23,14 +49,11 @@ done echo "--- Unit tests" # Run the unit tests in test/ -if [ "$1" == "--debug" ]; then - shift +if [ "$type" == "debug" ]; then gdb --args $work/tests $private $* -elif [ "$1" == "--valgrind" ]; then - shift +elif [ "$type" == "valgrind" ]; then valgrind --tool="memcheck" $work/tests $private $* -elif [ "$1" == "--callgrind" ]; then - shift +elif [ "$type" == "callgrind" ]; then valgrind --tool="callgrind" $work/tests $private $* else $work/tests $* -- $private |
