Mips tests tracing


Is there is a way one can trace the tests? I mean executing it step by step and oserve the changes in the addresses and registers?

Hey, yes this is exactly what the testbox is for. In the root folder of the project, i.e. the folder you cloned, you can find a script called build_testbox. You can run it with the command

./build_testbox <PATH>

where <PATH> needs to be replaced with the path to the assembly file for the test. This copies all of your source files (i.e. the files in the src folder) as well as the test file you specified to the testbox folder, where you can open the test in MARS, assemble it and step through your code by clicking the green arrow in the toolbar with the subscript 1. This button executes one instruction only. You can also observe the register contents as usual.

Here is a concrete example of what this would look like for the public test test_check_win_1.

The command you need to run would be

./build_testbox tests/pub/test_check_win_1.asm

Then you can open the file testbox/test_check_win_1.asm in MARS and start debugging the test.

If something fails during this setup process, make sure you did the follwing things:

  • You ran the script from the root folder of the project, i.e. the one you cloned. If you are e.g. in the src folder, the above command will not work.
  • You specified the path to the assembly file including the file extension .asm
  • In MARS, you opened the test file from the testbox folder, not the one from the tests/pub folder.
  • You followed the instructions for setting up MARS.

Note that we will also release the recording of the project presentation soon, where you can watch us setting up a testbox.