On 03/06/2013 02:29 AM, djien wrote: > > I generate test.at to a testsuite script using autom4te (v.2.68) and execute > this test. It fails with a return code 13. > Please inform me whether there is a list of return-codes which explains this > error code. > > Test is simple: it compares output Hello, world > > Thank you for your effort > > > t.at > #AT_PACKAGE_STRING > #AT_PACKAGE_BUGREPORT > m4_define([AT_PACKAGE_STRING], [hello]) > m4_define([AT_PACKAGE_BUGREPORT], [gnuprog2-devel@xxxxxxxxxxxxxxx]) > AT_INIT([hello]) > AT_SETUP([hello]) > AT_TESTED(hello) > AT_CHECK([hello],['Hello, world']) This is a usage error. This line says to execute 'hello', and expect $? (which will always be numeric) to contain the string 'Hello, world'. Perhaps we can enhance the AT_CHECK macro to sanity check the second argument (omitted, literal 'ignore', a numeric value, or a shell substitution); but remember that it is impossible to sanity check that all shell substitutions would eventually resolve into a numeric value. > @@ -0,0 +1 @@ > +Hello, world > /testsuite.at:8: exit code was 13, expected Hello, world > 1. testsuite.at:6: 1. hello (testsuite.at:6): FAILED (testsuite.at:8) Meanwhile, this says that when the testsuite executed 'hello', the exit status was 13. But autotest did not write the 'hello' program, so that's something your package presumably provided. The testsuite itself exited with status 1 (a test failed), not status 13. I have no idea what hello's status 13 means. I suspect you meant to test that 'hello' prints 'Hello, world\n' to stdout, and exits with status 0; if so, write: AT_CHECK([hello], [], [[Hello, world ]]) Or, if it is normal for 'hello' to have non-zero status, change the second argument to [13] to match an exact status, or to [ignore] to pass the test in spite of the exit status. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Attachment:
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Autoconf mailing list Autoconf@xxxxxxx https://lists.gnu.org/mailman/listinfo/autoconf