srctree

Robin Linden parent 651949d3 394feecb
etest: Treat no tests run as an error

etest/etest.cpp added: 18, removed: 2, total 16
@@ -57,6 +57,10 @@ int run_all_tests(RunOptions const &opts) noexcept {
}
}
 
if (tests_to_run.empty()) {
return 1;
}
 
// TODO(robinlinden): std::ranges once clang-cl supports it. Last tested
// with LLVM 15.0.0.
auto const longest_name = std::max_element(tests_to_run.begin(),
 
filename was Deleted added: 18, removed: 2, total 16
@@ -0,0 +1,12 @@
// SPDX-FileCopyrightText: 2023 Robin Lindén <dev@robinlinden.eu>
//
// SPDX-License-Identifier: BSD-2-Clause
 
#include "etest/etest.h"
 
// If you try to run tests, but none will run due to them all being filtered out
// or something, that's probably an error.
int main() {
bool failure = etest::run_all_tests() != 0;
return failure ? 0 : 1;
}