Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make autoconf "check" target without running it

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).

like image 295
Ed K Avatar asked Apr 26 '13 15:04

Ed K


People also ask

How does automake work?

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.

How does Autoconf work?

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.

How do I make my own Makefile?

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 .


1 Answers

make check TESTS=

will run the check target but not invoke any tests.

like image 184
William Pursell Avatar answered Oct 26 '22 23:10

William Pursell