How do you create tests for “make check” with GNU autotools

后端 未结 5 1418
情歌与酒
情歌与酒 2021-02-01 16:03

I\'m using GNU autotools for the build system on a particular project. I want to start writing automated tests for verifcation. I would like to just type \"make check\" to have

5条回答
  •  悲&欢浪女
    2021-02-01 17:06

    You can use Automake's TESTS to run programs generated with check_PROGRAMS but this will assume that you are using a log driver and a compiler for the output. It is probably easier to still use check_PROGRAMS but to invoke the test suite using a local rule in the Makefile:

    check_PROGRAMS=testsuite
    
    testsuite_SOURCES=...
    testsuite_CFLAGS=...
    testsuite_LDADD=...
    
    check-local:
        ./testsuite
    

提交回复
热议问题