3
3
4
4
HPP_EXTENSIONS = [ ".hpp" , ".hh" , ".h" , ".hxx" , ".h++" ] . freeze
5
5
CPP_EXTENSIONS = [ ".cpp" , ".cc" , ".c" , ".cxx" , ".c++" ] . freeze
6
- ARDUINO_HEADER_DIR = File . expand_path ( "../../../ cpp/arduino" , __FILE__ )
7
- UNITTEST_HEADER_DIR = File . expand_path ( "../../../ cpp/unittest" , __FILE__ )
6
+ ARDUINO_HEADER_DIR = File . expand_path ( "../../cpp/arduino" , __dir__ )
7
+ UNITTEST_HEADER_DIR = File . expand_path ( "../../cpp/unittest" , __dir__ )
8
8
9
9
module ArduinoCI
10
10
@@ -50,6 +50,7 @@ def vendor_bundle?(path)
50
50
real = File . join ( File . realpath ( @base_dir ) , "vendor" )
51
51
return true if path . start_with? ( base )
52
52
return true if path . start_with? ( real )
53
+
53
54
false
54
55
end
55
56
@@ -58,6 +59,7 @@ def vendor_bundle?(path)
58
59
# @return [Array<String>] The paths of the found files
59
60
def cpp_files_in ( some_dir )
60
61
return [ ] unless File . exist? ( some_dir )
62
+
61
63
real = File . realpath ( some_dir )
62
64
files = Find . find ( real ) . reject { |path | File . directory? ( path ) }
63
65
cpp = files . select { |path | CPP_EXTENSIONS . include? ( File . extname ( path ) ) }
@@ -130,6 +132,7 @@ def run_gcc(gcc_binary, *args, **kwargs)
130
132
# @return [String] the version reported by `gcc -v`
131
133
def gcc_version ( gcc_binary )
132
134
return nil unless run_gcc ( gcc_binary , "-v" )
135
+
133
136
@last_err
134
137
end
135
138
@@ -159,6 +162,7 @@ def include_args(aux_libraries)
159
162
# @return [Array<String>] GCC command-line flags
160
163
def feature_args ( ci_gcc_config )
161
164
return [ ] if ci_gcc_config [ :features ] . nil?
165
+
162
166
ci_gcc_config [ :features ] . map { |f | "-f#{ f } " }
163
167
end
164
168
@@ -167,6 +171,7 @@ def feature_args(ci_gcc_config)
167
171
# @return [Array<String>] GCC command-line flags
168
172
def warning_args ( ci_gcc_config )
169
173
return [ ] if ci_gcc_config [ :warnings ] . nil?
174
+
170
175
ci_gcc_config [ :features ] . map { |w | "-W#{ w } " }
171
176
end
172
177
@@ -175,6 +180,7 @@ def warning_args(ci_gcc_config)
175
180
# @return [Array<String>] GCC command-line flags
176
181
def define_args ( ci_gcc_config )
177
182
return [ ] if ci_gcc_config [ :defines ] . nil?
183
+
178
184
ci_gcc_config [ :defines ] . map { |d | "-D#{ d } " }
179
185
end
180
186
@@ -183,6 +189,7 @@ def define_args(ci_gcc_config)
183
189
# @return [Array<String>] GCC command-line flags
184
190
def flag_args ( ci_gcc_config )
185
191
return [ ] if ci_gcc_config [ :flags ] . nil?
192
+
186
193
ci_gcc_config [ :flags ]
187
194
end
188
195
@@ -222,6 +229,7 @@ def build_for_test_with_configuration(test_file, aux_libraries, gcc_binary, ci_g
222
229
[ test_file ] ,
223
230
] . flatten ( 1 )
224
231
return nil unless run_gcc ( gcc_binary , *args )
232
+
225
233
artifacts << executable
226
234
executable
227
235
end
0 commit comments