5 r
= Runner(save("xv6.out"))
7 @test(20, "sleep, no args")
8 def test_sleep_no_args():
9 r
.run_qemu(shell_script([
12 r
.match(no
=["exec .* failed", "$ sleep\n$"])
14 @test(20, "sleep, returns")
15 def test_sleep_echo():
16 r
.run_qemu(shell_script([
20 r
.match('^OK$', no
=["exec .* failed", "$ sleep\n$"])
22 @test(10, "sleep, makes syscall")
23 def test_sleep_breakpoint():
24 r
.run_qemu(shell_script([
27 ]), stop_breakpoint('sys_sleep'))
28 r
.match('\\$ sleep 10', no
=['FAIL'])
30 @test(20, "countsys, simple")
31 def test_countsys_simple():
32 r
.run_qemu(shell_script([
35 r
.match('4[12345]', no
=["exec .* failed"])
37 @test(20, "countsys, twice")
38 def test_countsys_twice():
39 r
.run_qemu(shell_script([
43 r
.match('6[12345]', no
=["exec .* failed"])
45 @test(10, "countsys, sleep 10, countsys")
46 def test_countsys_sleep():
47 r
.run_qemu(shell_script([
51 r
.match('(5[89]|6[012])', no
=["exec .* failed"])
53 if __name__
== '__main__':
55 run_tests(outputJSON
=sys
.argv
[1])