[Top][All Lists]

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

Ensure autotest tests have an atconfig file, for testsuite -v.

From: Ralf Wildenhues
Subject: Ensure autotest tests have an atconfig file, for testsuite -v.
Date: Sun, 25 Apr 2010 19:23:29 +0200
User-agent: Mutt/1.5.20 (2009-10-28)

This patch avoids lines like:
  / test group name

in './micro-suite -v' output, for all the inner testsuites used in  This output always bothered me, thinking there might be a
bug in the code (as opposed to a bug in our testsuite).

The AT_CHECK_AT_TITLE offered itself as a cheap place to check that the
AT_CHECK_AT_PREP change is effective (don't want to waste several
processes in hundred tests just for one testsuite issue).  The 'srcdir
propagation' change is to avoid getting contaminated by the
AT_CHECK_AT_TITLE change and amended to test the effectiveness of
atconfig contents.

This patch goes on top of the other just-posted testsuite one.

OK to commit?


    Ensure autotest tests have an atconfig file, for testsuite -v.
    * tests/ (AT_CHECK_AT_PREP): Create a default
    atconfig file in the directory of the testsuite.
    (AT_CHECK_AT_TITLE): Also check that `./micro-suite -v' output
    does not contain empty $at_srcdir expansion.
    (srcdir propagation): Remove the atconfig file generated by
    AT_CHECK_AT_PREP.  Check each suite invocation for $at_srcdir

diff --git a/tests/ b/tests/
index c13f1c7..a09e2c1 100644
--- a/tests/
+++ b/tests/
@@ -53,6 +53,16 @@ m4_define([AT_PACKAGE_BUGREPORT], address@hidden)
 AT_DATA_AUTOTEST(AT_dir[/$], [$2])
+AT_CHECK([cat >m4_default([$6], [.])/atconfig <<EOF
+at_testdir=m4_default([$6], [.])
 m4_ifval([$6], [(cd AT_dir])
 AT_CHECK_AUTOM4TE([--language=autotest -o $1 $], [$3], [$4], [$5])
 m4_ifval([$6], [)])
@@ -698,8 +708,11 @@ s/^.\{]]]m4_default($5, 53)[[[\}ok.*/ok/p
+dnl This sed script checks for two things - that -v output doesn't have
+dnl an empty $at_srcdir expansion, and that the 'testing ...' line
+dnl contains the test group title.
 AT_CHECK([[$CONFIG_SHELL ./micro-suite -v |
-           sed -n 's/.*testing \(.*\) \.\.\./\1/p']],,
+           sed -n 's/.*testing \(.*\) \.\.\./\1/p; /^\/micro-suite\.at:/p']],,
 AT_CHECK([[$CONFIG_SHELL ./micro-suite -l |
@@ -1371,11 +1384,15 @@ AT_CHECK([test -f "$top_srcdir"/a && test -f 
 ]], [], [], [], [pkg/t])
+rm -f pkg/t/atconfig
 # Build directory totally outside source directory.
 cd vpath-outside
 AT_CHECK([../pkg/configure $configure_options], [0], [ignore])
 cd t
 AT_CHECK([../../pkg/t/suite], [0], [ignore])
+AT_CHECK([../../pkg/t/suite -v], [0], [stdout])
+AT_CHECK([grep '^\.\./\.\./pkg/t/' stdout], [0], [ignore])
 cd ../..
 # Build directory totally outside source directory (absolute).
@@ -1384,6 +1401,8 @@ cd vpath-abs
 AT_CHECK(["$my_srcdir"/configure $configure_options], [0], [ignore])
 cd t
 AT_CHECK(["$my_srcdir"/t/suite], [0], [ignore])
+AT_CHECK(["$my_srcdir"/t/suite -v], [0], [stdout])
+AT_CHECK([grep '..*/t/' stdout], [0], [ignore])
 cd ../..
 # Build directory as subdirectory of source directory.
@@ -1391,12 +1410,16 @@ cd pkg/vpath-inside
 AT_CHECK([../configure $configure_options], [0], [ignore])
 cd t
 AT_CHECK([../../t/suite], [0], [ignore])
+AT_CHECK([../../t/suite -v], [0], [stdout])
+AT_CHECK([grep '^\.\./\.\./t/' stdout], [0], [ignore])
 cd ../../..
 # Build directory as parent of source directory.
 AT_CHECK([pkg/configure $configure_options], [0], [ignore])
 cd t
 AT_CHECK([../pkg/t/suite], [0], [ignore])
+AT_CHECK([../pkg/t/suite -v], [0], [stdout])
+AT_CHECK([grep '^\.\./pkg/t/' stdout], [0], [ignore])
 cd ..
 # Build directory as source directory.
@@ -1404,6 +1427,8 @@ cd pkg
 cd t
 AT_CHECK([./suite], [0], [ignore])
+AT_CHECK([./suite -v], [0], [stdout])
+AT_CHECK([grep '^\./' stdout], [0], [ignore])
 cd ../..

reply via email to

[Prev in Thread] Current Thread [Next in Thread]