selmf / unarr

A decompression library for rar, tar, zip and 7z archives
GNU Lesser General Public License v3.0
73 stars 13 forks source link

1.0.1: no ctest test units #21

Closed kloczek closed 2 years ago

kloczek commented 2 years ago

Looks like test/ content is not integrated with cmake/ctest

[tkloczko@devel-g2v x86_64-redhat-linux-gnu]$ ctest -vv
Test project /home/tkloczko/rpmbuild/BUILD/unarr-1.0.1/x86_64-redhat-linux-gnu
No tests were found!!!
selmf commented 2 years ago

In it's current state, the test/ directory is not ready for ctest integration. Right now it only consists of the unarr-test sample application, which could be used for integration testing, but would require a suitable well-defined test corpus with sample input files to fulfill this role. I do of course have a set of files which I use locally for testing and development, but these are - for various reasons - not suitable for distribution.

I'm currently working on improving the general testing situation and adding the necessary infrastructure for unit tests, adding a test corpus for integration tests and enabling easy fuzzer testing (see #4 ).

selmf commented 2 years ago

Alright, with the latest push, unit tests and integration tests are set up and integrated into the CI. The amount of tests is still very modest, but that will change with time. To build tests, you need to add:

-DBUILD_UNIT_TESTS=ON
-DBUILD_INTEGRATION_TESTS=ON

Unit tests need CMocka to work.

You can also run fuzzing tests:

-DBUILD_FUZZER
kloczek commented 2 years ago

I have both options enabled

[tkloczko@devel-g2v SPECS]$ grep TEST rocksdb.spec
        -D WITH_ALL_TESTS=ON \
        -D WITH_TESTS=ON \

and ctest shows

[tkloczko@pers-jacek x86_64-redhat-linux-gnu]$ ctest -vv
Test project /home/tkloczko/rpmbuild/BUILD/rocksdb-7.7.2/x86_64-redhat-linux-gnu
No tests were found!!!
selmf commented 2 years ago

Uhm no you don't. Compare your options with what I wrote. Or compare with azure-pipelines.yml.

selmf commented 2 years ago

Also, are you sure you are using the correct spec file?

kloczek commented 2 years ago

wrong ticket 😄