Created
October 3, 2011 19:44
-
-
Save arturopie/1260030 to your computer and use it in GitHub Desktop.
scripts to run sy2 and sy3 severak times and check if they pass
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'open3' | |
failed = false | |
for i in 1..20 | |
puts i | |
stdin, stdout, stderr = Open3.popen3("sys161 kernel-ASST1 'sy2; q'") | |
if ((str = stderr.gets) =~ /sys161: Cannot/) | |
puts "There was an error" | |
puts "Output:" | |
puts str | |
return false | |
end | |
output = stdout.readlines.join(" ") | |
if output =~ /Test failed/ || output =~ /panic/ | |
puts "A TEST FAILED!" | |
failed = true | |
puts "OUTPUT:" | |
puts output | |
break | |
end | |
end | |
puts "ALL TESTS PASSED!" unless failed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'open3' | |
def test | |
for i in 1..5 | |
puts "TEST #{i}" | |
stdin, stdout, stderr = Open3.popen3("sys161 kernel-ASST1 'sy3; q'") | |
if ((str = stderr.gets) =~ /sys161: Cannot/) | |
puts "There was an error" | |
puts "Output:" | |
puts str | |
return false | |
end | |
while (str = stdout.gets) | |
puts "Output: #{str}" | |
if str =~ /Test failed/ || str =~ /panic/ | |
return false | |
end | |
if str =~ /Threads should print out in reverse order./ | |
for i in 1..5 | |
31.downto(0) do |j| | |
str = stdout.gets | |
unless str =~ /Thread #{j}/ | |
puts "Output: #{str}" | |
return false | |
end | |
end | |
end | |
str = stdout.gets | |
unless str =~ /CV test done/ | |
puts "Output: #{str}" | |
return false | |
end | |
end | |
end | |
end | |
return true | |
end | |
if test | |
puts "ALL TESTS PASSED!" | |
else | |
puts "SOME TESTS FAILED!" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment