tests: treat TERM=unknown like unset TERM #865

pull/867/head
nick black 4 years ago
parent c21f0fb812
commit 4f5be0b100
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -541,7 +541,8 @@ if(${BUILD_TESTING})
# sadly, this doesn't take effect until CMake 3.17...
set(CMAKE_CTEST_ARGUMENTS "-V")
enable_testing()
if(DEFINED ENV{TERM})
# the accursed Ubuntu buildd sets "TERM=unknown" for unfathomable reasons
if(DEFINED ENV{TERM} AND NOT $ENV{TERM} STREQUAL "unknown")
add_test(
NAME ncpp_build
COMMAND ncpp_build

@ -106,7 +106,8 @@ auto main(int argc, const char **argv) -> int {
std::cout << "Running with LANG=" << lang << std::endl;
}
const char* term = getenv("TERM");
if(term == nullptr){
// ubuntu's buildd sets TERM=unknown, fuck it, handle this atrocity
if(term == nullptr || strcmp(term, "unknown") == 0){
std::cerr << "TERM wasn't defined, exiting with success" << std::endl;
return EXIT_SUCCESS;
}

Loading…
Cancel
Save