• AVR Freaks

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

Author
Neroone
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)
0

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!
test_mlights.c:17:test_WhenTheHeadlightSwitchIsOn_ThenTheHeadLightsAreOn:PASS
 
ERROR: Test executable "test_mlights.out" failed.
> Produced no final test result counts in $stdout:
! Program is simulated!
test_mlights.c:17:test_WhenTheHeadlightSwitchIsOn_ThenTheHeadLightsAreOn:PASS
> 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
run
break unity.c:1168
wait 5000
quit
 
 
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.
 
run
break unity.c:1168
unity.c:1168 could not be resolved to an address
wait 5000
quit
Stop at
                address:0xf0de
                file:/home/project/Software/PIC_DemoLights/test/support/support_uart.c
                source line:59.  which is the while ( !TXIF) line in the putchar function.
void putch(char data)
{
while ( !TXIF)
continue;
TXREG = data;
}
 
Any suggestions would be appreciated?.
#1

1 Reply Related Threads

    SinCitiesSin
    Junior Member
    • Total Posts : 94
    • 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)
    0
    I am curious to know if you solved this or not. I am having similar issues.
    #2
    Jump to:
    © 2019 APG vNext Commercial Version 4.5