silentbicycle / greatest

A C testing library in 1 file. No dependencies, no dynamic allocation. ISC licensed.
ISC License
1.48k stars 108 forks source link

Integration with CMake #111

Open bracketttc opened 3 years ago

bracketttc commented 3 years ago

Is there any interest in integrating with CMake in the same way that GoogleTest is integrated?

So, you write something like this:

greatest_add_tests( TARGET testDriver
    SOURES ${test_sources}
    )

instead of:

add_test( greatest_tests
    COMMAND testDriver
    )

And get:

$ make test
Running tests...
Test project /path/to/project/build
     Start 1: greatest_test1
 1/3 Test #1: greatest_test1 ..............    Passed    0.1 sec
     Start 2: greatest_test2
 2/3 Test #2: greatest_test2 ..............    Passed    0.3 sec
     Start 3: greatest_test3
 3/3 Test #3: greatest_test3 ..............    Passed    0.1 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =   0.51 sec
$

instead of:

$ make test
Running tests...
Test project /path/to/project/build
     Start 1: greatest_tests
 1/1 Test #1: greatest_tests ..............    Passed    0.5 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) =   0.51 sec
$

100% willing to write up the CMake module for it.

silentbicycle commented 3 years ago

I don't use CMake, so I wouldn't maintain it, but something could go in contrib/.

If you post a PR with CMake integration, please target the develop branch.

silentbicycle commented 3 years ago

Work in progress PR: #112.