* Stefano Lattarini wrote on Thu, Jun 30, 2011 at 04:40:51PM CEST:
> I'd like to add this new test case to master.  OK?

Sure, note typo below.

This could actually find bugs in older makes, but hey, we'd want to know
about them.

Thanks,
Ralf

> Subject: [PATCH] coverage: new test on parallel-tests TESTS runtime overriding
> 
> * tests/parallel-tests-cmdline-override.test: New test, check that
> we can use indirections when overriding TESTS and TEST_LOGS from
> the command line.
> * tests/Makefile.am (TESTS): Update.

> --- /dev/null
> +++ b/tests/parallel-tests-cmdline-override.test

> +# Check that we can use indirections when overriding TESTS and
> +# TEST_LOGS from the command line.
> +
> +parallel_tests=yes
> +. ./defs || Exit 1
> +
> +cat >> configure.in << 'END'
> +AC_OUTPUT
> +END
> +
> +cat > Makefile.am << 'END'
> +TEST_EXTENSIONS = .test .t
> +TEST_LOG_COMPILER = cat
> +T_LOG_COMPILER = cat
> +TESTS = bad.test
> +var1 = b.test $(var2)
> +var2 = c.test
> +var3 = d.d
> +var4 = e
> +END
> +
> +$ACLOCAL
> +$AUTOCONF
> +$AUTOMAKE -a
> +
> +./configure
> +rm -f config.log # Not to create false psotives below.

positives
and s/Not to/Do not/  I guess.

> +
> +LC_ALL=C sort > exp-log <<'END'
> +a.log
> +b.log
> +c.log
> +d.log
> +e.log
> +test-suite.log
> +END
> +
> +LC_ALL=C sort > exp-out <<'END'
> +PASS: a.t
> +PASS: b.test
> +PASS: c.test
> +PASS: d.t
> +PASS: e.test
> +END
> +
> +do_check ()
> +{
> +  env "$@" $MAKE -e check >stdout || { cat stdout; Exit 1; }
> +  cat stdout
> +  grep '^PASS:' stdout | LC_ALL=C sort > got-out
> +  cat got-out
> +  ls . | grep '\.log$' | LC_ALL=C sort > got-log
> +  cat got-log
> +  st=0
> +  diff exp-out got-out || st=1
> +  diff exp-log got-log || st=1
> +  return $st
> +}
> +
> +tests='a.t $(var1) $(var3:.d=.t) $(var4:=.test)'
> +test_logs='a.log $(var1:.test=.log) $(var3:.d=.log) $(var4:=.log)'
> +
> +touch a.t b.test c.test d.t e.test
> +
> +do_check TESTS="$tests"
> +do_check TEST_LOGS="$test_logs"

Reply via email to