From 33aa80504843697c1ec893938e6d174a7a39823b Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Mon, 23 Sep 2019 21:11:16 +0100 Subject: [PATCH] tests: support specifying config files for tests Signed-off-by: Yuxuan Shui --- tests/configs/empty.conf | 0 tests/run_one_test.sh | 8 +++++--- tests/run_tests.sh | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 tests/configs/empty.conf diff --git a/tests/configs/empty.conf b/tests/configs/empty.conf new file mode 100644 index 0000000..e69de29 diff --git a/tests/run_one_test.sh b/tests/run_one_test.sh index 978f158..5861462 100755 --- a/tests/run_one_test.sh +++ b/tests/run_one_test.sh @@ -1,16 +1,18 @@ #!/bin/sh +set -x if [ -z $DISPLAY ]; then - exec xvfb-run -s "+extension composite" -a $0 $1 $2 + exec xvfb-run -s "+extension composite" -a $0 $1 $2 $3 fi echo "Running test $2" # TODO keep the log file, and parse it to see if test is successful -($1 --experimental-backends --backend dummy --log-level=debug --log-file=$PWD/log) & +($1 --experimental-backends --backend dummy --log-level=debug --log-file=$PWD/log --config=$2) & compton_pid=$! -$2 +$3 kill -INT $compton_pid +wait $compton_pid cat log rm log diff --git a/tests/run_tests.sh b/tests/run_tests.sh index cc2ab68..8c84b53 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -2,4 +2,4 @@ compton=$(realpath $1) cd $(dirname $0) -./run_one_test.sh $compton testcases/basic.py +./run_one_test.sh $compton configs/empty.conf testcases/basic.py