]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Fix AT_CHECK_EUNIT for versions of Erlang/OTP without init:stop/1.
authorRomain Lenglet <romain.lenglet@laposte.net>
Sat, 22 Aug 2009 08:48:38 +0000 (10:48 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 22 Aug 2009 08:49:19 +0000 (10:49 +0200)
* lib/autotest/specific.m4 (AT_CHECK_EUNIT): Support older
versions of Erlang/OTP with an erlang:stop() function that doesn't
take arguments.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
lib/autotest/specific.m4

index 9a112dd80a228aec5e50faebd60f5f559a5bde6d..b4683233a04010a563693bca0f5d235b692082d0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-08-22  Romain Lenglet  <romain.lenglet@laposte.net>
+
+       Fix AT_CHECK_EUNIT for versions of Erlang/OTP without init:stop/1.
+       * lib/autotest/specific.m4 (AT_CHECK_EUNIT): Support older
+       versions of Erlang/OTP with an erlang:stop() function that doesn't
+       take arguments.
+
 2009-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        Drop unneeded line in Eunit test.
index df32cfe32367833529aee629fa70cd57d0fcdfec..e1a21c857c864bc506215e17ee37c2ca903c679f 100644 (file)
@@ -74,12 +74,13 @@ test(Options) ->
   TestSpec = $2,
   ReturnValue = case code:load_file(eunit) of
     {module, _} -> case eunit:test(TestSpec, Options) of
-        ok -> 0; %% test passes
-        _  -> 1  %% test fails
+        ok -> "0\n"; %% test passes
+        _  -> "1\n"  %% test fails
       end;
-    _ -> 77 %% EUnit not found, test skipped
+    _ -> "77\n" %% EUnit not found, test skipped
   end,
-  init:stop(ReturnValue).
+  file:write_file("$1.result", ReturnValue),
+  init:stop().
 ]])
 AT_CHECK(["$ERLC" $ERLCFLAGS -b beam $1.erl])
 ## Make EUnit verbose when testsuite is verbose:
@@ -90,4 +91,6 @@ else
 fi
 AT_CHECK(["$ERL" $3 -s $1 test $at_eunit_options -noshell], [0], [ignore], [],
          [$4], [$5])
+AT_CAPTURE_FILE([$1.result])
+AT_CHECK([test -f "$1.result" && (exit `cat "$1.result"`)])
 ])