modified version of jenkins debian glue (https://github.com/mika/jenkins-debian-glue) for devuan
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

39 lines
805 B

  1. #!/usr/bin/env ruby
  2. if ARGV[0].nil?
  3. $stderr.puts "Usage: #{File.basename $0} <autopkgtest_summary_file>"
  4. exit 1
  5. end
  6. file = ARGV[0]
  7. counter = 1
  8. found_error = 0
  9. begin
  10. output = File.open("#{file}", "r").read
  11. rescue
  12. $stderr.puts "Error: can't read file #{file}"
  13. exit 1
  14. end
  15. num_lines = output.lines.count
  16. if num_lines == 0
  17. puts "1..0 # Skipped: no autopkgtest output found"
  18. exit 0
  19. end
  20. puts "1..#{num_lines}"
  21. output.gsub(/:\n/, ':').each_line do |critic|
  22. if critic =~ /.*PASS.*/
  23. cmd = /(.*)? (PASS)$/.match(critic)[1]
  24. puts "ok #{counter} #{cmd}"
  25. counter += 1
  26. elsif critic =~ /.*FAIL status.*/
  27. test = /(.*)? (FAIL status:)(.*)?/.match(critic)[1]
  28. cmd = /(.*)? (FAIL status:)(.*)?/.match(critic)[3]
  29. puts "not ok #{counter} #{test} #{cmd}"
  30. counter += 1
  31. end
  32. end