spec/unit/software_spec.rb in omnibus-8.0.15 vs spec/unit/software_spec.rb in omnibus-8.1.15
- old
+ new
@@ -71,69 +71,69 @@
before { stub_ohai(platform: "ubuntu", version: "16.04") }
it "sets the defaults" do
expect(subject.with_standard_compiler_flags).to eq(
"LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
- "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
+ "CFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
"LD_RUN_PATH" => "/opt/project/embedded/lib",
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
"OMNIBUS_INSTALL_DIR" => "/opt/project"
)
end
it "overrides LDFLAGS" do
expect(subject.with_standard_compiler_flags("LDFLAGS" => "foo")).to eq(
"LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
- "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
+ "CFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
"LD_RUN_PATH" => "/opt/project/embedded/lib",
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
"OMNIBUS_INSTALL_DIR" => "/opt/project"
)
end
it "overrides CFLAGS" do
expect(subject.with_standard_compiler_flags("CFLAGS" => "foo")).to eq(
"LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
- "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
+ "CFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
"LD_RUN_PATH" => "/opt/project/embedded/lib",
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
"OMNIBUS_INSTALL_DIR" => "/opt/project"
)
end
it "overrides CXXFLAGS" do
expect(subject.with_standard_compiler_flags("CXXFLAGS" => "foo")).to eq(
"LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
- "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
+ "CFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
"LD_RUN_PATH" => "/opt/project/embedded/lib",
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
"OMNIBUS_INSTALL_DIR" => "/opt/project"
)
end
it "overrides CPPFLAGS" do
expect(subject.with_standard_compiler_flags("CPPFLAGS" => "foo")).to eq(
"LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
- "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
+ "CFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
"LD_RUN_PATH" => "/opt/project/embedded/lib",
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
"OMNIBUS_INSTALL_DIR" => "/opt/project"
)
end
it "preserves anything else" do
expect(subject.with_standard_compiler_flags("numberwang" => 4)).to eq(
"numberwang" => 4,
"LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
- "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
+ "CFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
"LD_RUN_PATH" => "/opt/project/embedded/lib",
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
"OMNIBUS_INSTALL_DIR" => "/opt/project"
)
end
@@ -189,18 +189,18 @@
end
end
end
context "on mac_os_x" do
- before { stub_ohai(platform: "mac_os_x", version: "10.13") }
+ before { stub_ohai(platform: "mac_os_x", version: "10.15") }
it "sets the defaults" do
expect(subject.with_standard_compiler_flags).to eq(
"LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib",
- "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
+ "CFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
"LD_RUN_PATH" => "/opt/project/embedded/lib",
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
"OMNIBUS_INSTALL_DIR" => "/opt/project"
)
end
@@ -233,12 +233,12 @@
end
it "sets the defaults" do
expect(subject.with_standard_compiler_flags).to eq(
"CC" => "clang",
- "CFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
- "CXXFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
- "CPPFLAGS" => "-I/opt/project/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector",
+ "CFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
+ "CXXFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
+ "CPPFLAGS" => "-I/opt/project/embedded/include -O3 -D_FORTIFY_SOURCE=2 -fstack-protector",
"CXX" => "clang++",
"LDFLAGS" => "-L/opt/project/embedded/lib",
"LD_RUN_PATH" => "/opt/project/embedded/lib",
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig",
"OMNIBUS_INSTALL_DIR" => "/opt/project"