Is there a way to compile the "check" target of an autoconf project without running it?
I have Eclipse Juno with the "C/C++ Unit Test" plugin. I would like to be able to make the check target, then run it in the context of the plugin so that I can take advantage of its conveniences.
Currently I have set up the project configuration to build "make check" then run the "test" binary that it creates. This has 2 problems.
1) It is redundant and slows the process (the test runs twice)
2) A test failure causes a build failure. Eclipse doesn't know the difference. I have to pay attention to the output, then run in the unit test plugin anyway to get what I want out of it.
If there is no way to just compile the check target, is there some other way of setting up autoconf / automake to allow me to build the test target without creating a special config that builds the test as part of "make all"? Basically, I want to have all 3 options in a single configuration:
make unitTest (for development)
make check (for automated testing)
make all (for release)
EDIT: Just to clarify a bit, I know I can run "make targetName" from the target directory to compile that target (project/src/test> make myUnitTests). I'm looking for a generic way to do it from the project's base directory (project> make check_PROGRAMS).
Automake is the component you'll use to create the Makefile, a template that can then be populated with autoconf . Automake does so using variables and primaries. An example of such a primary is bin_PROGRAMS = helloworld , where the primary is the _PROGRAMS suffix.
Autoconf essentially runs the preprocessor on your script to produce a portable shell script which will perform all the requisite tests, produce handy log files, preprocess template files, for example to generate Makefile from Makefile.in and and take a standard set of command line arguments.
Creating a Makefile.in. To create all the Makefile.in s for a package, run the automake program in the top level directory, with no arguments. automake will automatically find each appropriate Makefile.am (by scanning configure.in ; see configure) and generate the corresponding Makefile.in .
make check TESTS=
will run the check
target but not invoke any tests.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With