aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/tests.h
diff options
context:
space:
mode:
authorMatthias Gierlings <[email protected]>2018-04-06 20:20:35 +0200
committerMatthias Gierlings <[email protected]>2018-04-06 20:25:45 +0200
commit4476c07bae00dc2cec5183878d81b3e53ff3b97e (patch)
tree2ab30848e3a561f5999a196187aebdcbafae3faf /src/tests/tests.h
parent4292f41101bb86d528252d8395ffb93eb9fa3528 (diff)
Make tests pass by default in UBSAN mode
- Adds macros to check if botan was compiled with a certain sanitizers. - Automatically excludes the tests that are intended to provoke undefined behaviour from the test bench, when botan is compiled with UBSAN. - Changes option `--avoid-undefined` to `--no-avoid-undefined` so the failing tests can be explicitly activated when needed.
Diffstat (limited to 'src/tests/tests.h')
-rw-r--r--src/tests/tests.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tests/tests.h b/src/tests/tests.h
index 0c63797fa..56aa4b8c5 100644
--- a/src/tests/tests.h
+++ b/src/tests/tests.h
@@ -62,7 +62,7 @@ class Test_Options
bool run_online_tests,
bool run_long_tests,
bool abort_on_first_fail,
- bool avoid_undefined) :
+ bool no_avoid_undefined) :
m_requested_tests(requested_tests),
m_data_dir(data_dir),
m_pkcs11_lib(pkcs11_lib),
@@ -73,7 +73,7 @@ class Test_Options
m_run_online_tests(run_online_tests),
m_run_long_tests(run_long_tests),
m_abort_on_first_fail(abort_on_first_fail),
- m_avoid_undefined(avoid_undefined)
+ m_no_avoid_undefined(no_avoid_undefined)
{}
const std::vector<std::string>& requested_tests() const
@@ -97,7 +97,7 @@ class Test_Options
bool abort_on_first_fail() const { return m_abort_on_first_fail; }
- bool avoid_undefined_behavior() const { return m_avoid_undefined; }
+ bool no_avoid_undefined_behavior() const { return m_no_avoid_undefined; }
private:
std::vector<std::string> m_requested_tests;
@@ -110,7 +110,7 @@ class Test_Options
bool m_run_online_tests;
bool m_run_long_tests;
bool m_abort_on_first_fail;
- bool m_avoid_undefined;
+ bool m_no_avoid_undefined;
};
/*
@@ -466,7 +466,7 @@ class Test
static void set_test_rng(std::unique_ptr<Botan::RandomNumberGenerator> rng);
- static bool avoid_undefined_behavior() { return m_opts.avoid_undefined_behavior(); }
+ static bool no_avoid_undefined_behavior() { return m_opts.no_avoid_undefined_behavior(); }
static bool log_success() { return m_opts.log_success(); }
static bool run_online_tests() { return m_opts.run_online_tests(); }
static bool run_long_tests() { return m_opts.run_long_tests(); }