mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
tests: Log exceptions thrown inside of unit tests
This commit is contained in:
parent
cfed682d04
commit
7919318be7
1 changed files with 16 additions and 12 deletions
|
@ -37,7 +37,11 @@ class TestFailedException : public std::exception {
|
||||||
try { \
|
try { \
|
||||||
fxn(__VA_ARGS__); \
|
fxn(__VA_ARGS__); \
|
||||||
dstream << "[PASS] "; \
|
dstream << "[PASS] "; \
|
||||||
} catch (...) { \
|
} catch (TestFailedException &e) { \
|
||||||
|
dstream << "[FAIL] "; \
|
||||||
|
num_tests_failed++; \
|
||||||
|
} catch (std::exception &e) { \
|
||||||
|
dstream << "Caught unhandled exception: " << e.what() << std::endl; \
|
||||||
dstream << "[FAIL] "; \
|
dstream << "[FAIL] "; \
|
||||||
num_tests_failed++; \
|
num_tests_failed++; \
|
||||||
} \
|
} \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue