File: travis_test.rb

package info (click to toggle)
genometools 1.6.1%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 50,412 kB
  • sloc: ansic: 271,241; ruby: 30,339; python: 4,880; sh: 3,193; makefile: 1,194; perl: 219; pascal: 159; haskell: 37; sed: 5
file content (58 lines) | stat: -rwxr-xr-x 1,511 bytes parent folder | download | duplicates (4)
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