|
|
@ -43,7 +43,7 @@ handle_opts(const char** argv){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// reset the terminal in the event of early exit (notcurses_init() presumably
|
|
|
|
// reset the terminal in the event of early exit (notcurses_init() presumably
|
|
|
|
// ran, but we don't have the notcurses struct to destroy. so just do it raw.
|
|
|
|
// ran, but we don't have the notcurses struct to destroy, so just do it raw).
|
|
|
|
static void
|
|
|
|
static void
|
|
|
|
reset_terminal(){
|
|
|
|
reset_terminal(){
|
|
|
|
int fd = open("/dev/tty", O_RDWR|O_CLOEXEC);
|
|
|
|
int fd = open("/dev/tty", O_RDWR|O_CLOEXEC);
|
|
|
@ -103,22 +103,15 @@ auto main(int argc, const char **argv) -> int {
|
|
|
|
std::cout << "Running with TERM=" << term << std::endl;
|
|
|
|
std::cout << "Running with TERM=" << term << std::endl;
|
|
|
|
doctest::Context context;
|
|
|
|
doctest::Context context;
|
|
|
|
|
|
|
|
|
|
|
|
context.setOption("order-by", "name"); // sort the test cases by their name
|
|
|
|
context.setOption("order-by", "name"); // sort the test cases by their name
|
|
|
|
|
|
|
|
|
|
|
|
context.applyCommandLine(argc, argv);
|
|
|
|
context.applyCommandLine(argc, argv);
|
|
|
|
|
|
|
|
context.setOption("no-breaks", true); // don't break in the debugger when assertions fail
|
|
|
|
// overrides
|
|
|
|
|
|
|
|
context.setOption("no-breaks", true); // don't break in the debugger when assertions fail
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dt_removed args(argv);
|
|
|
|
dt_removed args(argv);
|
|
|
|
handle_opts(argv);
|
|
|
|
handle_opts(argv);
|
|
|
|
|
|
|
|
|
|
|
|
int res = context.run(); // run
|
|
|
|
int res = context.run(); // run
|
|
|
|
|
|
|
|
|
|
|
|
if(context.shouldExit()){ // important - query flags (and --exit) rely on the user doing this
|
|
|
|
if(context.shouldExit()){ // important - query flags (and --exit) rely on the user doing this
|
|
|
|
return res; // propagate the result of the tests
|
|
|
|
return res; // propagate the result of the tests
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// if we exited via REQUIRE(), we likely left the terminal in an invalid
|
|
|
|
// if we exited via REQUIRE(), we likely left the terminal in an invalid
|
|
|
|
// state. go ahead and reset it manually.
|
|
|
|
// state. go ahead and reset it manually.
|
|
|
|
if(res){
|
|
|
|
if(res){
|
|
|
|