Example #1
0
int cpp_main(int argc, char* argv[])
{
   //
   // get the boost path to begin with:
   //
   if(argc > 1)
   {
      fs::path p(argv[1], fs::native);
      config_path = p / "libs" / "config" / "test" ;
   }
   else
   {
      // try __FILE__:
      fs::path p(__FILE__, fs::native);
      config_path = p.branch_path().branch_path() / "test";
   }
   std::cout << "Info: Boost.Config test path set as: " << config_path.native_directory_string() << std::endl;

   // enumerate *.ipp files:
   boost::regex ipp_mask("boost_(?:(has)|no).*\\.ipp");
   boost::smatch ipp_match;
   fs::directory_iterator i(config_path), j;
   while(i != j)
   {
      if(boost::regex_match(i->path().leaf(), ipp_match, ipp_mask))
      {
         process_ipp_file(*i, ipp_match[1].matched);
      }
      ++i;
   }
   write_config_test();
   write_jamfile_v2();
   write_config_info();
   return 0;
}
Example #2
0
int cpp_main(int argc, char* argv[])
{
   //
   // get the boost path to begin with:
   //
   if(argc > 1)
   {
      fs::path p(argv[1]);
      config_path = p / "libs" / "config" / "test" ;
   }
   else
   {
      // try __FILE__:
      fs::path p(__FILE__);
      config_path = p.branch_path().branch_path() / "test";
   }
   std::cout << "Info: Boost.Config test path set as: " << config_path.string() << std::endl;

   // enumerate *.ipp files and store them in a map for now:
   boost::regex ipp_mask("boost_(?:(has)|no).*\\.ipp");
   boost::smatch ipp_match;
   fs::directory_iterator i(config_path), j;
   std::map<fs::path, bool> files_to_process;
   while(i != j)
   {
      if(boost::regex_match(i->path().leaf().string(), ipp_match, ipp_mask))
      {
         files_to_process[*i] = ipp_match[1].matched;
      }
      ++i;
   }
   // Enumerate the files and process them, by defering this until now
   // the results are always alphabetized which reduces churn in the
   // generated files.
   for(std::map<fs::path, bool>::const_iterator pos = files_to_process.begin(); pos != files_to_process.end(); ++pos)
   {
      process_ipp_file(pos->first, pos->second);
   }
   write_config_test();
   write_jamfile_v2();
   write_config_info();
   write_build_tests();
   write_build_check_jamfile();
   return 0;
}