Modified the order with which tests are included by config_test.cpp so that MSVC6 doesn't choke any more.

[SVN r26540]
This commit is contained in:
John Maddock
2004-12-17 11:39:54 +00:00
parent 1e3c885b4c
commit 78c80bdd79
3 changed files with 152 additions and 146 deletions
+9 -4
View File
@@ -32,6 +32,7 @@ std::string copyright(
"// See http://www.boost.org/libs/config for the most recent version.");
std::stringstream config_test1;
std::stringstream config_test1a;
std::stringstream config_test2;
std::stringstream jamfile;
@@ -49,6 +50,7 @@ void write_config_test()
"#include <boost/config.hpp>\n#include <iostream>\n#include \"test.hpp\"\n\n"
"int error_count = 0;\n\n";
ofs << config_test1.str() << std::endl;
ofs << config_test1a.str() << std::endl;
ofs << "int main( int, char *[] )\n{\n" << config_test2.str() << " return error_count;\n}\n\n";
}
@@ -174,11 +176,14 @@ void process_ipp_file(const fs::path& file, bool positive_test)
write_test_file(positive_file, macro_name, namespace_name, file.leaf(), positive_test, true);
write_test_file(negative_file, macro_name, namespace_name, file.leaf(), positive_test, false);
// always create config_test data:
config_test1 << "#if";
// always create config_test data,
// positive and negative tests go to separate streams, because for some
// reason some compilers choke unless we put them in a particular order...
std::ostream* pout = positive_test ? &config_test1a : &config_test1;
*pout << "#if";
if(!positive_test)
config_test1 << "n";
config_test1 << "def " << macro_name
*pout << "n";
*pout << "def " << macro_name
<< "\n#include \"" << file.leaf() << "\"\n#else\nnamespace "
<< namespace_name << " = empty_boost;\n#endif\n";