On Sunday 02 August 2009 02:44:47 Paolo Bonzini wrote:
> I squashed in the attached patch, and I'm going to push it after you
> confirm that make check still passes with Erlang installed.  distcheck
> is still running.
>
> In particular, I made the testsuite run also if Erlang is not found, to
> check that it skips the test.

The test in autotest.at is much better, thanks!

I tested 2 cases:
- Erlang and EUnit found;
- Erlang detected, EUnit not found.

I changed two things to make them work:
- when the test is successful, suite.log doesn't contain '0.*skipped';
- the test code (testme_tests.erl) requires EUnit as well as Erlang to 
compile, as it uses an include file from EUnit.

> I also removed your attribution in specific.m4 on the grounds that it is
> probably going to grow (I may do JUnit) and that you already have it in
> lib/autoconf/erlang.m4. :-)

OK, no problem. :-)

> >> Can we make this code addition conditional to test suites in which
> >> AT_CHECK_EUNIT is used?  (Diversions ought to help here.)
> >> We don't want unnecessary code expansions.
[...]
> I did that, conditional on the definition of AC_ERLANG_PATH_ERL.

That looks good, but only ERL should be conditional to AC_ERLANG_PATH_ERL, and 
ERLC and ERLCFLAGS should be conditional to AC_ERLANG_PATH_ERLC.

Fixed in the attached patch.

Thanks!
--
Romain Lenglet
From 34e3128e9451253755314a491cfaaa07b3d12966 Mon Sep 17 00:00:00 2001
From: Romain Lenglet <[email protected]>
Date: Sun, 2 Aug 2009 10:41:06 +0900
Subject: [PATCH] Make ERLC and ERLCFLAGS def in atconfig conditional to AC_ERLANG_PATH_ERLC. Fix autotest.at for AT_CHECK_EUNIT test.

---
 lib/autoconf/autotest.m4 |    4 +++-
 tests/autotest.at        |    4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/autoconf/autotest.m4 b/lib/autoconf/autotest.m4
index 29dffac..aec589b 100644
--- a/lib/autoconf/autotest.m4
+++ b/lib/autoconf/autotest.m4
@@ -86,12 +86,14 @@ AUTOTEST_PATH='m4_default([$2], [$1])'
 SHELL=\${CONFIG_SHELL-'$SHELL'}
 m4_provide_if([AC_ERLANG_PATH_ERL], [
 ERL='$ERL'
+])dnl
+m4_provide_if([AC_ERLANG_PATH_ERLC], [
 ERLC='$ERLC'
 ERLCFLAGS='$ERLCFLAGS'
 ])dnl
 ATEOF
 ],
 [m4_provide_if([AC_ERLANG_PATH_ERL], [ERL="$ERL"
-ERLC="$ERLC"
+])m4_provide_if([AC_ERLANG_PATH_ERLC], [ERLC="$ERLC"
 ERLCFLAGS="$ERLCFLAGS"
 ])])])# AC_CONFIG_TESTDIR
diff --git a/tests/autotest.at b/tests/autotest.at
index 03968f7..162bbb7 100644
--- a/tests/autotest.at
+++ b/tests/autotest.at
@@ -1504,7 +1504,7 @@ AT_CHECK([grep '^ERL='\''.*'\' t/atconfig], [], [ignore])
 AT_CHECK([grep '^ERLC='\''.*'\' t/atconfig], [], [ignore])
 AT_CHECK([grep '^ERLCFLAGS='\''.*'\' t/atconfig], [], [ignore])
 
-if test "$HAVE_ERLANG" = yes; then
+if test "$HAVE_ERLANG" = yes && test "$HAVE_EUNIT" = yes; then
   AT_CHECK([cd s && $CONFIG_SHELL ./compile])
 fi
 
@@ -1512,7 +1512,7 @@ AT_CHECK([cd t && $CONFIG_SHELL ./suite], [], [ignore])
 
 if test "$HAVE_EUNIT" = yes; then
   AT_CHECK([grep 1.*successful t/suite.log], [], [ignore])
-  AT_CHECK([grep 0.*skipped t/suite.log], [], [ignore])
+  AT_CHECK([grep -v skipped t/suite.log], [], [ignore])
 else
   AT_CHECK([grep 1.*skipped t/suite.log], [], [ignore])
   AT_CHECK([grep 0.*successful t/suite.log], [], [ignore])
-- 
1.6.3.1

Reply via email to