|
From: Mark D. <mar...@hp...> - 2008-08-22 19:35:59
|
Marcus Baker wrote:
> Hi...
>
> Mark Donohoe wrote:
>> Thanks for any insight you can give.
>>
>
> I don't tend to need this. Do you have a concrete example? I can more
> clearly say what I do if I have something I can give a code snippet for.
>
> yours, Marcus
Marcus, here is my latest attempt. I have other examples I give next week.
Below is an attempt to create a run script that will run 1 test (useful for
working on the test and avoids having to edit the run file).
Why does this fail like this? To me what gets passed to the test should be
exactly the same (the var gets expanded into the same string).
markd@snape: ./rat.php UnitTests/testparseBrowseMenus.php
RAT: prarameters are:./rat.php
UnitTests/testparseBrowseMenus.php
Catchable fatal error: Object of class TestSuite could not be converted to
string in /usr/local/simpletest/test_case.php on line 391
markd@snape: ./rat.php UnitTests/testparseBrowseMenus.php
If I adjust the requires in the test and just have
UnitTests/testparseBrowseMenus.php as the test to run it works.
Here is the code:
#!/usr/bin/php
<?php
/* simpletest includes */
require_once '/usr/local/simpletest/unit_tester.php';
require_once '/usr/local/simpletest/web_tester.php';
require_once '/usr/local/simpletest/reporter.php';
require_once ('fossologyWebTestCase.php');
require_once ('TestEnvironment.php');
list ($me, $test) = $argv;
print "RAT: prarameters are:$me\n$test\n";
$test = & new TestSuite("Run Fossology test $test");
/* this line works */
$test->addTestFile('UnitTests/testparseBrowseMenus.php');
/* this line fails */
//$test->addTestFile($test);
if (TextReporter :: inCli())
{
exit ($test->run(new TextReporter()) ? 0 : 1);
}
$test->run(new HtmlReporter());
?>
Thanks for your time and help.
--
Mark Donohoe
OSLO/OSTT, Cupertino CA.
fossology.org
|