<div dir="ltr">By this compile option, we can just compile the tests to be run later.<div>Thus, we don't need to consider whether the other tests can be compiled or not.</div><div><br></div><div>Thanks!</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Aug 13, 2013 at 1:25 AM, Andrew Vagin <span dir="ltr"><<a href="mailto:avagin@parallels.com" target="_blank">avagin@parallels.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Mon, Aug 12, 2013 at 04:48:44PM -0700, Yicheng Qin wrote:<br>
> Add -g option in zdtm.sh.<br>
><br>
> Using -g option can just generate binaries of all<br>
> tests to run in zdtm. Moreover, appending test name after<br>
> -g option can just generate the binary for the test.<br>
><br>
<br>
</div>Acked-by: Andrew Vagin <<a href="mailto:avagin@parallels.com">avagin@parallels.com</a>><br>
<br>
I don't know, why do you need this;). I usually use make -C zdtm -j 32<br>
This command compiles all tests in 32 threads. Anyway the patch is<br>
correct.<br>
<br>
Thanks.<br>
<div class="HOEnZb"><div class="h5"><br>
> Signed-off-by: Yicheng Qin <<a href="mailto:yichengq@google.com">yichengq@google.com</a>><br>
> ---<br>
> Changelog since v2:<br>
> - fix wrong code<br>
><br>
> Changelog since v1:<br>
> - integrate compile logic in run_test()<br>
><br>
> test/zdtm.sh | 35 ++++++++++++++++++++++++++++-------<br>
> 1 file changed, 28 insertions(+), 7 deletions(-)<br>
><br>
> diff --git a/test/zdtm.sh b/test/zdtm.sh<br>
> index f640cd7..1f18765 100755<br>
> --- a/test/zdtm.sh<br>
> +++ b/test/zdtm.sh<br>
> @@ -156,11 +156,6 @@ TMP_TREE=""<br>
> SCRIPTDIR=`dirname $CRIU`/test<br>
> POSTDUMP="--action-script $SCRIPTDIR/post-dump.sh"<br>
><br>
> -test -x $CRIU || {<br>
> - echo "$CRIU is unavailable"<br>
> - exit 1<br>
> -}<br>
> -<br>
> ARGS=""<br>
><br>
> PID=""<br>
> @@ -172,6 +167,15 @@ CLEANUP=0<br>
> PAGE_SERVER=0<br>
> PS_PORT=12345<br>
> TCPDUMP_PID=<br>
> +COMPILE_ONLY=0<br>
> +<br>
> +check_criu()<br>
> +{<br>
> + if [ ! -x $CRIU ]; then<br>
> + echo "$CRIU is unavailable"<br>
> + return 1<br>
> + fi<br>
> +}<br>
><br>
> check_mainstream()<br>
> {<br>
> @@ -343,7 +347,7 @@ run_test()<br>
> linkremap="--link-remap"<br>
> fi<br>
><br>
> - [ -n "$MAINSTREAM_KERNEL" ] && echo $TEST_CR_KERNEL | grep -q ${test#ns/} && {<br>
> + [ -n "$MAINSTREAM_KERNEL" ] && [ $COMPILE_ONLY -eq 0 ] && echo $TEST_CR_KERNEL | grep -q ${test#ns/} && {<br>
> echo "Skip $test"<br>
> return 0<br>
> }<br>
> @@ -357,6 +361,11 @@ run_test()<br>
> local tdir=`dirname $test`<br>
> DUMP_PATH=""<br>
><br>
> + if [ $COMPILE_ONLY -eq 1 ]; then<br>
> + echo "Compile $test"<br>
> + make -C $tdir $tname && return 0 || return 1<br>
> + fi<br>
> +<br>
> echo "Execute $test"<br>
><br>
> start_test $tdir $tname || return 1<br>
> @@ -600,12 +609,23 @@ while :; do<br>
> shift<br>
> continue<br>
> fi<br>
> + if [ "$1" = "-g" ]; then<br>
> + COMPILE_ONLY=1<br>
> + shift<br>
> + continue<br>
> + fi<br>
> break;<br>
> done<br>
><br>
> +if [ $COMPILE_ONLY -eq 0 ]; then<br>
> + check_criu || exit 1<br>
> +fi<br>
> +<br>
> if [ $# -eq 0 ]; then<br>
><br>
> - check_mainstream || exit 1<br>
> + if [ $COMPILE_ONLY -eq 0 ]; then<br>
> + check_mainstream || exit 1<br>
> + fi<br>
><br>
> for t in $TEST_LIST; do<br>
> run_test $t || case_error $t<br>
> @@ -637,6 +657,7 @@ Options:<br>
> -x <PATTERN>: Exclude pattern<br>
> -t : mount tmpfs for dump files<br>
> -a <FILE>.tar.gz : save archive with dump files and logs<br>
> + -g : Generate executables only<br>
> EOF<br>
> elif [ "${1:0:1}" = '-' ]; then<br>
> echo "unrecognized option $1"<br>
> --<br>
> 1.8.3<br>
><br>
</div></div></blockquote></div><br></div>