From 1c32d15e2518cc9174337b3913f1704391554296 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Fri, 7 Jan 2022 09:54:45 +0800 Subject: [PATCH] Make test script more robust --- test.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test.sh b/test.sh index a458cdc..80651bc 100755 --- a/test.sh +++ b/test.sh @@ -2,6 +2,11 @@ set -e +if [ -f "$HOME/.config/xcowsayrc" ]; then + mv $HOME/.config/xcowsayrc /tmp + trap "mv /tmp/xcowsayrc $HOME/.config/" EXIT +fi + echo Normal mode $BUILD_DIR/src/xcowsay Hello World @@ -22,8 +27,9 @@ $BUILD_DIR/src/xcowsay "你好 world" echo Daemon mode $BUILD_DIR/src/xcowsay --daemon --debug & +code=$? pid=$! -echo "PID is $pid" +echo "PID is $pid; code is $?" sleep 0.5 $BUILD_DIR/src/xcowsay Hello World -t 100 -- 2.39.2