Hi Ralf, thanks for the lightspeed review. On Thursday 30 June 2011, Ralf Wildenhues wrote: > * 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 > Oops (I've probably disabled my spellchecker by mistake *again*).
> and s/Not to/Do not/ I guess. > Strictly speaking, the "Not to" was meant, standing as an abbreviation for: "(This is needed) not to create ...". Admittedly, not a great example of clarity; thus I've done your suggested change. > > + > > +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 > > + Also, the two uses of sort above are redundant: cat is enough. I've adjusted them. > > +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" > Below is what I've squashed in. Pushed now. Regards, Stefano -*-*-*- diff --git a/tests/parallel-tests-cmdline-override.test b/tests/parallel-tests-cmdline-override.test index cd8f82f..fa47032 100755 --- a/tests/parallel-tests-cmdline-override.test +++ b/tests/parallel-tests-cmdline-override.test @@ -40,9 +40,9 @@ $AUTOCONF $AUTOMAKE -a ./configure -rm -f config.log # Not to create false psotives below. +rm -f config.log # Do not create false positives below. -LC_ALL=C sort > exp-log <<'END' +cat > exp-log <<'END' a.log b.log c.log @@ -51,7 +51,7 @@ e.log test-suite.log END -LC_ALL=C sort > exp-out <<'END' +cat > exp-out <<'END' PASS: a.t PASS: b.test PASS: c.test