tests: support specifying config files for tests

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-09-23 21:11:16 +01:00
parent bfb6cad648
commit 33aa805048
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
3 changed files with 6 additions and 4 deletions

0
tests/configs/empty.conf Normal file
View File

View File

@ -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

View File

@ -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