File tree 3 files changed +28
-1
lines changed
3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
20
20
### Fixed
21
21
- A missing ` examples ` directory no longer causes a crash in ` cpp_library.rb `
22
22
- Referring to an undefined platform no longer causes a crash; it's now a helpful error message
23
+ - A copy/paste error that prevented compiler warning flags from being supplied has been fixed, via jgfoster
23
24
24
25
### Security
25
26
Original file line number Diff line number Diff line change @@ -446,7 +446,7 @@ def feature_args(ci_gcc_config)
446
446
def warning_args ( ci_gcc_config )
447
447
return [ ] if ci_gcc_config [ :warnings ] . nil?
448
448
449
- ci_gcc_config [ :features ] . map { |w | "-W#{ w } " }
449
+ ci_gcc_config [ :warnings ] . map { |w | "-W#{ w } " }
450
450
end
451
451
452
452
# GCC command line arguments for defines (e.g. -Dhave_something)
Original file line number Diff line number Diff line change @@ -76,6 +76,32 @@ def verified_install(backend, path)
76
76
RSpec . describe ArduinoCI ::CppLibrary do
77
77
next if skip_ruby_tests
78
78
79
+ context "compiler flags" do
80
+ config = ArduinoCI ::CIConfig . new
81
+ config . load_yaml ( File . join ( File . dirname ( __FILE__ ) , "yaml" , "o1.yaml" ) )
82
+ bogo_config = config . gcc_config ( "bogo" )
83
+ fld = FakeLibDir . new
84
+ backend = fld . backend
85
+ cpp_lib_path = sampleproj_path + "DoSomething"
86
+ cpp_library = verified_install ( backend , cpp_lib_path )
87
+
88
+ # the keys are the methods of cpp_library to call
89
+ # the results are what we expect to see based on the config we loaded
90
+ methods_and_results = {
91
+ feature_args : [ "-fa" , "-fb" ] ,
92
+ warning_args : [ "-We" , "-Wf" ] ,
93
+ define_args : [ "-Dc" , "-Dd" ] ,
94
+ flag_args : [ "g" , "h" ]
95
+ }
96
+
97
+ methods_and_results . each do |m , expected |
98
+ it "Creates #{ m } from config" do
99
+ expect ( expected ) . to eq ( cpp_library . send ( m , bogo_config ) )
100
+ end
101
+ end
102
+
103
+ end
104
+
79
105
context "arduino-library-specification detection" do
80
106
81
107
answers = {
You can’t perform that action at this time.
0 commit comments