Skip to content

Commit 800c0d4

Browse files
committed
See if this avoids duplicate shared library creation in rspec tests.
1 parent 6a5cd78 commit 800c0d4

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Diff for: spec/cpp_library_spec.rb

+9-5
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,16 @@ def verified_install(backend, path)
271271
end
272272

273273
test_files = Pathname.glob(Pathname.new(cpp_lib_path) + "test" + "*.cpp")
274-
test_files.each do |path|
275-
expected = path.basename.to_s.include?("good")
276-
config.compilers_to_use.each do |compiler|
274+
config.compilers_to_use.each do |compiler|
275+
has_shared_lib = false
276+
test_files.each do |path|
277+
expected = path.basename.to_s.include?("good")
277278
it "tests #{File.basename(path)} with #{compiler} expecting #{expected}" do
278-
exe = @cpp_library.build_shared_library([], compiler, config.gcc_config("uno"))
279-
expect(exe).not_to be nil
279+
unless has_shared_lib
280+
lib = @cpp_library.build_shared_library([], compiler, config.gcc_config("uno"))
281+
expect(lib).not_to be nil
282+
has_shared_lib
283+
end
280284
exe = @cpp_library.build_for_test(path, compiler)
281285
expect(exe).not_to be nil
282286
expect(@cpp_library.run_test_file(exe)).to eq(expected)

0 commit comments

Comments
 (0)