@@ -21,11 +21,18 @@ def terminate(final = nil)
21
21
end
22
22
23
23
# make a nice status line for an action and react to the action
24
- def perform_action ( message , on_fail_msg , abort_on_fail )
25
- line = "#{ message } ..."
26
- print line
24
+ def perform_action ( message , multiline , on_fail_msg , abort_on_fail )
25
+ line = "#{ message } ... "
26
+ endline = "...#{ message } "
27
+ if multiline
28
+ puts line
29
+ else
30
+ print line
31
+ end
27
32
result = yield
28
33
mark = result ? "✓" : "✗"
34
+ # if multline, put checkmark at full width
35
+ print endline if multiline
29
36
puts mark . rjust ( WIDTH - line . length , " " )
30
37
unless result
31
38
puts on_fail_msg unless on_fail_msg . nil?
@@ -38,12 +45,17 @@ def perform_action(message, on_fail_msg, abort_on_fail)
38
45
39
46
# Make a nice status for something that defers any failure code until script exit
40
47
def attempt ( message , &block )
41
- perform_action ( message , nil , false , &block )
48
+ perform_action ( message , false , nil , false , &block )
49
+ end
50
+
51
+ # Make a nice status for something that defers any failure code until script exit
52
+ def attempt_multiline ( message , &block )
53
+ perform_action ( message , true , nil , false , &block )
42
54
end
43
55
44
56
# Make a nice status for something that kills the script immediately on failure
45
57
def assure ( message , &block )
46
- perform_action ( message , "This may indicate a problem with ArduinoCI!" , true , &block )
58
+ perform_action ( message , false , "This may indicate a problem with ArduinoCI!" , true , &block )
47
59
end
48
60
49
61
# initialize command and config
@@ -56,6 +68,14 @@ def assure(message, &block)
56
68
cpp_library = ArduinoCI ::CppLibrary . new ( installed_library_path )
57
69
attempt ( "Library installed at #{ installed_library_path } " ) { true }
58
70
71
+ # check GCC
72
+ attempt_multiline ( "Checking GCC version" ) do
73
+ version = cpp_library . gcc_version
74
+ next nil unless version
75
+ puts version . split ( "\n " ) . map { |l | " #{ l } " } . join ( "\n " )
76
+ version
77
+ end
78
+
59
79
# gather up all required boards so we can install them up front.
60
80
# start with the "platforms to unittest" and add the examples
61
81
# while we're doing that, get the aux libraries as well
@@ -101,7 +121,7 @@ def assure(message, &block)
101
121
last_board = board
102
122
cpp_library . test_files . each do |unittest_path |
103
123
unittest_name = File . basename ( unittest_path )
104
- attempt ( "Unit testing #{ unittest_name } " ) do
124
+ attempt_multiline ( "Unit testing #{ unittest_name } " ) do
105
125
exe = cpp_library . build_for_test_with_configuration (
106
126
unittest_path ,
107
127
config . aux_libraries_for_unittest ,
0 commit comments