How to find where the error is while running ctest

2020-05-26 14:42发布

问题:

I got the following output after running make test, but how do i get to know what the error is?

Running tests...
Test project /home/puneet/puneet/office/alkimia/payment/build
    Start 1: alkimia-alkuser
1/4 Test #1: alkimia-alkuser ..................   Passed    0.20 sec
    Start 2: alkimia-alkinvoice
2/4 Test #2: alkimia-alkinvoice ...............***Failed    0.25 sec
    Start 3: alkimia-alkpayment
3/4 Test #3: alkimia-alkpayment ...............   Passed    0.22 sec
    Start 4: alkimia-alkpayee
4/4 Test #4: alkimia-alkpayee .................   Passed    0.22 sec

75% tests passed, 1 tests failed out of 4

Total Test time (real) =   0.89 sec

The following tests FAILED:
      2 - alkimia-alkinvoice (Failed)
Errors while running CTest
make: *** [test] Error 8

回答1:

If you run

make test VERBOSE=1

you'll see that the command line used to execute all the tests is a call to ctest.

If you run

ctest -R alkimia-alkinvoice

then only the failing test will be run.

If you run

ctest -R alkimia-alkinvoice -VV

then only the failing test will run and all of its output will also be displayed.