twogood / unshield

Tool and library to extract CAB files from InstallShield installers
MIT License
340 stars 73 forks source link

Re-implement test execution with CTest #149

Closed kratz00 closed 2 years ago

kratz00 commented 2 years ago

Still WIP.

I just wanted to show what I am working on, as you asked about Git LFS in #148

In your CMake workspace run ctest This PR should enable to run the tests cross platform.

TODO:

Test project /tmp/ub
    Start 1: avigomanager_new_compression
1/9 Test #1: avigomanager_new_compression .......   Passed    0.01 sec
    Start 2: avigomanager_old_compression
2/9 Test #2: avigomanager_old_compression .......   Passed    0.07 sec
    Start 3: avigomanager_hashes_match
3/9 Test #3: avigomanager_hashes_match ..........   Passed    0.03 sec
    Start 4: baldurs_gate_new_compression
4/9 Test #4: baldurs_gate_new_compression .......   Passed    0.25 sec
    Start 5: baldurs_gate_old_compression
5/9 Test #5: baldurs_gate_old_compression .......***Exception: SegFault  0.98 sec
    Start 6: baldurs_gate_hashes_match
6/9 Test #6: baldurs_gate_hashes_match ..........   Passed    0.08 sec
    Start 7: the-feeble-files_new_compression
7/9 Test #7: the-feeble-files_new_compression ...   Passed    0.04 sec
    Start 8: the-feeble-files_old_compression
8/9 Test #8: the-feeble-files_old_compression ...   Passed    0.23 sec
    Start 9: the-feeble-files_hashes_match
9/9 Test #9: the-feeble-files_hashes_match ......   Passed    0.08 sec

89% tests passed, 1 tests failed out of 9

Label Time Summary:
avigomanager        =   0.11 sec*proc (3 tests)
baldurs_gate        =   1.31 sec*proc (3 tests)
the-feeble-files    =   0.36 sec*proc (3 tests)

Total Test time (real) =   1.79 sec

The following tests FAILED:
      5 - baldurs_gate_old_compression (SEGFAULT)
Errors while running CTest
Output from these tests are in: /tmp/ub/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.

Btw, trying to extract the Baldurs Gate Cab using the old compression switch crashes unshield (did not look into it yet).

twogood commented 2 years ago

Cool. Much neater with CTest.

twogood commented 2 years ago

Tests should run either with old compression or new, never both as only one should work.

kratz00 commented 2 years ago

A lot of code duplication (something which can be improved in the future), but so far it should work to extract the Zip files, run the actual tests and clean up afterwards. It should work an all platforms which are supported by CMake, so it should be possible to run the tests on Windows in the future too (once #145 respectively #141 have been taken care of).

I will have a look why unshield is crashing with the Baldurs Gate test files using the old compression.

kratz00 commented 2 years ago

@twogood I disabled the crashing test for now (see issue #156) to unblock this pull request.

twogood commented 2 years ago

Great work!