This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

uVision: How to close debug session at end of main?

Hello everybody,

I am trying to automate my tests with Keil uVision. I have written several unit-tests with the testing library Unity. Every test is encapsulated in a separate Keil project. The tests on the simulator. The test output is written to the Debug Viewer (debug_printf).

The created test-runner has a main function (int main(void))that returns after the tests are executed. When main returns I want the debug session to end. At the moment the debug session stays open.

Can anyone help me with that?
Thank you in advance :)

Parents
  • Use a simulator script and put a breakpoint at the desired point of exit. When breakpoint is hit, just execute EXIT command.

    /* C module code */
    int main (void) {
    
      /* Test implementation */
      ..
      ..
      /* End of tests */
    
      exit_point();
    }
    
    /* uVision simulator script */
    BS exit_point,1
    G
    EXIT
    

    Something like that should do the trick.

Reply
  • Use a simulator script and put a breakpoint at the desired point of exit. When breakpoint is hit, just execute EXIT command.

    /* C module code */
    int main (void) {
    
      /* Test implementation */
      ..
      ..
      /* End of tests */
    
      exit_point();
    }
    
    /* uVision simulator script */
    BS exit_point,1
    G
    EXIT
    

    Something like that should do the trick.

Children