Commit 8891bb75 authored by Yicheng Qin's avatar Yicheng Qin Committed by Pavel Emelyanov

test/zdtm: add -g option to generate binary only

Add -g option in zdtm.sh.

Using -g option can just generate binaries of all
tests to run in zdtm. Moreover, appending test name after
-g option can just generate the binary for the test.
Signed-off-by: 's avatarYicheng Qin <yichengq@google.com>
Acked-by: 's avatarAndrew Vagin <avagin@parallels.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 62ca87d5
...@@ -156,11 +156,6 @@ TMP_TREE="" ...@@ -156,11 +156,6 @@ TMP_TREE=""
SCRIPTDIR=`dirname $CRIU`/test SCRIPTDIR=`dirname $CRIU`/test
POSTDUMP="--action-script $SCRIPTDIR/post-dump.sh" POSTDUMP="--action-script $SCRIPTDIR/post-dump.sh"
test -x $CRIU || {
echo "$CRIU is unavailable"
exit 1
}
ARGS="" ARGS=""
PID="" PID=""
...@@ -172,6 +167,15 @@ CLEANUP=0 ...@@ -172,6 +167,15 @@ CLEANUP=0
PAGE_SERVER=0 PAGE_SERVER=0
PS_PORT=12345 PS_PORT=12345
TCPDUMP_PID= TCPDUMP_PID=
COMPILE_ONLY=0
check_criu()
{
if [ ! -x $CRIU ]; then
echo "$CRIU is unavailable"
return 1
fi
}
check_mainstream() check_mainstream()
{ {
...@@ -343,7 +347,7 @@ run_test() ...@@ -343,7 +347,7 @@ run_test()
linkremap="--link-remap" linkremap="--link-remap"
fi fi
[ -n "$MAINSTREAM_KERNEL" ] && echo $TEST_CR_KERNEL | grep -q ${test#ns/} && { [ -n "$MAINSTREAM_KERNEL" ] && [ $COMPILE_ONLY -eq 0 ] && echo $TEST_CR_KERNEL | grep -q ${test#ns/} && {
echo "Skip $test" echo "Skip $test"
return 0 return 0
} }
...@@ -357,6 +361,11 @@ run_test() ...@@ -357,6 +361,11 @@ run_test()
local tdir=`dirname $test` local tdir=`dirname $test`
DUMP_PATH="" DUMP_PATH=""
if [ $COMPILE_ONLY -eq 1 ]; then
echo "Compile $test"
make -C $tdir $tname && return 0 || return 1
fi
echo "Execute $test" echo "Execute $test"
start_test $tdir $tname || return 1 start_test $tdir $tname || return 1
...@@ -600,12 +609,23 @@ while :; do ...@@ -600,12 +609,23 @@ while :; do
shift shift
continue continue
fi fi
if [ "$1" = "-g" ]; then
COMPILE_ONLY=1
shift
continue
fi
break; break;
done done
if [ $COMPILE_ONLY -eq 0 ]; then
check_criu || exit 1
fi
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
if [ $COMPILE_ONLY -eq 0 ]; then
check_mainstream || exit 1 check_mainstream || exit 1
fi
for t in $TEST_LIST; do for t in $TEST_LIST; do
run_test $t || case_error $t run_test $t || case_error $t
...@@ -637,6 +657,7 @@ Options: ...@@ -637,6 +657,7 @@ Options:
-x <PATTERN>: Exclude pattern -x <PATTERN>: Exclude pattern
-t : mount tmpfs for dump files -t : mount tmpfs for dump files
-a <FILE>.tar.gz : save archive with dump files and logs -a <FILE>.tar.gz : save archive with dump files and logs
-g : Generate executables only
EOF EOF
elif [ "${1:0:1}" = '-' ]; then elif [ "${1:0:1}" = '-' ]; then
echo "unrecognized option $1" echo "unrecognized option $1"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment