1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
#!/usr/bin/env ruby
# what to do during travis tests
success = true
puts ENV['CC']
if ENV['CC'] == 'gcc' or ENV['GT_BITS'] == '32' or ENV['SYSTEM'] == 'Windows'
env = {}
if ENV['GT_BITS'] == '32'
env['32bit' => 'yes']
end
IO.popen([ env,
'make', '-j2',
{:err=>[:child, :out]}]) do |io|
while (line = io.gets)
print line
end
end
success = $?.success?
if success and not ENV['SYSTEM'] == 'Windows' #win binaries won't run on linux
IO.popen(["bin/gt", "-test", :err=>[:child, :out]]) do |io|
while (line = io.gets)
print line
end
end
success = $?.success?
end
else
IO.popen(['make', '-j2', 'test',
{:err=>[:child, :out]}]) do |io|
while (line = io.gets)
print line
if m = line.match(/^\s*(\d+):\s.*: failed$/)
errfiles = Dir.glob("testsuite/stest_testsuite/test#{m[1]}/stderr_*")
errfiles.sort_by! do |path|
path.match /\d+$/
Integer($&)
end
puts "FAILING test, output of #{errfiles.last}"
File.open(errfiles.last, 'r') do |file|
file.each_line do |line|
puts line
end
end
puts "FAILING test, output of stest_error"
File.open("testsuite/stest_testsuite/"+
"test#{m[1]}/stest_error", 'r') do |file|
file.each_line do |line|
puts line
end
end
end
end
end
success = $?.success?
end
exit 0 if success
exit 1
|