mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 01:29:05 -04:00
notcurses-tester: always reset terminal on exit
This commit is contained in:
parent
4327f95eb1
commit
97a92cbbd7
@ -127,15 +127,11 @@ auto main(int argc, const char **argv) -> int {
|
|||||||
context.setOption("no-breaks", true); // don't break in the debugger when assertions fail
|
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);
|
||||||
if(check_data_dir()){
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
int res = context.run(); // run
|
int res = context.run(); // run
|
||||||
|
reset_terminal();
|
||||||
|
check_data_dir();
|
||||||
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
|
|
||||||
// state. go ahead and reset it manually.
|
|
||||||
reset_terminal();
|
|
||||||
return res; // the result from doctest is propagated here as well
|
return res; // the result from doctest is propagated here as well
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user