createRC(); $sysConf = array(); $sysConf = bootstrap(); putenv("SYSCONFDIR={$GLOBALS['SYSCONFDIR']}"); $_ENV['SYSCONFDIR'] = $GLOBALS['SYSCONFDIR']; $modules = array(); $funcList = array(); // get the list of functional tests to run $modules = parse_ini_file('../dataFiles/funcTests.ini', 1); foreach ($modules as $key => $value) { $funcList[] = $key; } // @todo fix this, I don't think you need to check for workspace. if (is_null($WORKSPACE)) { // back to fossology/src backToParent('../..'); } else { if (@chdir($WORKSPACE . "/src") === FALSE) { echo "FATAL! " . __FILE__ . " could not cd to " . $WORKSPACE . "/src\n"; exit(1); } } /* store the current working directory, from which each test will begin */ $original_directory = getcwd(); $failures = 0; foreach ($funcList as $funcTest) { /* start off each test in the original directory */ chdir($original_directory); echo "\n"; echo "{$funcTest}\n"; /* check the first three characters of the subdirectory for 'lib' or 'cli' */
/** * \brief remove xml files from the test run, so jenkins doesn't try to process them * * @return void */ function cleanXMLFiles() { global $unitList; reset($unitList); foreach ($unitList as $unitTest) { $other = substr($unitTest, 0, 3); if ($other == 'lib' || $other == 'cli') { if (@chdir($unitTest . '/tests') === FALSE) { echo "Error! cannot cd to " . $unitTest . "/tests, skipping test\n"; $failures++; continue; } } else { if (@chdir($unitTest . '/agent_tests/Unit') === FALSE) { echo "Error! cannot cd to " . $unitTest . "/agent_tests/Unit, skipping test\n"; $failures++; continue; } } foreach (glob("{$unitTest}*.xml") as $fName) { $lsOut = array(); $rmOut = array(); $fileName = lcfirst($fName); $last = exec("rm {$fileName}", $rmOut, $rmRtn); if ($rmRtn != 0) { echo "Notice: could not remove {$filename}, please remove by hand\n"; } } // foreach backToParent('../../..'); } // foreach return; }