I need to run ceedling and generate JUnit test reports. I have read the documentation on how to do it here: https://github.com/ThrowTheSwitch/Ceedling/tree/v0.31.1/plugins/junit_tests_report. I have added the necessary options in the project.yml
file.
But still it fails. I receive the following issue:
--------------------
OVERALL TEST SUMMARY
--------------------
TESTED: 124
PASSED: 124
FAILED: 0
IGNORED: 0
Exception raised in plugin: junit_tests_report, in method post_build
Traceback (most recent call last):
16: from /usr/lib/ruby/gems/2.7.0/gems/ceedling-0.31.1/lib/ceedling/rakefile.rb:78:in `block in <top (required)>'
15: from /usr/lib/ruby/gems/2.7.0/gems/ceedling-0.31.1/lib/ceedling/plugin_manager.rb:85:in `post_build'
14: from /usr/lib/ruby/gems/2.7.0/gems/ceedling-0.31.1/lib/ceedling/plugin_manager.rb:97:in `execute_plugins'
13: from /usr/lib/ruby/gems/2.7.0/gems/ceedling-0.31.1/lib/ceedling/plugin_manager.rb:97:in `each'
12: from /usr/lib/ruby/gems/2.7.0/gems/ceedling-0.31.1/lib/ceedling/plugin_manager.rb:99:in `block in execute_plugins'
11: from /usr/lib/ruby/gems/2.7.0/gems/ceedling-0.31.1/plugins/junit_tests_report/lib/junit_tests_report.rb:23:in `post_build'
10: from /usr/lib/ruby/gems/2.7.0/gems/ceedling-0.31.1/plugins/junit_tests_report/lib/junit_tests_report.rb:23:in `each_key'
9: from /usr/lib/ruby/gems/2.7.0/gems/ceedling-0.31.1/plugins/junit_tests_report/lib/junit_tests_report.rb:30:in `block in post_build'
8: from /usr/lib/ruby/gems/2.7.0/gems/ceedling-0.31.1/lib/ceedling/file_wrapper.rb:52:in `open'
7: from /usr/lib/ruby/gems/2.7.0/gems/ceedling-0.31.1/lib/ceedling/file_wrapper.rb:52:in `open'
6: from /usr/lib/ruby/gems/2.7.0/gems/ceedling-0.31.1/lib/ceedling/file_wrapper.rb:53:in `block in open'
5: from /usr/lib/ruby/gems/2.7.0/gems/ceedling-0.31.1/plugins/junit_tests_report/lib/junit_tests_report.rb:33:in `block (2 levels) in post_build'
4: from /usr/lib/ruby/gems/2.7.0/gems/ceedling-0.31.1/plugins/junit_tests_report/lib/junit_tests_report.rb:57:in `reorganise_results'
3: from /usr/lib/ruby/gems/2.7.0/gems/ceedling-0.31.1/plugins/junit_tests_report/lib/junit_tests_report.rb:57:in `each'
2: from /usr/lib/ruby/gems/2.7.0/gems/ceedling-0.31.1/plugins/junit_tests_report/lib/junit_tests_report.rb:60:in `block in reorganise_results'
1: from /usr/lib/ruby/gems/2.7.0/gems/ceedling-0.31.1/plugins/junit_tests_report/lib/junit_tests_report.rb:60:in `map'
/usr/lib/ruby/gems/2.7.0/gems/ceedling-0.31.1/plugins/junit_tests_report/lib/junit_tests_report.rb:60:in `block (2 levels) in reorganise_results': undefined method `merge' for nil:NilClass (NoMethodError)
I have been using:
- ceedling 0.31.1,
- ruby 2.7.7p221 (2022-11-24 revision 168ec2b1e5)
I run ceedling test:all gcov:all utils:gcov
but in the end this error occurs.
This is the project.yml
file
# Main ceedling project file
:project:
:use_exceptions: FALSE
:use_test_preprocessor: TRUE
:use_auxiliary_dependencies: TRUE
:build_root: .build/ceedling
:test_file_prefix: test_
:default_tasks:
- test:all
:options_paths:
- ./test/unit_tests/options/
:environment:
:extension:
:executable: .out
:paths:
:test:
- +:test/unit_tests/**
:source:
- src/**
# - ./.build/
# - /usr/include/glib-2.0/**
# - /usr/lib/glib-2.0/include/**
# - /usr/include/gio-unix-2.0/**
:include: # Any header files not already in the source search path.
- ./include/**
- /usr/include/
- /usr/include/glib-2.0/**
- /usr/lib/glib-2.0/include/**
- /usr/include/gio-unix-2.0/**
- ./.build/
- ./.build/introspection/**
- ./subprojects/**
:cmock:
:mock_prefix: mock_
:when_no_prototypes: :warn
:enforce_strict_ordering: TRUE
:plugins:
- :ignore_arg
- :return_thru_ptr
- :ignore
- :callback
- :expect_any_args
:defines:
- __G_LIB_H__
- __G_IO_H__
- __G_STDIO_H__
- __GLIB_GOBJECT_H__
:treat_as:
uint8: HEX8
uint16: HEX16
uint32: UINT32
int8: INT8
bool: UINT8
:unity_helper:
- ./test/unit_tests/ceedling_mock_helper.h
# LIBRARIES
# These libraries are automatically injected into the build process. Those specified as
# common will be used in all types of builds. Otherwise, libraries can be injected in just
# tests or releases. These options are MERGED with the options in supplemental yaml files.
:libraries:
:placement: :end
:flag: "-l${1}" # or "-L ${1}" for example
:common: &common_libraries []
:test:
- *common_libraries
- glib-2.0
- gio-2.0
:release:
- *common_libraries
:plugins:
:load_paths:
:enabled:
- colour_report
- gcov
- stdout_pretty_tests_report
- module_generator
- raw_output_report
- junit_tests_report
:junit_tests_report:
:artifact_filename: report.junit.xml
:gcov:
:utilities:
- gcovr # Use gcovr to create the specified reports (default).
:gcovr:
:html_medium_threshold: 75
:html_high_threshold: 90
:exclude_unreachable_branches: true
:report_include: "^src/"
:report_exclude: "^.build/"
:reports:
- HtmlDetailed
- JSON