Ciaran McCreesh’s Blag

Now with 17% more caffeine

Posts Tagged ‘autotools’

Building but Not Running Tests with Automake

Posted by Ciaran McCreesh on June 13, 2008

If you’re still stuck using autotools because Quagmire can’t yet do everything you need, you might find this little hack handy…

When making an API change that you know will break lots of your unit tests, it would be nice to have a ‘make check-programs-but-don’t-bother-running-them’ target. Automake doesn’t let you do this — to build check_PROGRAMS, you have to run them (and all the tests in SUBDIRS you already fixed) too. This can get annoying if you’re just wanting the compiler to point out the next place you have to change something. But you can cheat…

make check TESTS_ENVIRONMENT=true

One drawback: if you’re using XFAIL_TESTS, they’ll show up as incorrectly passing. If you don’t have many of these, you can disable them and still gain most of the benefits:

make check TESTS_ENVIRONMENT=true XFAIL_TESTS=

Posted in build systems | Tagged: , , | Leave a Comment »