• AVR Freaks

Hot!Unit testing on PIC18 using MDB command prompt using unity. Test Executable failed.

New Member
  • Total Posts : 11
  • Reward points : 0
  • Joined: 2017/11/01 12:59:42
  • Location: 0
  • Status: offline
2017/11/12 08:55:34 (permalink)

Unit testing on PIC18 using MDB command prompt using unity. Test Executable failed.

I am trying to get a simple unit testing project using Unity ceedling and I am running it using the simulator MDB.
The first test runs and then it gets stuck somewhere and fails. I am not able to see what is wrong here.
After I run ceedling test:all I get this (1273) Omniscient Code Generation not available in Free mode (warning)
/vendor/ceedling/vendor/unity/src/unity.c: 1334: (1471) indirect function call via a NULL pointer ignored (warning)
Which is the Func() line in the UnityDefaultTestRun function of unity.c.
void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum)
Running test_mlights.out...
> Shell executed command:
'ruby test/support/sim_test_fixture.rb'
> Produced output:
! Program is simulated!
ERROR: Test executable "test_mlights.out" failed.
> Produced no final test result counts in $stdout:
! Program is simulated!
> And exited with status: [0] (count of failed tests).
> This is often a symptom of a bad memory access in source or test code.
rake aborted!
device pic18f86k22
hwtool sim
set oscillator.frequency 64
set oscillator.frequencyunit         Mega
set oscillator.rcfrequency             250
set oscillator.rcfrequencyunit     Kilo
set uart1io.uartioenabled             true
set uart1io.output                           file
set uart1io.outputfile                     test/support/out.txt
set system.disableerrormsg         true
set breakoptions.coreerrors        Break
set breakoptions.peripheralerrors Break
set breakoptions.wdtwarnings   Break
set breakoptions.peripheralwarnings Break
program build/test/TestBuild.elf
break unity.c:1168
wait 5000
The test runner has created the two RUN_TESTS except it fails at the first one and aborts.
My simulator is not running the two tests. After running the first test it fails and It’s getting stuck somewhere in the putchar function. I am not sure where to set the breakpoint for unity.c to exit.
program build/test/TestBuild.elf
Programming target...
Program succeeded.
break unity.c:1168
unity.c:1168 could not be resolved to an address
wait 5000
Stop at
                source line:59.  which is the while ( !TXIF) line in the putchar function.
void putch(char data)
while ( !TXIF)
TXREG = data;
Any suggestions would be appreciated?.

1 Reply Related Threads

    Junior Member
    • Total Posts : 95
    • Reward points : 0
    • Joined: 2016/11/15 08:12:41
    • Location: 0
    • Status: offline
    Re: Unit testing on PIC18 using MDB command prompt using unity. Test Executable failed. 2019/10/16 13:07:53 (permalink)
    I am curious to know if you solved this or not. I am having similar issues.
    Jump to:
    © 2020 APG vNext Commercial Version 4.5