From c77828b65b2ddffe0a8e626401f1dcecc2485dfa Mon Sep 17 00:00:00 2001 From: Mark VanderVoord Date: Fri, 18 Jun 2021 15:22:25 -0400 Subject: [PATCH] Be a bit more flexible with which gcovr version we're testing. Be stricter about when to use the newer version (as it will fall back to the older version in some cases) --- plugins/gcov/lib/gcovr_reportinator.rb | 2 +- spec/gcov/gcov_deployment_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/gcov/lib/gcovr_reportinator.rb b/plugins/gcov/lib/gcovr_reportinator.rb index fd61a8ba..5317c5d2 100644 --- a/plugins/gcov/lib/gcovr_reportinator.rb +++ b/plugins/gcov/lib/gcovr_reportinator.rb @@ -16,7 +16,7 @@ def make_reports(opts) # Build the common gcovr arguments. args_common = args_builder_common(opts) - if (gcovr_version_info[0] >= 4) && (gcovr_version_info[1] >= 2) + if ((gcovr_version_info[0] == 4) && (gcovr_version_info[1] >= 2)) || (gcovr_version_info[0] > 4) # gcovr version 4.2 and later supports generating multiple reports with a single call. args = args_common args += args_builder_cobertura(opts, false) diff --git a/spec/gcov/gcov_deployment_spec.rb b/spec/gcov/gcov_deployment_spec.rb index edf71af2..44cecda2 100644 --- a/spec/gcov/gcov_deployment_spec.rb +++ b/spec/gcov/gcov_deployment_spec.rb @@ -61,7 +61,7 @@ @output = `bundle exec ruby -S ceedling utils:gcov` expect(@output).to match(/For now, creating only an HtmlBasic report\./) - expect(@output).to match(/Creating gcov results report\(s\) in 'build\/artifacts\/gcov'\.\.\. Done/) + expect(@output).to match(/Creating (?:a )?gcov (?:results)?(?:HTML)? report(?:\(s\))? in 'build\/artifacts\/gcov'\.\.\. Done/) expect(File.exists?('build/artifacts/gcov/GcovCoverageResults.html')).to eq true end