#download git submodules
git submodule init
git submodule update
make
./main
make
: compile and run the programmake test
: run tests!make debug
: compile without optimization and open gdb debuggermake verbose
: compile normally and run it with Valgrind to see more verbose error outputmake clean
: removes compiled files and clear the screen
- Visit
random/test.c
and create an analog file for the functionality that you want to test. - Visit
test.conf.c
and add the proper header file of the new functionality being tested and add the SUITE to the suite list and as anextern
variable. - Run
make test
and be happy!
Is important to know how much time does the program takes to calculate all the iterations.
To measure it run:
make
time ./main
Focus on the real
field, that is the time that it took the program to return.
C is pretty good at making a lot of calculations, but its really slow (as you might suspect) on printing values, so avoid making a lot of printing because its very time consuming.
The VM comes with GDB which is the debugger for C. Use GDB instead of old printf.
To debug:
# Run debug make task
make debug
# On gdb console
# Create a breakpoint on line 74
break 74
# run the program
run
# It will stop on the breakpoint
# you can inspect any variable at this point
print some_var
# Continue
cont
# Repeat and Enjoy!
Links:
Checkout our wiki for more info!