I'd prefer this split into two seperate tests, but it's fine either way Reviewed-by: Dylan Baker <[email protected]>
On Thursday, September 25, 2014 06:13:05 PM Thomas Wood wrote: > Signed-off-by: Thomas Wood <[email protected]> > --- > framework/tests/exectest_test.py | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/framework/tests/exectest_test.py > b/framework/tests/exectest_test.py > index 935719d..ebe02a4 100644 > --- a/framework/tests/exectest_test.py > +++ b/framework/tests/exectest_test.py > @@ -56,6 +56,26 @@ def test_run_return_early(): > test.run() > > > +def test_timeout(): > + """ Test that Test.timeout works correctly """ > + > + def helper(): > + if (test.result['returncode'] == 0): > + test.result['result'] = "pass" > + > + test = TestTest("/usr/bin/sleep 60") > + test.test_interpret_result = helper > + test.timeout = 1 > + test.run() > + assert test.result['result'] == 'timeout' > + > + test = TestTest("/usr/bin/true") > + test.test_interpret_result = helper > + test.timeout = 1 > + test.run() > + assert test.result['result'] == 'pass' > + > + > def test_piglittest_interpret_result(): > """ PiglitTest.interpret_result() works no subtests """ > test = PiglitTest('foo') > -- > 2.1.0 > > _______________________________________________ > Piglit mailing list > [email protected] > http://lists.freedesktop.org/mailman/listinfo/piglit
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Piglit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/piglit
