ATF-devel archive

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

Re: Try to build atf 0.4 under ALT Linux



On Wed, Mar 19, 2008 at 9:10 AM, Slava Semushin 
<php-coder%altlinux.org@localhost> wrote:
> Hello!

Hello Salva,

>  When I try to build ATF 0.4 under my ALT Linux and building fails:
>
>  tests/atf/test_programs/h_cpp.cpp: In member function 'virtual void
>  atf_tc_env_list::body() const':
>  tests/atf/test_programs/h_cpp.cpp:254: warning: ignoring return value
>  of 'int system(const char*)', declared with attribute
>  warn_unused_result
>  [...]
>  tools/atf-run.cpp: In function 'void call_hook(const std::string&,
>  const std::string&)':
>  tools/atf-run.cpp:573: warning: ignoring return value of 'int
>  system(const char*)', declared with attribute warn_unused_result

Do you have any idea about why you are getting this warning?  I have
never seen it here in any of the platforms I test the code under.
Which version of GCC are you using, and under which platform?

>  So I think we should:
>  - check exit code returned by system()

The attached patch should fix this for you.  I'll commit it to the
tree later today when I get back home.

>  - add --disable-werror flag to configure (now I just add sed -i
>  '/-Werror/d' m4/developer-mode.m4 but it's looks like a hack)

No, sorry.  Developer mode is meant to catch all these problems, and
thus this is why it enables all kinds of warnings and enforces
-Werror.  You can always pass --disable-developer to the configure
script, but I wouldn't do this because you will not get run-time
assertion checks (which are very useful at this point of development).

>  After compiling `make check` also fails:
>
>  + make -j1 --silent --no-print-directory check
[...]
>  ## ------------------------------------------------------------ ##
>  ## Automated Testing Framework 0.4 test suite: bootstrap tests. ##
>  ## ------------------------------------------------------------ ##
>  testsuite: error: cannot find atf-config
>  FAIL: ./tests/bootstrap/testsuite
>  =====================================
>  1 of 1 tests failed
>  Please report to atf-devel%NetBSD.org@localhost
>  =====================================
>  make[2]: *** [check-TESTS] Error 1
>  make[1]: *** [check-am] Error 2
>  make: *** [check] Error 2
>
>  Hm... I will try to not do `make check`...

This is the normal behavior of autotest.  You need to have the
installation directory in the path for it to find the binaries; this
way you can run the same test suite against different installations.
Or alternatively add the $(srcdir)/tools directory to the path, if you
want to run 'make check' prior installation; it should work.

Also note that with some libtool versions do some stupid mangling of
temporary files used in the source tree, so 'make check' will spit
some false positives.  If that is the case, try to reconfigure and
rebuild with --disable-fast-install and run 'make check' again.

At last, don't forget to run 'make installcheck' later!  This is the
real test suite.

>  Also one bug: I always use make --silent but I see all commands for
>  compilatioa as is. It shouldn't be shown.

Does 'make --silent' work with any package that uses Automake and
Libtool?  I've tried that here and I see all kinds of commands
generated by these tools, so most likely this is not ATF's fault.

Thanks for the bug report!

-- 
Julio M. Merino Vidal <jmmv84%gmail.com@localhost>
#
# old_revision [4eb0a4c867f5dca54cc649efb8774ab6828a90ea]
#
# patch "tests/atf/test_programs/h_cpp.cpp"
#  from [35af6e21cdd024ed8d1cc259e7ca32781e794dd3]
#    to [0f43431d0fc04c2f7e6a12bcc94e6cf732e82f48]
#
============================================================
--- tests/atf/test_programs/h_cpp.cpp   35af6e21cdd024ed8d1cc259e7ca32781e794dd3
+++ tests/atf/test_programs/h_cpp.cpp   0f43431d0fc04c2f7e6a12bcc94e6cf732e82f48
@@ -251,7 +251,9 @@ ATF_TEST_CASE_BODY(env_list)
 }
 ATF_TEST_CASE_BODY(env_list)
 {
-    std::system("env");
+    int exitcode = std::system("env");
+    ATF_CHECK(WIFEXITED(exitcode));
+    ATF_CHECK(WEXITSTATUS(exitcode) == EXIT_SUCCESS);
 }
 
 // ------------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index