Beispiel #1
0
     }
 }
 ########################### doxygen errors  ####################################
 if (in_array("doxygen_errors", $tests)) {
     if (in_array($f, $doxygen_errors)) {
         realOutput("Doxygen errors in '{$f}'", $user, $f);
         print "  See 'OpenMS/doc/doxygen/doxygen-error.log'\n";
     }
 }
 ########################### test errors  #####################################
 if (isset($class_info) && in_array("check_test", $tests)) {
     # get the actual test name -> if it exists
     $testname = current(array_intersect($testnames, $files));
     if (!$testname) {
         #parse test
         $tmp = parseTestFile("{$src_path}/{$testname}");
         $todo_tests = $tmp["todo"];
         $tests2 = $tmp["tests"];
         #compare declarations and tests
         $out = compareDeclarationsAndTests($class_info["test-name"], $tests2);
         # remove methods that can be tested although they are not defined
         $new_unknown = array();
         foreach ($out["unknown"] as $m) {
             //print ">>> '".$m."'  '$classname()'\n";
             if ($m != "{$classname}()" && $m != "~{$classname}()" && !beginsWith($m, "const {$classname}& operator=(") && !beginsWith($m, "{$classname}(const {$classname}&")) {
                 $new_unknown[] = $m;
             }
         }
         $out["unknown"] = $new_unknown;
         #output
         if (count($out["missing"]) != 0 || count($out["unknown"]) != 0 || count($out["double"]) != 0 || count($todo_tests) != 0) {
Beispiel #2
0
    if ($n1 == $n2) {
        return 0;
    }
    return 100;
}
######################## parameter handling ####################################
$verbose = false;
if (in_array("-v", $argv)) {
    $verbose = true;
}
$path = $argv[1];
$header = $argv[2];
$basename = basename($header);
$test_name = "{$path}/source/TEST/" . substr($basename, 0, -2) . "_test.cpp";
######################## determine tested methods ##############################
$tmp = parseTestFile($test_name);
$tests = $tmp["tests"];
if ($verbose) {
    print "\n\nTests:\n";
    foreach ($tests as $t) {
        print "  '{$t}'\n";
    }
}
######################## determine declared methods ##########################
$class_info = getClassInfo($path, $header, 0);
$methods = $class_info["public-long"];
// print methods in verbose mode
if ($verbose) {
    print "\n\\Methods to correct:\n";
    foreach ($methods as $m) {
        print "  '{$m}'\n";