This is a tester for the libasm
project of school 42.
It benefits from the speed of Rust's testing framework, allowing to launch all tests in under a second.
Of course, you shouldn't use that as a student. I know I cannot prevent you to use it. But I mean it. There are maybe cases this tester doesn't handle. And you should always write your own tests.
- Download the release of this tester inside the corrected's libasm project.
- Add this in the Makefile of the corrected (of course, change the
${OBJS}
if needed):
.PHONY: dynamic_lib
dynamic_lib:
cc -shared -o libasm.o ${OBJS}
- Run
make dynamic_lib
. If it fails, you can lecture them about how it's important to create Position-Independent Code.- If you feel generous enough, add
wrt ..plt
after everycall [function]
instruction they use, and proceed.
- If you feel generous enough, add
- Run
./libasm_tester
. If there's a lot of red, it might be because the person you correct didn't implement the bonus, in which case you can run./libasm_tester mandatory
.- If every single test fails (with a lot of mention of "poisoning"), it might be because it didn't find the
libasm.so
file. Ensure the tester is placed in the same directory as the.so
.
- If every single test fails (with a lot of mention of "poisoning"), it might be because it didn't find the
- To run valgrind (because you definitely want to run valgrind), use this command:
valgrind --leak-check=full --trace-children=yes --show-leak-kinds=all --suppressions=./valgrind_suppression_files/patch_rusty_and_cargo_test.txt ./libasm_tester mandatory
- If a test fails, and the error message contains "DPS:", it's not the student fault. Therefore, Don't Penalize the Student.
- If a test fails, and the student is to blame, you can check which test is run. It will be located in the
src/test/(mandatory|bonus)/
of the repository.