Skip to content

Commit 88b51a2

Browse files
Do not crash if os gem is not installed, but just skip mac tests
1 parent e864728 commit 88b51a2

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

scripts/update_suite.rb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
# gobopt environment variable can be used to override goblint defaults and PARAMs
44

5-
require 'os'
65
require 'find'
76
require 'fileutils'
87
require 'timeout'
@@ -576,7 +575,15 @@ def run ()
576575
end
577576
end
578577

579-
mac = OS.mac?
578+
maybemac = true
579+
580+
begin
581+
require 'os'
582+
maybemac = OS.mac?
583+
rescue LoadError => e
584+
puts "Missing os gem (install with: gem install os), skipping tests that do not work on mac"
585+
projects = projects.map(&doproject)
586+
end
580587

581588
#processing the file information
582589
projects = []
@@ -606,7 +613,7 @@ def run ()
606613
lines = IO.readlines(path, :encoding => "UTF-8")
607614

608615
next if not future and only.nil? and lines[0] =~ /SKIP/
609-
next if mac and lines[0] =~ /NOMAC/
616+
next if maybemac and lines[0] =~ /NOMAC/
610617
next if marshal and lines[0] =~ /NOMARSHAL/
611618
next if not has_linux_headers and lines[0] =~ /kernel/
612619
if incremental then

0 commit comments

Comments
 (0)