Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++17 std::optional test coverage fixups #446

Merged
merged 1 commit into from
Dec 22, 2024

Conversation

nigels-com
Copy link
Contributor

@nigels-com nigels-com commented Dec 21, 2024

The unit tests were failing for me without these changes.

The first Argv argument should be the program name?

And use std::optional<T>::operator==

$ cmake -DCXXOPTS_CXX_STANDARD=17 -DCMAKE_BUILD_TYPE=Release --fresh .. && make clean all test
...
Running tests...
Test project /home/nigels/dev/cxxopts/build
    Start 1: options
1/3 Test #1: options ..........................   Passed    0.00 sec
    Start 2: find-package-test
2/3 Test #2: find-package-test ................   Passed    6.40 sec
    Start 3: add-subdirectory-test
3/3 Test #3: add-subdirectory-test ............   Passed    6.39 sec

100% tests passed, 0 tests failed out of 3

And

$ test/options_test '[optional]' 
Filters: [optional]
===============================================================================
All tests passed (13 assertions in 2 test cases)

This change is Reviewable

@jarro2783 jarro2783 merged commit f029892 into jarro2783:master Dec 22, 2024
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants