summaryrefslogtreecommitdiff
path: root/run
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-05-16 14:59:50 +0200
committerCarl Hetherington <cth@carlh.net>2024-05-16 14:59:50 +0200
commiteb6f689b8e9d982d73612af2ba5ddc7ab021aec8 (patch)
treeac58fbabe3e13fa656d19543320b4a42206073dd /run
parent8aa25e2ec75dada5f07a3860d668241821056f61 (diff)
parent7a9cadc6fe86c74035dd971685b1acdc8f32d3fc (diff)
Merge branch 'main' into v2.17.x
Diffstat (limited to 'run')
-rw-r--r--run/environment2
-rwxr-xr-xrun/tests73
2 files changed, 54 insertions, 21 deletions
diff --git a/run/environment b/run/environment
index ddb642eed..822e0603a 100644
--- a/run/environment
+++ b/run/environment
@@ -5,6 +5,6 @@ export LD_LIBRARY_PATH=$build/src/lib:$build/src/wx:$env/lib:/usr/local/lib64:/u
if [[ $(readlink -f $DIR/..) =~ (.*build/[^/]*) ]]; then
export LD_LIBRARY_PATH=${BASH_REMATCH[1]}/lib:$LD_LIBRARY_PATH
fi
-export DYLD_LIBRARY_PATH=$build/src/lib:$build/src/wx:/Users/ci/osx-environment/x86_64/10.10/lib:/Users/ci/workspace/lib
+export DYLD_LIBRARY_PATH=$build/src/lib:$build/src/wx:/Users/ci/workspace/lib
export DCPOMATIC_GRAPHICS=$DIR/../graphics
diff --git a/run/tests b/run/tests
index f0a764e4a..eb8b8f122 100755
--- a/run/tests
+++ b/run/tests
@@ -8,12 +8,52 @@ PRIVATE_GIT="881c48805e352dfe150993814757ca974282be18"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source $DIR/environment
-if [ "$1" == "--check" ]; then
- shift 1
- check=1
-else
- check=0
-fi
+type=""
+check=0
+while [[ $# -gt 0 ]]; do
+ case $1 in
+ -e)
+ environment=$2
+ shift
+ shift
+ ;;
+ --debug)
+ type="debug"
+ shift
+ ;;
+ --backtrace)
+ type="backtrace"
+ shift
+ ;;
+ --valgrind)
+ type="valgrind"
+ shift
+ ;;
+ --callgrind)
+ type="callgrind"
+ shift
+ ;;
+ --quiet)
+ type="quiet"
+ shift
+ ;;
+ --drd)
+ type="drd"
+ shift
+ ;;
+ --helgrind)
+ type="helgrind"
+ shift
+ ;;
+ --check)
+ check=1
+ shift
+ ;;
+ *)
+ break
+ ;;
+ esac
+done
if [ "$(uname)" == "Linux" ]; then
rm -f build/test/dcpomatic2_openssl
@@ -62,27 +102,20 @@ if [ "$check" == "1" ]; then
popd
fi
-if [ "$1" == "--debug" ]; then
- shift;
+if [ "$type" == "debug" ]; then
gdb --args build/test/unit-tests --catch_system_errors=no --log_level=test_suite $*
-elif [ "$1" == "--backtrace" ]; then
- shift;
+elif [ "$type" == "backtrace" ]; then
gdb -batch -ex "run" -ex "thread apply all bt" -return-child-result --args build/test/unit-tests --catch_system_errors=yes $*
-elif [ "$1" == "--valgrind" ]; then
- shift;
+elif [ "$type" == "valgrind" ]; then
# valgrind --tool="memcheck" --vgdb=yes --vgdb-error=0 build/test/unit-tests $*
valgrind --tool="memcheck" --suppressions=suppressions build/test/unit-tests $*
-elif [ "$1" == "--callgrind" ]; then
- shift;
+elif [ "$type" == "callgrind" ]; then
valgrind --tool="callgrind" build/test/unit-tests $*
-elif [ "$1" == "--quiet" ]; then
- shift;
+elif [ "$type" == "quiet" ]; then
build/test/unit-tests --catch_system_errors=no $*
-elif [ "$1" == "--drd" ]; then
- shift;
+elif [ "$type" == "drd" ]; then
valgrind --tool="drd" build/test/unit-tests $*
-elif [ "$1" == "--helgrind" ]; then
- shift;
+elif [ "$type" == "helgrind" ]; then
valgrind --tool="helgrind" build/test/unit-tests $*
else
ulimit -c unlimited