To generate a new test case:
1. Write your program into a .s file in “bare” MIPS assembly with the following restrictions:
– This program should not contain any pseudo instruction (a good way to obtain such a program is to cut and paste the assembly of your MIPS code as displayed by XSPIM).
– The file should contain a single function because getControlFlow works a single procedure and does not process inter-procedural control transfers.
– For the examples in this README file, assume that the file containing your bare .s file is tests/Students/MyCoolTest.s
2. Run the following command to generate a .bin file: expect assemble.exp tests/Students/MyCoolTest.s tests/Students/MyCoolTest.bin | sed ‘1,7d’ | sed ‘2d’. To generate the .bin for several tests (these tests should be either in the directory tests/Students or tests/TeachingStaff), you can execute the script compileTests.sh.
3. To run your own test case against your own solution, you can use the provided runTest.sh script. A typical run would be as follows: ./runTest.sh 0 0 MyAwesomeSolution.s tests/Students/MyCoolTest.bin > tests/Students/MyCoolTest.out. The two first parameters (0 0) specify if the program should skip edges or dominators (read comments in the script). The third parameter is the file name of your solution to the lab (without including a main). The fourth parameter is the name of the file containing the binary for your example that you generated in step (2) above. The line above also redirects the output to a file.
4. You should be able to now submit your new test, generated in step (2), to CheckMyLab. In this example, the test case file is MyCoolTest.bin
5. The solution that you need to submit to CheckMyLab MUST also include a main program. Thus, the easiest way to generate a solution to be checked by CheckMyLab is to executed the runTest.sh script, as described in step (3) above. The script creates a file called testBuild.s. This file contains both your solution and a common main code that can read a binary file and call your subroutine. Thus, the file that you want to submit to CheckMyLab is this testBuild.s file generated by runTest.sh.