[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:
/micro-suite.at:11: test group name
in './micro-suite -v' output, for all the inner testsuites used in
autotest.at. 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?
Thanks,
Ralf
Ensure autotest tests have an atconfig file, for testsuite -v.
* tests/autotest.at (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
expansion.
diff --git a/tests/autotest.at b/tests/autotest.at
index c13f1c7..a09e2c1 100644
--- a/tests/autotest.at
+++ b/tests/autotest.at
@@ -53,6 +53,16 @@ m4_define([AT_PACKAGE_BUGREPORT], address@hidden)
]])
dnl
AT_DATA_AUTOTEST(AT_dir[/$1.at], [$2])
+AT_CHECK([cat >m4_default([$6], [.])/atconfig <<EOF
+at_testdir=m4_default([$6], [.])
+abs_builddir='`pwd`'
+at_srcdir=.
+abs_srcdir='`pwd`'
+at_top_srcdir=.
+abs_top_srcdir='`pwd`'
+at_top_build_prefix=
+abs_top_builddir='`pwd`'
+EOF])
m4_ifval([$6], [(cd AT_dir])
AT_CHECK_AUTOM4TE([--language=autotest -o $1 $1.at], [$3], [$4], [$5])
m4_ifval([$6], [)])
@@ -698,8 +708,11 @@ s/^.\{]]]m4_default($5, 53)[[[\}ok.*/ok/p
[[$3
ok
]])
+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']],,
[[$3
]])
AT_CHECK([[$CONFIG_SHELL ./micro-suite -l |
@@ -1371,11 +1384,15 @@ AT_CHECK([test -f "$top_srcdir"/a && test -f
"$srcdir"/b])
AT_CLEANUP
]], [], [], [], [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/suite.at' 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/suite.at' 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/suite.at' 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/suite.at' stdout], [0], [ignore])
cd ..
# Build directory as source directory.
@@ -1404,6 +1427,8 @@ cd pkg
AT_CHECK_CONFIGURE
cd t
AT_CHECK([./suite], [0], [ignore])
+AT_CHECK([./suite -v], [0], [stdout])
+AT_CHECK([grep '^\./suite.at' stdout], [0], [ignore])
cd ../..
AT_CLEANUP
- Ensure autotest tests have an atconfig file, for testsuite -v.,
Ralf Wildenhues <=