autoconf
[Top][All Lists]
Advanced

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

Re: meaning autotest exit code 13


From: Eric Blake
Subject: Re: meaning autotest exit code 13
Date: Thu, 07 Mar 2013 06:13:17 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130219 Thunderbird/17.0.3

On 03/07/2013 06:04 AM, djien wrote:
> Thank you Eric for the explanation. Let me explain what i have done:
> 
> step 1:  the hello.c code
> include <stdio.h>
> 
> main( int argc, char *argv[] )
> {
>     printf( "Hello, world\n" );
> }

Where's your return statement?  You forgot one, so your C compiler
assumed that you wanted the return value of printf() to become your
return value of your program.  You printed 13 bytes, so printf()
returned 13, hence, your 'hello' exits with status 13, with your choice
of compilers (not all compilers would do the same, though, because your
program uses unspecified behavior).  Fix your C program to avoid
unspecified behavior if you want a reliable exit status from 'hello'.


> /t17.at:11: hello
> ++ hello
> /t17.at:11: exit code was 13, expected 0
> 1. t17.at:9: 1. hello (t17.at:9): FAILED (t17.at:11)

Your testsuite is telling you that 'hello' failed to meet the
expectations you had in the testsuite of it exiting with status 0.

> 
> step 9: modift t17.at
> AT_CHECK([hello],[],[["Hello, world
> "]])

This modification says that you want your 'hello' program to output
double quotes as part of its literal output - but that's not what your C
program did.

> @@ -1,2 +1,2 @@
> -"Hello, world
> -"
> +Hello, world
> +

So now the testsuite is telling you that your 'hello' program produced
different output than your expectation,

> /t18.at:11: exit code was 13, expected 0
> 1. t18.at:9:  FAILED (t18.at:11)

in addition to still having the wrong exit status for your expectation.

> 
> Please inform me where the error is.

In your .c file, or in your testsuite expectations.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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