Open Shayamir opened 2 years ago
You should be able to see the output of the ceedling command in the OUTPUT
panel by clicking on the test. Can you share this message?
The report.xml seems legit to me, no error in it, only one failure.
It looks like this: stdout:
Running test_bar.out...
[test_bar.c]
[test_bar.c] Test: test_cs_access_write_lan_bar0_msb At line (176): "Expected 1 Was 0"
TESTED: 5 PASSED: 4 FAILED: 1 IGNORED: 0
BTW, I've made 1 test fail, to check the different status icons. BTW2, I was sure that the results are being parsed back from XML report and that the OUPUT is not so relevant... Probably I was mistaken.
Any idea how I can debug? Can you help?
I've debugged the issue. My project.yml (relevant sections) looks like this:
:project:
:build_root: "#{ENV['BUILD_ROOT']}"
:test_file_prefix: test_
:default_tasks:
- test:all
:environment:
- REPO_ROOT: "#{ENV.fetch('REPO_ROOT', ENV['PWD'])}"
- BUILD_ROOT: "#{ENV.fetch('BUILD_ROOT', ENV['PWD'] + '/build/unittest_ceedling/debug')}"
:paths:
:test:
- "#{ENV['REPO_ROOT']}/controller/**/test"
:source:
- "#{ENV['REPO_ROOT']}/controller/**"
When the extension runs, in file: adapter.ts, function: getXmlReportPath, I see this path: 'C:\prj\mmg\#{ENV['BUILD_ROOT']}\artifacts\test\report.xml'
It seems like Environment variable is not being expanded.
any idea how to proceed?
Narrowed it down to this line: const ymlProjectBuildDirectory = ymlProjectData[':project'][':build_root']; returns: ymlProjectBuildDirectory = '#{ENV['BUILD_ROOT']}'
Sorry for the late reply and thank you for taking the time to debug the issue. Do you use ruby code elsewhere in the project.yml? Do you really need those environment variables?
How I would implement it:
environment
section of the project.ymlceedling paths:*
to get all the paths searched by ceedling:source
and :test
3rd Option I'd write a routine in typescript files to read from .yml and if It finds '#{ENV[' string, it'll replace it with the corresponding environment variable.
4th Option Don't fix this, and document which variables on project.yml cannot use environment variables.
Since Ceedling .yml files support environment variables, other people might encounter this problem.
Right now, for me, I've decided to not use the environment variable in :project:build_root: And the extension is working fine. BTW, thank you very much for a great extension.
Great! I will let it as it is for now and keep the issue open.
Got the same problem here:
ceedling versions(on Windows 10)
❯ ceedling version
Ceedling:: 0.32.0
Unity:: 2.5.4
CMock:: 2.5.4
CException:: 1.3.3
Project
---
:project:
# how to use ceedling. If you're not sure, leave this as `gem` and `?`
:which_ceedling: gem
:ceedling_version: 0.32.0
# optional features. If you don't need them, keep them turned off for performance
:use_mocks: TRUE
:use_test_preprocessor: TRUE
:use_preprocessor_directives: FALSE
:use_deep_dependencies: FALSE
:use_auxiliary_dependencies: TRUE
:use_backtrace_gdb_reporter: FALSE
# tweak the way ceedling handles automatic tasks
:build_root: build
:test_file_prefix: test_
:default_tasks:
- test:all
# performance options. If your tools start giving mysterious errors, consider
# dropping this to 1 to force single-tasking
:test_threads: 8
:compile_threads: 8
# you can specify different yaml config files which modify the existing one
:options_paths: []
# enable release build (more details in release_build section below)
:release_build: FALSE
# specify additional yaml files to automatically load. This is helpful if you
# want to create project files which specify your tools, and then include those
# shared tool files into each project-specific project.yml file.
:import: []
# further details to configure the way Ceedling handles test code
:test_build:
:use_assembly: FALSE
:toolchain_include: []
# further details to configure the way Ceedling handles release code
:release_build:
:output: MyApp.out
:use_assembly: FALSE
:artifacts: []
:toolchain_include: []
# Plugins are optional Ceedling features which can be enabled. Ceedling supports
# a variety of plugins which may effect the way things are compiled, reported,
# or may provide new command options. Refer to the readme in each plugin for
# details on how to use it.
:plugins:
:load_paths: []
:enabled:
- module_generator # handy for quickly creating source, header, and test templates
- stdout_pretty_tests_report
- xml_tests_report
# override the default extensions for your system and toolchain
:extension:
:executable: .out
# This is where Ceedling should look for your source and test files.
# see documentation for the many options for specifying this.
:paths:
:test:
- +:test/**
- -:test/support
:source:
- src/**
:support:
- test/support
:libraries: []
# Configuration Options specific to CMock. See CMock docs for details
:cmock:
:mock_prefix: mock_
:when_no_prototypes: :warn
:enforce_strict_ordering: TRUE
:plugins:
- :ignore
- :ignore_arg
- :expect_any_args
- :array
- :callback
- :return_thru_ptr
:treat_as:
uint8: HEX8
uint16: HEX16
uint32: UINT32
int8: INT8
bool: UINT8
# Configuration options specific to Unity.
:unity:
:defines:
- UNITY_EXCLUDE_FLOAT
# You can optionally have ceedling create environment variables for you before
# performing the rest of its tasks.
:environment: []
with all tests passed, still get a red bang symbol:
I've configured Ceedling to run using the plugin. I've also added xml_tests_report to my project.yml. For some reason, after running tests, I get a "red bang" icon, instead of a test status.
My Ceedling version: $ ceedling version Ceedling:: 0.31.1 Unity:: 2.5.4 CMock:: 2.5.4 CException:: 1.3.3 report.xml.txt
Any ideas how I can debug this further?