Re: [PATCH 3/3] Enable parallel tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johannes Schindelin schrieb:
> On multiprocessor machines, or with I/O heavy tests (that leave the
> CPU waiting a lot), it makes sense to parallelize the tests.
> 
> However, care has to be taken that the different jobs use different
> trash directories.

Good idea!

> This commit does so, by inspecting the MAKEFLAGS variable to detect
> if the option "-j" or "--jobs" was passed to make.  In that case, the
> test is run with the new "--parallel" option.

How about making the test harness be able to run multiple tests in
parallel by default, i.e. always use a different trash directory name
for each test, without adding the new option?  The implementation would
be a bit simpler (no -j detection needed) and the documentation would be
simpler, too.  We could say "look in 'trash directory/tNNNN'" instead of
"look in this place unless you used -j".

> diff --git a/t/test-lib.sh b/t/test-lib.sh
> index 11c0275..c5868c4 100644
> --- a/t/test-lib.sh
> +++ b/t/test-lib.sh
> @@ -74,6 +74,7 @@ esac
>  	) &&
>  	color=t
>  
> +test="trash directory"
>  while test "$#" -ne 0
>  do
>  	case "$1" in
> @@ -94,6 +95,10 @@ do
>  	--no-python)
>  		# noop now...
>  		shift ;;
> +	--parallel)
> +		test="$test.$(basename "$0" .sh)"
> +		remove_trash="$(pwd)/$test"
> +		shift ;;

test="trash directory/$this_test"?

The advantage would be that all trash was still inside "trash
directory".  Not sure if the extra directory level would break
something.  (Note: $this_test is defined a bit later in the script.)

test="trash for $this_test"?

This one still has a space in it..

>  	*)
>  		break ;;
>  	esac
> @@ -449,6 +454,11 @@ test_done () {
>  		# we will leave things as they are.
>  
>  		say_color pass "passed all $msg"
> +
> +		test ! -z = "$remove_trash" &&

This test succeeds always, because = is not an empty string.

René
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux