Closed tyler-macinnis closed 1 year ago
Hi @tyler-macinnis!
Sure, I can add a sample project, but in the meantime, can you try specifying the full bath to the mdb executable in your project.yml
file? e.g.:
:tools:
:mdb:
:executable: "path/to/mdb.bat"
Let me know if that works.
P.S: I haven't tested the plugin on windows, so probably it needs more work. Sorry for the inconvenience.
Since I have mdb on my path, I am able to run it with
:mdb:
:executable: mdb.bat
however, it seems to run into an infinite loop after that.
Probably it is running without arguments, try this:
:mdb:
:executable: mdb.bat
:arguments:
- ${1}
Ah now we're getting somewhere, I'm getting this error now:
Running test_device_config.elf...
ERROR: Test executable "test_device_config.elf" failed.
> Produced no final test result counts in $stdout:
May 10, 2023 4:51:39 PM org.jline.utils.Log logr
WARNING: Unable to create a system terminal, creating a dumb terminal (enable debug logging for more information)
device PIC18F45K80
set uart1io.uartioenabled true
set uart1io.output window
hwtool sim
I am using xc8 instead of xc16 and am attempting to use xc8-cc for compiling, linking, and preprocessing.
P.S. I probably won't be able to look into it further until tomorrow.
I will try to setup a windows machine to test. Also, it would be helpful if you can share with me your project.yml
or at least the tools section where you are setting up the XC8 compiler.
P.S.: I think that for XC8 there is an extra step that needs to be done in order for the simulated UART to work, that is done automatically for XC16 and XC32 compilers. I will try to set up a project with an 8-bit device to figure out if there is something extra to be done.
Sure! I can do that for you.
---
# Notes:
# Sample project C code is not presently written to produce a release artifact.
# As such, release build options are disabled.
# This sample, therefore, only demonstrates running a collection of unit tests.
:project:
:use_exceptions: FALSE
:use_test_preprocessor: FALSE
:use_auxiliary_dependencies: TRUE
:use_mocks: FALSE #False, mocks generated by cmock might be too resource intensive for unit tests
:build_root: build
# :release_build: TRUE
:test_file_prefix: test_
:which_ceedling: gem
:ceedling_version: 0.31.1
:default_tasks:
- test:all
#:test_build:
# :use_assembly: TRUE
#:release_build:
# :output: MyApp.out
# :use_assembly: FALSE
:mdb:
:device: PIC18F45K80
:environment:
- :mcu: PIC18F45K80
- :optimization: O0
- :standard: c99
- :path:
- "C:/Program Files/Microchip/xc8/v2.40/bin"
- "C:/Program Files/Microchip/MPLABX/v5.50/mplab_platform/bin" # path to the mdb executable
- "C:/Program Files/Microchip/MPLABX/v5.50/mplab_platform/mplab_ipe" # path to the ipecmd executable.
- build
- "#{ENV['PATH']}"
:extension:
:object: .p1
:executable: .elf
:assembly: .S
:paths:
:test:
- +:test/**
- -:test/support
:source:
- ../src
:include:
- "C:/Program Files/Microchip/xc8/v2.40/pic/include" #THIS IS FOR WINDOWS
:support:
- test/support
:libraries: []
:defines:
# in order to add common defines:
# 1) remove the trailing [] from the :common: section
# 2) add entries to the :common: section (e.g. :test: has TEST defined)
:common: &common_defines []
:test:
- *common_defines
- TEST
:test_preprocess:
- *common_defines
- TEST
:cmock:
:mock_prefix: mock_
:when_no_prototypes: :warn
:treat_externs: :include
:enforce_strict_ordering: TRUE
:plugins:
- :ignore
- :callback
- :expect_any_args
:treat_as:
uint8: HEX8
uint16: HEX16
uint32: UINT32
int8: INT8
bool: UINT8
# Add -gcov to the plugins list to make sure of the gcov plugin
# You will need to have gcov and gcovr both installed to make it work.
# For more information on these options, see docs in plugins/gcov
:gcov:
:utilities:
- gcovr
:reports:
- HtmlDetailed
- Cobertura
- JSON
:gcovr:
:report_root: "../"
:report_exclude: "^build.*|^test.*"
:json_pretty: true
:html_medium_threshold: 75
:html_high_threshold: 90
#:tools:
# Ceedling defaults to using gcc for compiling, linking, etc.
# As [:tools] is blank, gcc will be used (so long as it's in your system path)
# See documentation to configure a given toolchain for use
# THIS IS CURRENTLY COMMENTED OUT BECAUSE TESTING WITH THE MDB PLUGIN IS STILL A WORK IN PROGRESS
:tools:
:test_compiler:
:name: "Microchip XC8 Compiler"
:executable: xc8-cc
:arguments:
- -mcpu=#{ENV['MCU']}
- -std=#{ENV['STANDARD']}
- -#{ENV['OPTIMIZATION']}
- -Wa,-a
- -D"$": COLLECTION_DEFINES_TEST_AND_VENDOR
- -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR
- -o "${2}"
- -c "${1}"
:test_file_preprocessor:
:name: "Microchip XC8 preprocessor"
:executable: xc8-cc
:arguments:
- -mcpu=#{ENV['MCU']}
- -std=#{ENV['STANDARD']}
- -D"$": COLLECTION_DEFINES_TEST_AND_VENDOR
- -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR
- "${1}"
:test_includes_preprocessor:
:name: "Microchip XC8 includes preprocessor"
:executable: xc8-cc
:arguments:
- -mcpu=#{ENV['MCU']}
- -std=#{ENV['STANDARD']}
- -D"$": COLLECTION_DEFINES_TEST_AND_VENDOR
- -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR
- "${1}"
:test_linker:
:name: "Microchip XC8 Linker"
:executable: xc8-cc
:arguments:
- -mcpu=#{ENV['MCU']}
- -#{ENV['OPTIMIZATION']}
- -gdwarf-3
- -D"$": COLLECTION_DEFINES_TEST_AND_VENDOR
- -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR
- -Wl,-Map="${3}"
- -o"./build/test/out/test_build.elf"
- "{'${1}'.split(' ').map { |x| (x.include? '/out/c/') ? (Pathname(x).sub_ext('.p1')).to_s : x }.join(' ') }"
- "${4}"
:mdb:
:executable: mdb.bat
:arguments:
- ${1}
# 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}"
:path_flag: "-L ${1}"
:system: [] # for example, you might list 'm' to grab the math library
:test: []
:release: []
:plugins:
:display_raw_test_results: true
:load_paths:
- "#{Ceedling.load_path}"
- plugins
:enabled:
- stdout_pretty_tests_report
- module_generator
- raw_output_report
- json_tests_report
- warnings_report
- gcov
- mdb
...
@deltalejo OH I almost forgot in case you find it helpful. Someone took the old Ceedling Microchip Example and has begun to modernize it. Just thought I'd put it https://github.com/pajacobson/CeedlingExample_Microchip
I also attempted to use the plugin with an older working xc8 project I have and the plugin doesn't seem to work for it either at first; however, it's first error was due to the path name having spaces in it. Once I resolved that, it reached the same point as the newer project
Linking test_atod.elf...
Creating build/mdb/test_atod_cmd.txt...
Running test_atod.elf...
May 11, 2023 7:32:15 AM org.jline.utils.Log logr
WARNING: Unable to create a system terminal, creating a dumb terminal (enable debug logging for more information)
ERROR: Test executable "test_atod.elf" failed.
> Produced no final test result counts in $stdout:
device PIC16F1825
set uart1io.uartioenabled true
set uart1io.output window
hwtool sim
Resetting SFRs
Resetting peripherals
program build/test/out/test_atod.elf
Programming target...
Program failed.
Thanks! But I see it is using XC16, I'm currently developing a private project with XC16 with this plugin and it works well, I think the difficulty is with XC8, because there are some manual steps that need to be done to get the UART output redirected to stdout, with XC16 and XC32 it is done automatically.
After reading some documentation, I was able to sketch the approach that should be taken as follows:
test/support
path in your project:test/support/unity_config.h
#ifndef UNITY_CONFIG_H
#define UNITY_CONFIG_H
#include "uart.h"
#define UNITY_OUTPUT_START() uart_start()
#define UNITY_OUTPUT_CHAR(c) uart_putchar(c)
#define UNITY_OUTPUT_COMPLETE() uart_end()
#endif /* UNITY_CONFIG_H */
test/support/uart.h
#ifndef UART_H
#define UART_H
void uart_start(void);
void uart_end(void);
int uart_putchar(int c);
#endif /* UART_H */
test/support/uart.c
#include <xc.h>
#include "uart.h"
void uart_start(void)
{
// Init UART
}
void uart_end(void)
{
// Wait for last TX to complete
// De-init UART
}
int uart_putchar(int c)
{
// Wait for last TX to complete
// Write next character to TX data register
return c;
}
project.yml
::paths:
:support:
- test/support
:files:
:support:
- uart.c
:unity:
:defines:
- UNITY_INCLUDE_CONFIG_H
It is a good start, just need to complete the functions inside uart.c
according to your device. I wasn't been able to test that yet because for reasons still unknown for me, the .elf
built with my setup is failing to load on mdb, even a simple main()
, but you can give it I try, chances are that you succeed given that you already manage to build a .elf
that actually loads on mdb.
Oh, I see!
You are facing the same problem, and I think it is beyond the plugin itself, but has something to do with the toolchain setup, I guess, it is building a .elf
file that refuses to load on mdb. I'm investigating more about that.
By the way, if you build the .elf
with that old project but without using the plugin and manually run it with mdb, it actually runs?
I applied the changes you put, but haven't tried them yet (need to complete uart.c
), but yes I have an older working project that I can run with xc8 without using the plugin. I can share some of it's simulation files, support files, and information in case they help. It was one of my first projects using ceedling.
OLD working xc8 project without plugin
project.yml
---
# Notes:
# Sample project C code is not presently written to produce a release artifact.
# As such, release build options are disabled.
# This sample, therefore, only demonstrates running a collection of unit tests.
:project:
:use_exceptions: FALSE
:use_test_preprocessor: FALSE
:use_auxiliary_dependencies: TRUE
:use_mocks: FALSE
:build_root: build
#:release_build: TRUE
:test_file_prefix: test_
:which_ceedling: gem
:ceedling_version: 0.31.1
:default_tasks:
- test:all
#:test_build:
# :use_assembly: TRUE
#:release_build:
# :output: MyApp.out
# :use_assembly: FALSE
:environment:
- :mcu: PIC16F1825
- :optimization: Os
- :standard: c90
- :path:
- "C:/Program Files/Microchip/xc8/v2.40/bin"
- "C:/Program Files/Microchip/MPLABX/v5.50/mplab_platform/bin" # path to the mdb executable
- "C:/Program Files/Microchip/MPLABX/v5.50/mplab_platform/mplab_ipe" # path to the ipecmd executable.
- build
- "#{ENV['PATH']}"
:extension:
:object: .p1
:executable: .elf
:assembly: .S
:paths:
:test:
- +:test/**
- -:test/support
:source:
- ../src
:include:
- "C:/Program Files/Microchip/xc8/v2.40/pic/include"
:support:
- test/support
:libraries: []
:defines:
# in order to add common defines:
# 1) remove the trailing [] from the :common: section
# 2) add entries to the :common: section (e.g. :test: has TEST defined)
:common: &common_defines []
# - UNITY_INT_WIDTH=16
# - CMOCK_MEM_INDEX_TYPE=uint16_t
# - CMOCK_MEM_PTR_AS_INT=uint16_t
# - CMOCK_MEM_ALIGN=1
# - CMOCK_MEM_SIZE=256
:test:
- *common_defines
- TEST
:test_preprocess:
- *common_defines
- TEST
:unity:
:defines:
- UNITY_INCLUDE_CONFIG_H
- UNITY_EXCLUDE_SETJMP_H
- UNITY_EXCLUDE_MATH_H
- UNITY_EXCLUDE_FLOAT
:cmock:
:mock_prefix: mock_
:when_no_prototypes: :warn
:treat_externs: :include
:enforce_strict_ordering: TRUE
:fail_on_unexpected_calls: FALSE
:exclude_setjmp_h: TRUE
:plugins:
- :ignore
- :ignore_arg
- :callback
- :expect_any_args
:treat_as:
uint8: HEX8
uint16: HEX16
uint32: UINT32
int8: INT8
bool: UINT8
# Add -gcov to the plugins list to make sure of the gcov plugin
# You will need to have gcov and gcovr both installed to make it work.
# For more information on these options, see docs in plugins/gcov
:gcov:
:reports:
- HtmlDetailed
:gcovr:
:html_medium_threshold: 75
:html_high_threshold: 90
#:tools:
# Ceedling defaults to using gcc for compiling, linking, etc.
# As [:tools] is blank, gcc will be used (so long as it's in your system path)
# See documentation to configure a given toolchain for use
:tools:
:test_compiler:
:name: "Microchip XC8 Compiler"
:executable: xc8-cc
:arguments:
- -mcpu=#{ENV['MCU']}
- -std=#{ENV['STANDARD']}
- -#{ENV['OPTIMIZATION']}
- -Wa,-a
- -D"$": COLLECTION_DEFINES_TEST_AND_VENDOR
- -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR
- -Iinclude/
- -o "${2}"
- -c "${1}"
:test_file_preprocessor:
:name: "Microchip XC8 preprocessor"
:executable: xc8-cc
:arguments:
- -mcpu=#{ENV['MCU']}
- -std=#{ENV['STANDARD']}
- -D"$": COLLECTION_DEFINES_TEST_AND_VENDOR
- -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR
- "${1}"
:test_includes_preprocessor:
:name: "Microchip XC8 includes preprocessor"
:executable: xc8-cc
:arguments:
- -mcpu=#{ENV['MCU']}
- -std=#{ENV['STANDARD']}
- -D"$": COLLECTION_DEFINES_TEST_AND_VENDOR
- -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR
- "${1}"
:test_linker:
:name: "Microchip XC8 Linker"
:executable: xc8-cc
:arguments:
- -mcpu=#{ENV['MCU']}
- -#{ENV['OPTIMIZATION']}
- -gdwarf-3
- -D"$": COLLECTION_DEFINES_TEST_AND_VENDOR
- -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR
- -Wl,-Map="${3}"
- -o"./build/test/out/test_build.elf"
- "{'${1}'.split(' ').map { |x| (x.include? '/out/c/') ? (Pathname(x).sub_ext('.p1')).to_s : x }.join(' ') }"
- "${4}"
:test_fixture:
:executable: ruby
:name: "Microchip simulator test fixture"
:stderr_redirect: :auto #inform Ceedling what model of $stderr capture to use
:arguments:
- test/simulation/sim_test_fixture.rb
:release_compiler:
:name: "Microchip XC8 Compiler"
:executable: xc8-cc
:arguments:
- "-mcpu=#{ENV['MCU']}"
- -std=#{ENV['STANDARD']}
- -#{ENV['OPTIMIZATION']}
- -Wa,-a
- -D"$": COLLECTION_DEFINES_RELEASE_AND_VENDOR
- -I"$": COLLECTION_PATHS_SOURCE_AND_INCLUDE
- -Iinclude/
- -o "${2}"
- -c "${1}"
:release_assembler:
:name: "Microchip XC8 Compiler"
:executable: xc8-cc
:arguments:
- "-mcpu=#{ENV['MCU']}"
- -std=#{ENV['STANDARD']}
- -#{ENV['OPTIMIZATION']}
- -Wa,-a
- -D"$": COLLECTION_DEFINES_RELEASE_AND_VENDOR
- -I"$": COLLECTION_PATHS_SOURCE_AND_INCLUDE
- -o "${2}"
- -c "${1}"
:release_linker:
:name: "Microchip XC8 Linker"
:executable: xc8-cc
:arguments:
- "-mcpu=#{ENV['MCU']}"
- -gdwarf-3
- -D"$": COLLECTION_DEFINES_RELEASE_AND_VENDOR
- -I"$": COLLECTION_PATHS_SOURCE_AND_INCLUDE
- -Wl,-Map="${3}"
- -o "${2}"
- "{'${1}'.split(' ').map { |x| (x.include? '/out/c/') ? (Pathname(x).sub_ext('.p1')).to_s : x }.join(' ') }"
- "${4}"
# 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}"
:path_flag: "-L ${1}"
:system: [] # for example, you might list 'm' to grab the math library
:test: []
:release: []
:plugins:
:display_raw_test_results: true
:load_paths:
- "#{Ceedling.load_path}"
:enabled:
- stdout_pretty_tests_report
- module_generator
- raw_output_report
- warnings_report
- xml_tests_report
- json_tests_report
...
support/unity_config.h
#ifndef UNITY_CONFIG_H
#define UNITY_CONFIG_H
#include "unity.h"
void UnityHelperDeadLoop(void);
#define UNITY_OUTPUT_COMPLETE() UnityHelperDeadLoop()
#endif //UNITY_CONFIG_H
support/support_uart.h
#ifndef _SUPPORT_UART_H
#define _SUPPORT_UART_H
void putch(char data);
void support_init_uart(void);
#endif
support/support_uart.c
#include <xc.h>
#include <stdbool.h>
#include "support_uart.h"
// disable watchdog
//#pragma config WDTE = OFF
#define TRUE 1
#define FALSE 0
void putch(char data){
support_init_uart();
TXREG = data;
PIR1bits.TXIF = 0;
}
void UnityHelperDeadLoop(void){
while(1) {};
}
void support_init_uart(void){
static bool uart_was_init = false;
if( !uart_was_init){
SPBRG = 0x19; // 9600 baud @ 4 MHz
TXEN = 1; // enable transmitter
BRGH = 1; // select high baud rate
SPEN = 1; // enable serial port
CREN = 1; // enable continuous operation
uart_was_init = true;
}
}
simulation/sim_test_fixture.rb
require 'rbconfig'
OUT_FILE = "test/simulation/out.txt"
File.delete OUT_FILE if File.exists? OUT_FILE
response = `mdb ./test/simulation/sim_instructions.txt > ./test/simulation/simlog.txt`
if File.exists? OUT_FILE
file_contents = File.read OUT_FILE
file_contents.gsub!("\r\n", "\n")
STDOUT.print file_contents
end
simulation/sim_instructions.txt
device PIC16F1825
set oscillator.frequency 32
set oscillator.frequencyunit Mega
set oscillator.rcfrequency 31
set oscillator.rcfrequencyunit Kilo
set uart1io.uartioenabled true
set uart1io.output file
set uart1io.outputfile test/simulation/out.txt
set system.disableerrormsg true
set breakoptions.wdtwarnings Ignore
hwtool sim -P
program build/test/out/test_build.elf
break UnityHelperDeadLoop
run
wait
quit
Each of the test files have the following header
#include "unity.h"
//Further headers here
#include "support/support_uart.h"
#include <xc.h>
I had to use the following in the header of the file containing main
#ifdef TEST
void test_main(void);
#endif
and in the source file
#ifdef TEST
void test_main(void)
#else
void main(void)
#endif
{
//Main loop
}
I notice that the old project uses a different device, so as a quick test, I tried to use that device (PIC16F1825) with the new project and the plugin instead of the PIC18F45K80, and then the .elf
loaded successfully on mdb. I actually not collect the tests results because I need to setup the infinite loop and the breakpoint so the simulation does not run indefinitely (I haven't needed to setup that with XC16), but it is definitely something that the plugin should take care of or at least provide means to setup that.
At this point, I will say that there is something missing or misconfigured with the toolchain to work with PIC18 devices because it is building and executable file that can not be loaded with mdb. I will investigate more about that and let you know if I find a solution, also if you manage to solve that, it would be nice if you share that.
So, just to clarify in summary for now:
I have not been able to run the PIC18 device with mdb yet. I found this plugin because I was unable to get the implementation I used for the PIC16 to work with the PIC18 and wondered if this plugin would be able to work. If I do find anything I will let you know.
As a note, these are the things that I can think of that need to be solved before the plugin can be used with PIC18 devices (and probably other low/mid-range devices, more testing must be done):
.elf
with Ceedling and XC8 toolchain that can be run manually with mdb. Plugin has nothing to do with this.Good news!
I manage to get the tests running for the PIC18 device. It is needed to add the config setting #pragma config XINST = OFF
to the source file. It is because XC8 does not support extended instruction set for PIC18 devices as stated in Section 5.2.2 of the XC8 C Compiler User’s Guide for PIC MCU.
Also, I've updated the plugin to support adding breakpoints.
Here what I did:
test/support/unity_config.h
#ifndef UNITY_CONFIG_H
#define UNITY_CONFIG_H
#include "uart.h"
#define UNITY_OUTPUT_START() uart_start()
#define UNITY_OUTPUT_CHAR(c) uart_putchar(c)
#define UNITY_OUTPUT_COMPLETE() uart_end()
#endif /* UNITY_CONFIG_H */
test/support/uart.h
#ifndef UART_H
#define UART_H
void uart_start(void);
void uart_end(void);
int uart_putchar(int c);
#endif /* UART_H */
test/support/uart.c
#include <xc.h>
#include "uart.h"
#pragma config XINST = OFF
#define POLL_TX_COMPLETE() do { NOP(); } while (!TXSTA1bits.TRMT)
static void uart_output_complete()
{
NOP();
}
void uart_start(void)
{
TXSTA1bits.TXEN = 1;
RCSTA1bits.SPEN = 1;
}
void uart_end(void)
{
POLL_TX_COMPLETE();
RCSTA1bits.SPEN = 0;
TXSTA1bits.TXEN = 0;
uart_output_complete();
}
int uart_putchar(int c)
{
POLL_TX_COMPLETE();
TXREG1 = c;
return c;
}
project.yml
::paths:
:support:
- test/support
:files:
:support:
- uart.c
:unity:
:defines:
- UNITY_INCLUDE_CONFIG_H
:mdb:
:device: PIC18F45K80
:breakpoints:
- uart_output_complete
Let me know if that works for you so I can document better the process on the plugin README.
I was still getting an error after those changes, but it was something actually on my end (a small mistake in the tools). It now works for a PIC18. Still have yet to see if it works for PIC16, but my primary goal was to get it working for this device. Here are the contents of the significant portions of my project.yml
now if it helps for documentation.
:project:
:use_exceptions: FALSE
:use_test_preprocessor: FALSE
:use_auxiliary_dependencies: TRUE
:use_mocks: FALSE #Mocks generated by cmock might be too resource intensive low-level devices
:build_root: build
# :release_build: TRUE
:test_file_prefix: test_
:which_ceedling: gem
:ceedling_version: 0.31.1
:default_tasks:
- test:all
:mdb:
:device: PIC18F45K80
:breakpoints:
- uart_output_complete
:environment:
- :mcu: PIC18F45K80
- :optimization: O0
- :standard: c99
- :path:
- "C:/Program Files/Microchip/xc8/v2.40/bin" # path to the xc8 compiler
- "C:/Program Files/Microchip/MPLABX/v5.50/mplab_platform/bin" # path to the mdb executable
- "C:/Program Files/Microchip/MPLABX/v5.50/mplab_platform/mplab_ipe" # path to the ipecmd executable.
- build
- "#{ENV['PATH']}"
:extension:
:object: .p1
:executable: .elf
:assembly: .S
:paths:
:test:
- +:test/**
- -:test/support
:source:
- ../src
:include:
- "C:/Program Files/Microchip/xc8/v2.40/pic/include" #THIS IS FOR WINDOWS
:support:
- test/support
:libraries: []
:files:
:support:
- uart.c
:unity:
:defines:
- UNITY_INCLUDE_CONFIG_H
:tools:
:test_compiler:
:name: "Microchip XC8 Compiler"
:executable: xc8-cc
:arguments:
- -mcpu=#{ENV['MCU']}
- -std=#{ENV['STANDARD']}
- -#{ENV['OPTIMIZATION']}
- -Wa,-a
- -D"$": COLLECTION_DEFINES_TEST_AND_VENDOR
- -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR
- -o "${2}"
- -c "${1}"
:test_file_preprocessor:
:name: "Microchip XC8 preprocessor"
:executable: xc8-cc
:arguments:
- -mcpu=#{ENV['MCU']}
- -std=#{ENV['STANDARD']}
- -D"$": COLLECTION_DEFINES_TEST_AND_VENDOR
- -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR
- "${1}"
:test_includes_preprocessor:
:name: "Microchip XC8 includes preprocessor"
:executable: xc8-cc
:arguments:
- -mcpu=#{ENV['MCU']}
- -std=#{ENV['STANDARD']}
- -D"$": COLLECTION_DEFINES_TEST_AND_VENDOR
- -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR
- "${1}"
:test_linker:
:name: "Microchip XC8 Linker"
:executable: xc8-cc
:arguments:
- -mcpu=#{ENV['MCU']}
- -#{ENV['OPTIMIZATION']}
- -gdwarf-3
- -D"$": COLLECTION_DEFINES_TEST_AND_VENDOR
- -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR
- -Wl,-Map="${3}"
- -o "${2}"
- "{'${1}'.split(' ').map { |x| (x.include? '/out/c/') ? (Pathname(x).sub_ext('.p1')).to_s : x }.join(' ') }"
- "${4}"
:mdb:
:executable: mdb.bat
:arguments:
- ${1}
:plugins:
:load_paths:
- "#{Ceedling.load_path}"
- plugins
:enabled:
- stdout_pretty_tests_report
- module_generator
- raw_output_report
- warnings_report
- xml_tests_report
- json_tests_report
- gcov
- mdb
I'm glad to know that it is now working for you and I thank you for pointing out this issue and for sharing that valuable info to help solving it and improve documentation.
I am trying out your plugin and it seems like a very good start; however, I am unable to run it on a windows host because it gives the following warning
No such file or directory - mdb.exe (Errno::ENOENT)
I believe that mdb is a .bat on windows, not an .exe.
Could you possibly provide an example with the project?