Generate Jamfile.v2 as well.

[SVN r32936]
This commit is contained in:
Vladimir Prus
2006-02-15 11:25:01 +00:00
parent 253379fcaf
commit ee01b1d973

View File

@ -36,6 +36,7 @@ std::stringstream config_test1;
std::stringstream config_test1a; std::stringstream config_test1a;
std::stringstream config_test2; std::stringstream config_test2;
std::stringstream jamfile; std::stringstream jamfile;
std::stringstream jamfile_v2;
std::set<std::string> macro_list; std::set<std::string> macro_list;
@ -101,12 +102,34 @@ void write_jamfile()
"# bring in the rules for testing\n" "# bring in the rules for testing\n"
"import testing ./options ;\n\n" "import testing ./options ;\n\n"
"run config_info.cpp <template>config_options ;\n" "run config_info.cpp <template>config_options ;\n"
"run math_info.cpp <template>config_options : : : <borland><*><runtime-link>static ;\n"
"run config_test.cpp <template>config_options ;\n" "run config_test.cpp <template>config_options ;\n"
"run limits_test.cpp <template>config_test_options ;\n" "run limits_test.cpp <template>config_test_options ;\n"
"run abi/abi_test.cpp abi/main.cpp <template>config_options ;\n\n"; "run abi/abi_test.cpp abi/main.cpp <template>config_options ;\n\n";
ofs << jamfile.str() << std::endl; ofs << jamfile.str() << std::endl;
} }
void write_jamfile_v2()
{
fs::ofstream ofs(config_path / "Jamfile.v2");
time_t t = std::time(0);
ofs << "#\n# Regression test Jamfile for boost configuration setup.\n# *** DO NOT EDIT THIS FILE BY HAND ***\n"
"# This file was automatically generated on " << std::ctime(&t);
ofs << "# by libs/config/tools/generate.cpp\n"
"# Copyright John Maddock.\n"
"#\n# If you need to alter build preferences then set them in\n"
"# the template defined in options_v2.jam.\n#\n"
"path-constant DOT : . ;\n"
"include $(DOT)/options_v2.jam ;\n\n"
"run config_info.cpp ;\n"
"run math_info.cpp : : : <toolset>borland:<runtime-link>static ;\n"
"run config_test.cpp ;\n"
"run limits_test.cpp ;\n"
"run abi/abi_test.cpp abi/main.cpp ;\n\n";
ofs << jamfile_v2.str() << std::endl;
}
void write_test_file(const fs::path& file, void write_test_file(const fs::path& file,
const std::string& macro_name, const std::string& macro_name,
const std::string& namespace_name, const std::string& namespace_name,
@ -232,6 +255,10 @@ void process_ipp_file(const fs::path& file, bool positive_test)
"[ run " << positive_file.leaf() << " <template>config_options ]\n" "[ run " << positive_file.leaf() << " <template>config_options ]\n"
"[ compile-fail " << negative_file.leaf() << " <template>config_options ] ;\n"; "[ compile-fail " << negative_file.leaf() << " <template>config_options ] ;\n";
jamfile_v2 << "test-suite \"" << macro_name << "\" : \n"
"[ run " << positive_file.leaf() << " ]\n"
"[ compile-fail " << negative_file.leaf() << " ] ;\n";
} }
int cpp_main(int argc, char* argv[]) int cpp_main(int argc, char* argv[])
@ -266,6 +293,7 @@ int cpp_main(int argc, char* argv[])
} }
write_config_test(); write_config_test();
write_jamfile(); write_jamfile();
write_jamfile_v2();
write_config_info(); write_config_info();
return 0; return 0;
} }