[Compbench-devel] CompBenchmarks++ cloptions.cpp,1.23,1.24
Brought to you by:
xfred
From: Frederic T. <xf...@us...> - 2007-04-16 20:14:57
|
Update of /cvsroot/compbench/CompBenchmarks++ In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv16935 Modified Files: cloptions.cpp Log Message: Compiler options can now also be described according to KB. Index: cloptions.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/cloptions.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** cloptions.cpp 20 Mar 2007 20:29:31 -0000 1.23 --- cloptions.cpp 16 Apr 2007 20:14:53 -0000 1.24 *************** *** 39,42 **** --- 39,43 ---- unsigned int compiler:1; unsigned int external_programs:1; + unsigned int option_analyze:1; } OptFilter; *************** *** 152,155 **** --- 153,187 ---- } + std::string cbmCompilerAnalyze(std::string _analyzeResult) + { + int i = 0; + std::string o = "!"; + std::string r; + int times = 0; + int ok = 0; + + while (o!="") { + o=cbmSystem->Split(_analyzeResult, "\n", i++); + if (o=="") { + if ((!times) && (_analyzeResult!="")) + o=_analyzeResult; + else + break; + } + times++; + + if (o=="1") + ok++; + else { + r+=" * "; + r+=o; + r+="\n"; + } + } + if (ok==times) + return(" * Ok"); + else + return(r); + } CBM::Package *cbmOptionsExpectPackage(char *optarg) *************** *** 207,210 **** --- 239,244 ---- std::string options; std::string tarball; + std::string options_analyzed; + std::string tmp; OptDomain domain = DomainUndef; /* help/query/{install/uninstall : manage ?}/bench/version/low-level */ *************** *** 228,231 **** --- 262,266 ---- {"installed", no_argument, 0, 'i'}, {"package", optional_argument, 0, 'p' }, + {"options-analyze", required_argument, 0, 'A'}, {"benchmark", optional_argument, 0, 'b' }, {"host", 0, 0, 'H' }, *************** *** 253,257 **** break; ! c = getopt_long (argc, argv, "hvxiI:F:U:qHc:p::B:b::aMmD:E:P:C:T:R:S:f", // uLHPCFIB", /* :011000112", */ long_options, &option_index); if (c==-1) { --- 288,292 ---- break; ! c = getopt_long (argc, argv, "hvxiI:F:U:qHc:p::B:b::A:aMmD:E:P:C:T:R:S:f", // uLHPCFIB", /* :011000112", */ long_options, &option_index); if (c==-1) { *************** *** 291,294 **** --- 326,334 ---- B=cbmOptionsExpectBenchmark(optarg); break; + case 'A': + filter.option_analyze=1; + if (optarg) + options_analyzed=optarg; + break; case 'D': action=ActionLLDownload; *************** *** 485,491 **** << "Binary : " << C->Binary() << std::endl; ! if (filter.all) { cbmShowOptionDescriptions(C); } parseExitValue=0; break; --- 525,548 ---- << "Binary : " << C->Binary() << std::endl; ! if ((!filter.option_analyze) && (filter.all)) { cbmShowOptionDescriptions(C); } + + if (filter.option_analyze) { + std::cout << std::endl + << "Descriptions from " << C->compiler() << ", branch " << C->relativeDescriptionDirectory() << std::endl + << "Option(s) analyzed : " << options_analyzed << std::endl; + + if (filter.all) { + std::cout << std::endl << "Option short descriptions :" << std::endl; + std::cout << C->shortHelpOptions(options_analyzed) << std::endl; + } else + std::cout << std::endl; + + std::cout << "Analyze : " << std::endl; + tmp=cbmCompilerAnalyze(C->analyzeOptions(options_analyzed)); + std::cout << tmp << std::endl; + } + parseExitValue=0; break; |