0

I have a rather unconventional question related to TDD and armcc (Keil).

I understand TDD as compile -> link -> execute -> Test output.

In my case I have to compile and link with armcc, but I can not execute the file without Keil (Simulation). I simple don't have a simulator for my device. At least there is no other way to my knowledge. You need to run the tests on your target.

I think that is very inconvenient all in all and I am searching for a better solution. So I am thinking of compiling and linking with armcc but executing with gcc/g++ (depending on the test framework).

Is this a viable option? To be honest I have no idea.

I would really appreciate it if somebody could guide me to my messed perception. Any hint is more then welcome.

I already know about "Unity", but still the target issue is not resolved.

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94
eimer
  • 81
  • 7
  • 1
    I see three options: 1) run the code on the target, 2) run the code on a simulator, 3) if the code is not processor- or OS-specific, compile for your PC and run locally. – Weather Vane Apr 20 '16 at 14:41
  • A fourth option, which can significantly affect the way you write code from its very first line, is to keep form and function quite separate. You can then patch any system-specific functions with conditional compilation. For example, if the target requires an external device, you can simulate its input for yourself. In other words, you create your own system layer. Then the code can be ported reasonably easily to other platforms. – Weather Vane Apr 20 '16 at 14:47
  • Thanks you. I am having a few comments to your suggestions. 1) I don't want to test on the target. I rather prefer mocking "hardware" and test the logic behavior first. 2) At the moment a working simulator does not exist, at least not for my target. 3) I still can't run the code with the armcc compiler, at least not to my knowledge. The target is required. 4) Unfortunately, I have to handle a lot of legacy code, wich is untested :( I was hopping somebody has experience on how to compile code with armcc and run the executable with gcc/g++. I will further hunt down a feasible solution for me... – eimer Apr 21 '16 at 06:47
  • faced with the hardware not being available until a week before delivery, I wrote my own emulators/debuggers to run on a PC. You do get to know the processor that way, but they have become more complex since then. – Weather Vane Apr 21 '16 at 06:55

0 Answers0