aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bdep/new.cxx28
1 files changed, 20 insertions, 8 deletions
diff --git a/bdep/new.cxx b/bdep/new.cxx
index a8f3af7..f02626a 100644
--- a/bdep/new.cxx
+++ b/bdep/new.cxx
@@ -1952,6 +1952,8 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args)
//
open (out_src / s + ".test.c");
os << "#include <stdio.h>" << '\n'
+ << '\n'
+ << "#undef NDEBUG" << '\n'
<< "#include <assert.h>" << '\n'
<< '\n'
<< "int main ()" << '\n'
@@ -1967,8 +1969,10 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args)
// <src>/<stem>.test.<cxx-ext>
//
open (out_src / s + ".test" + xe);
- os << "#include <cassert>" << '\n'
- << "#include <iostream>" << '\n'
+ os << "#include <iostream>" << '\n'
+ << '\n'
+ << "#undef NDEBUG" << '\n'
+ << "#include <cassert>" << '\n'
<< '\n'
<< "int main ()" << '\n'
<< "{" << '\n'
@@ -2748,10 +2752,12 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args)
//
open (out_src / s + ".test.c");
os << "#include <stdio.h>" << '\n'
- << "#include <assert.h>" << '\n'
<< '\n'
<< "#include <" << ip << apih << ">" << '\n'
<< '\n'
+ << "#undef NDEBUG" << '\n'
+ << "#include <assert.h>" << '\n'
+ << '\n'
<< "int main ()" << '\n'
<< "{" << '\n'
<< " return 0;" << '\n'
@@ -2765,11 +2771,13 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args)
// <src>/<stem>.test.<cxx-ext>
//
open (out_src / s + ".test" + xe);
- os << "#include <cassert>" << '\n'
- << "#include <iostream>" << '\n'
+ os << "#include <iostream>" << '\n'
<< '\n'
<< "#include <" << ip << apih << ">" << '\n'
<< '\n'
+ << "#undef NDEBUG" << '\n'
+ << "#include <cassert>" << '\n'
+ << '\n'
<< "int main ()" << '\n'
<< "{" << '\n'
<< '\n'
@@ -2915,12 +2923,14 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args)
os << "#include <stdio.h>" << '\n'
<< "#include <errno.h>" << '\n'
<< "#include <string.h>" << '\n'
- << "#include <assert.h>" << '\n'
<< '\n';
if (ver)
os << "#include <" << ip << verh << ">" << '\n';
os << "#include <" << ip << apih << ">" << '\n'
<< '\n'
+ << "#undef NDEBUG" << '\n'
+ << "#include <assert.h>" << '\n'
+ << '\n'
<< "#ifdef _WIN32" << '\n'
<< "#define tmpfile mytmpfile" << '\n'
<< "static FILE *mytmpfile ();" << '\n'
@@ -2994,14 +3004,16 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args)
// tests/basics/driver.<cxx-ext>
//
open (td / "driver" + xe);
- os << "#include <cassert>" << '\n'
- << "#include <sstream>" << '\n'
+ os << "#include <sstream>" << '\n'
<< "#include <stdexcept>" << '\n'
<< '\n';
if (ver)
os << "#include <" << ip << verh << ">" << '\n';
os << "#include <" << ip << apih << ">" << '\n'
<< '\n'
+ << "#undef NDEBUG" << '\n'
+ << "#include <cassert>" << '\n'
+ << '\n'
<< "int main ()" << '\n'
<< "{" << '\n'
<< " using namespace std;" << '\n'