This is a simple shell script that automate tests for the 42 Project Libasm/2020.
- check compilation error
- check the function output
- check the return value
- check the errno value for functions with system calls
- check memory leak when necessary
GNU Make
NASM Compiler
Valgrind
Clone this repo into libasm root's directory.
Make sure your Makefile has the make re
rule, and make bonus
rule if you want to test the bonus functions.
Both adding the objects to the libasm.a
library.
$ git clone https://github.com/vscabell/42libasm_tester.git
$ cd 42libasm_tester
$ bash runtest.sh
$ bash runtest.sh bonus
Add successively the functions in the order you want, for example
$ bash runtest.sh write
$ bash runtest.sh strlen strdup
$ bash runtest.sh bonus atoi_base
Check if any memory leak was detected
$ bash runtest.sh leak
$ bash runtest.sh bonus leak
Take a look at /42libasm_tester/unit_tests/diffs
directory for diffs files
Some of the outputs examples