diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2021-09-24 12:31:43 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2021-09-24 12:31:43 +0300 |
commit | dec742c5fa8a8ab35b2bbe96f990a84959164f66 (patch) | |
tree | 7a89dd3bee22062fe0d7aa99366988cc7713bbb1 | |
parent | 32b728b7e9ef2505220e8a4d7dffb4bfda94e16e (diff) |
Fortify tests against NDEBUG
-rw-r--r-- | libbuild2/build/script/lexer.test.cxx | 4 | ||||
-rw-r--r-- | libbuild2/build/script/parser.test.cxx | 4 | ||||
-rw-r--r-- | libbuild2/cc/lexer.test.cxx | 4 | ||||
-rw-r--r-- | libbuild2/cc/parser.test.cxx | 4 | ||||
-rw-r--r-- | libbuild2/function.test.cxx | 3 | ||||
-rw-r--r-- | libbuild2/lexer.test.cxx | 4 | ||||
-rw-r--r-- | libbuild2/name.test.cxx | 4 | ||||
-rw-r--r-- | libbuild2/scheduler.test.cxx | 4 | ||||
-rw-r--r-- | libbuild2/script/lexer.test.cxx | 4 | ||||
-rw-r--r-- | libbuild2/script/regex.test.cxx | 3 | ||||
-rw-r--r-- | libbuild2/test/script/lexer.test.cxx | 4 | ||||
-rw-r--r-- | libbuild2/test/script/parser.test.cxx | 4 | ||||
-rw-r--r-- | old-tests/depdb/driver.cxx | 3 | ||||
-rw-r--r-- | old-tests/lexer/driver.cxx | 4 | ||||
-rw-r--r-- | old-tests/parser/driver.cxx | 4 | ||||
-rw-r--r-- | tests/libbuild2/driver.cxx | 3 | ||||
-rw-r--r-- | tests/test/config-test/driver.cxx | 3 | ||||
-rw-r--r-- | tests/test/script/runner/driver.cxx | 4 | ||||
-rw-r--r-- | tests/test/simple/generated/driver.cxx | 3 |
19 files changed, 57 insertions, 13 deletions
diff --git a/libbuild2/build/script/lexer.test.cxx b/libbuild2/build/script/lexer.test.cxx index 1c47442..e496f94 100644 --- a/libbuild2/build/script/lexer.test.cxx +++ b/libbuild2/build/script/lexer.test.cxx @@ -1,7 +1,6 @@ // file : libbuild2/build/script/lexer.test.cxx -*- C++ -*- // license : MIT; see accompanying LICENSE file -#include <cassert> #include <iostream> #include <libbuild2/types.hxx> @@ -10,6 +9,9 @@ #include <libbuild2/build/script/token.hxx> #include <libbuild2/build/script/lexer.hxx> +#undef NDEBUG +#include <cassert> + using namespace std; namespace build2 diff --git a/libbuild2/build/script/parser.test.cxx b/libbuild2/build/script/parser.test.cxx index da23564..4089efa 100644 --- a/libbuild2/build/script/parser.test.cxx +++ b/libbuild2/build/script/parser.test.cxx @@ -1,7 +1,6 @@ // file : libbuild2/build/script/parser.test.cxx -*- C++ -*- // license : MIT; see accompanying LICENSE file -#include <cassert> #include <iostream> #include <libbuild2/types.hxx> @@ -16,6 +15,9 @@ #include <libbuild2/build/script/parser.hxx> #include <libbuild2/build/script/runner.hxx> +#undef NDEBUG +#include <cassert> + using namespace std; namespace build2 diff --git a/libbuild2/cc/lexer.test.cxx b/libbuild2/cc/lexer.test.cxx index 284d592..0d7d12f 100644 --- a/libbuild2/cc/lexer.test.cxx +++ b/libbuild2/cc/lexer.test.cxx @@ -1,7 +1,6 @@ // file : libbuild2/cc/lexer.test.cxx -*- C++ -*- // license : MIT; see accompanying LICENSE file -#include <cassert> #include <iostream> #include <libbuild2/types.hxx> @@ -9,6 +8,9 @@ #include <libbuild2/cc/lexer.hxx> +#undef NDEBUG +#include <cassert> + using namespace std; using namespace butl; diff --git a/libbuild2/cc/parser.test.cxx b/libbuild2/cc/parser.test.cxx index 7613741..1d5930a 100644 --- a/libbuild2/cc/parser.test.cxx +++ b/libbuild2/cc/parser.test.cxx @@ -1,7 +1,6 @@ // file : libbuild2/cc/parser.test.cxx -*- C++ -*- // license : MIT; see accompanying LICENSE file -#include <cassert> #include <iostream> #include <libbuild2/types.hxx> @@ -9,6 +8,9 @@ #include <libbuild2/cc/parser.hxx> +#undef NDEBUG +#include <cassert> + using namespace std; using namespace butl; diff --git a/libbuild2/function.test.cxx b/libbuild2/function.test.cxx index c64bd0a..b09e4f7 100644 --- a/libbuild2/function.test.cxx +++ b/libbuild2/function.test.cxx @@ -15,6 +15,9 @@ #include <libbuild2/file-cache.hxx> #include <libbuild2/diagnostics.hxx> +#undef NDEBUG +#include <cassert> + using namespace std; namespace build2 diff --git a/libbuild2/lexer.test.cxx b/libbuild2/lexer.test.cxx index 6d48885..809fcd6 100644 --- a/libbuild2/lexer.test.cxx +++ b/libbuild2/lexer.test.cxx @@ -2,7 +2,6 @@ // license : MIT; see accompanying LICENSE file #include <cstdlib> // strtoul() -#include <cassert> #include <iostream> #include <libbuild2/types.hxx> @@ -11,6 +10,9 @@ #include <libbuild2/token.hxx> #include <libbuild2/lexer.hxx> +#undef NDEBUG +#include <cassert> + using namespace std; namespace build2 diff --git a/libbuild2/name.test.cxx b/libbuild2/name.test.cxx index 979e8ab..80b830e 100644 --- a/libbuild2/name.test.cxx +++ b/libbuild2/name.test.cxx @@ -3,7 +3,6 @@ #include <sstream> -#include <cassert> #include <iostream> #include <libbuild2/types.hxx> // Includes name. @@ -11,6 +10,9 @@ #include <libbuild2/diagnostics.hxx> +#undef NDEBUG +#include <cassert> + using namespace std; namespace build2 diff --git a/libbuild2/scheduler.test.cxx b/libbuild2/scheduler.test.cxx index 49d0086..b29c932 100644 --- a/libbuild2/scheduler.test.cxx +++ b/libbuild2/scheduler.test.cxx @@ -4,7 +4,6 @@ #include <chrono> #include <thread> -#include <cassert> #include <iostream> #include <libbuild2/types.hxx> @@ -12,6 +11,9 @@ #include <libbuild2/scheduler.hxx> +#undef NDEBUG +#include <cassert> + using namespace std; namespace build2 diff --git a/libbuild2/script/lexer.test.cxx b/libbuild2/script/lexer.test.cxx index b8de241..1516850 100644 --- a/libbuild2/script/lexer.test.cxx +++ b/libbuild2/script/lexer.test.cxx @@ -1,7 +1,6 @@ // file : libbuild2/script/lexer.test.cxx -*- C++ -*- // license : MIT; see accompanying LICENSE file -#include <cassert> #include <iostream> #include <libbuild2/types.hxx> @@ -10,6 +9,9 @@ #include <libbuild2/script/token.hxx> #include <libbuild2/script/lexer.hxx> +#undef NDEBUG +#include <cassert> + using namespace std; namespace build2 diff --git a/libbuild2/script/regex.test.cxx b/libbuild2/script/regex.test.cxx index 36d47e1..9ec2432 100644 --- a/libbuild2/script/regex.test.cxx +++ b/libbuild2/script/regex.test.cxx @@ -6,6 +6,9 @@ #include <libbuild2/script/regex.hxx> +#undef NDEBUG +#include <cassert> + using namespace std; using namespace build2::script::regex; diff --git a/libbuild2/test/script/lexer.test.cxx b/libbuild2/test/script/lexer.test.cxx index 9c64616..76f102d 100644 --- a/libbuild2/test/script/lexer.test.cxx +++ b/libbuild2/test/script/lexer.test.cxx @@ -1,7 +1,6 @@ // file : libbuild2/test/script/lexer.test.cxx -*- C++ -*- // license : MIT; see accompanying LICENSE file -#include <cassert> #include <iostream> #include <libbuild2/types.hxx> @@ -10,6 +9,9 @@ #include <libbuild2/test/script/token.hxx> #include <libbuild2/test/script/lexer.hxx> +#undef NDEBUG +#include <cassert> + using namespace std; namespace build2 diff --git a/libbuild2/test/script/parser.test.cxx b/libbuild2/test/script/parser.test.cxx index 202f368..47d56ce 100644 --- a/libbuild2/test/script/parser.test.cxx +++ b/libbuild2/test/script/parser.test.cxx @@ -1,7 +1,6 @@ // file : libbuild2/test/script/parser.test.cxx -*- C++ -*- // license : MIT; see accompanying LICENSE file -#include <cassert> #include <iostream> #include <libbuild2/types.hxx> @@ -18,6 +17,9 @@ #include <libbuild2/test/script/parser.hxx> #include <libbuild2/test/script/runner.hxx> +#undef NDEBUG +#include <cassert> + using namespace std; namespace build2 diff --git a/old-tests/depdb/driver.cxx b/old-tests/depdb/driver.cxx index b802662..47f99af 100644 --- a/old-tests/depdb/driver.cxx +++ b/old-tests/depdb/driver.cxx @@ -10,6 +10,9 @@ #include <libbuild2/depdb.hxx> +#undef NDEBUG +#include <cassert> + using namespace std; using namespace build2; diff --git a/old-tests/lexer/driver.cxx b/old-tests/lexer/driver.cxx index 588f062..f5e47c3 100644 --- a/old-tests/lexer/driver.cxx +++ b/old-tests/lexer/driver.cxx @@ -3,13 +3,15 @@ #include <string> #include <vector> -#include <cassert> #include <sstream> #include <iostream> #include <build/token> #include <build/lexer> +#undef NDEBUG +#include <cassert> + using namespace std; using namespace build; diff --git a/old-tests/parser/driver.cxx b/old-tests/parser/driver.cxx index a5b6820..6fb5aee 100644 --- a/old-tests/parser/driver.cxx +++ b/old-tests/parser/driver.cxx @@ -1,7 +1,6 @@ // file : tests/build/parser/driver.cxx -*- C++ -*- // license : MIT; see accompanying LICENSE file -#include <cassert> #include <sstream> #include <iostream> @@ -14,6 +13,9 @@ #include <build/lexer> #include <build/parser> +#undef NDEBUG +#include <cassert> + using namespace std; using namespace build; diff --git a/tests/libbuild2/driver.cxx b/tests/libbuild2/driver.cxx index 1c4554a..9a8db9e 100644 --- a/tests/libbuild2/driver.cxx +++ b/tests/libbuild2/driver.cxx @@ -16,6 +16,9 @@ #include <libbuild2/bash/init.hxx> #include <libbuild2/version/init.hxx> +#undef NDEBUG +#include <cassert> + using namespace build2; int diff --git a/tests/test/config-test/driver.cxx b/tests/test/config-test/driver.cxx index 5902854..7ea10e7 100644 --- a/tests/test/config-test/driver.cxx +++ b/tests/test/config-test/driver.cxx @@ -3,6 +3,9 @@ #include <iostream> +#undef NDEBUG +#include <cassert> + using namespace std; int diff --git a/tests/test/script/runner/driver.cxx b/tests/test/script/runner/driver.cxx index f081714..d0e7601 100644 --- a/tests/test/script/runner/driver.cxx +++ b/tests/test/script/runner/driver.cxx @@ -11,7 +11,6 @@ #include <limits> // numeric_limits #include <string> #include <cstdlib> // abort() -#include <cassert> #include <ostream> // endl, *bit #include <istream> // istream::traits_type::eof() #include <iostream> @@ -22,6 +21,9 @@ #include <libbutl/fdstream.mxx> #include <libbutl/filesystem.mxx> +#undef NDEBUG +#include <cassert> + using namespace std; using namespace butl; diff --git a/tests/test/simple/generated/driver.cxx b/tests/test/simple/generated/driver.cxx index 18fd0ae..89dacca 100644 --- a/tests/test/simple/generated/driver.cxx +++ b/tests/test/simple/generated/driver.cxx @@ -12,6 +12,9 @@ #include <fstream> #include <iostream> +#undef NDEBUG +#include <cassert> + using namespace std; // If the -s option is specified, then also sleep for 5 seconds. |