function runNoark531Test($directory, $testResultsHandler, $arkivUttrekk, $infoFileHandler) { $runDirectory = dirname(dirname(__FILE__)); $testProperty = new TestProperty(Constants::TEST_STANDARD_NOARK5_TEST); $standardTest = new StandardTest(Constants::TEST_STANDARD_NOARK5_TEST, $directory, $runDirectory, null, $testResultsHandler, $arkivUttrekk, $infoFileHandler, $testProperty); $standardTest->runTest(); print $testProperty . PHP_EOL; print 'Amount of memory used is ' . memory_get_usage(false) . PHP_EOL; print 'Amount of real memory used is ' . memory_get_usage(true) . PHP_EOL; }
$defaultMemoryLimit = '1024M'; if (isset($options["m"]) == true) { $defaultMemoryLimit = $options["m"]; } $logger->info('Starting up ' . Constants::TOOL_NAME); $logger->info('Setting memory_limit to ' . $defaultMemoryLimit); ini_set('memory_limit', $defaultMemoryLimit); $directory = $options["d"]; $testType = $options["t"]; $testTypeVersion = $options["v"]; $infoFile = $options["i"]; $testResultsHandler = new TestResultsHandler(); if (strcasecmp($testType, Constants::TEST_TYPE_NOARK5) == 0 && strcasecmp($testTypeVersion, Constants::TEST_TYPE_NOARK5_VERSION_31) == 0) { $logger->trace('Before starting the amount of memory used is ' . memory_get_usage(false)); $logger->trace('Before starting the amount of real memory used is ' . memory_get_usage(true)); $testProperty = new TestProperty(Constants::TEST_STANDARD_NOARK5_TEST); $testProperty->setTestResult(true); // Assume test will be true until otherwise proven wrong $standardTest = new StandardTest(Constants::TEST_STANDARD_NOARK5_TEST, $directory, $testResultsHandler, $infoFile, $noark5StructureFile, null, $testProperty); $standardTest->runTest(); if ($testProperty->getTestResult() == true) { $logger->info('Standardtest completed without any errors'); } else { $logger->info('Standardtest completed with errors. ' . $testProperty->getDescription()); } $logger->trace('After standardTest, the amount of memory used is ' . memory_get_usage(false)); $logger->trace('After standardTest, the amount of real memory used is ' . memory_get_usage(true)); } $reportBuilder = new ReportBuilder($testResultsHandler); $reportBuilder->createDocument(); exit;