Add unit tests for api::Solver::setOption() (#7708)
authorGereon Kremer <gkremer@stanford.edu>
Thu, 2 Dec 2021 00:30:09 +0000 (16:30 -0800)
committerGitHub <noreply@github.com>
Thu, 2 Dec 2021 00:30:09 +0000 (00:30 +0000)
commit6afc21a16e740d4fb4a16cdbd9a6ff745c7ce00c
tree5b9695d8b677b11c019cd644f787ed3a6c98cc2a
parent1339d73750e15422a5c2085c4819c15b77bededd
Add unit tests for api::Solver::setOption() (#7708)

This PR adds a generic unit test for api::Solver::setOption(). It iterates over all options and calls setOption() with somewhat cleverly chosen values according to getOptionInfo().
While building this, it occurred to me that calling std::exit() in an option handler is weird (for example for version) and we should do this in the driver instead. This PR also refactors this issue, moving all calls to std::exit() from the option handlers into the driver.
12 files changed:
src/main/driver_unified.cpp
src/main/options.h
src/main/options_template.cpp
src/options/main_options.toml
src/options/options_handler.cpp
src/options/options_handler.h
test/regress/CMakeLists.txt
test/regress/regress0/options/didyoumean.smt2 [new file with mode: 0644]
test/regress/regress0/options/help.smt2 [new file with mode: 0644]
test/unit/CMakeLists.txt
test/unit/options/CMakeLists.txt [new file with mode: 0644]
test/unit/options/options_black.cpp [new file with mode: 0644]