-
If you want to use intal_sampletest.c for running testcases, presently, these are the steps to be followed.
- Make sure in the makefile that to intal_client will get executed.
- From the main directory of the repo, run
bash ./scripts/run.sh
.
-
intal_sampletest.c can be tedious to work with or understand.
Presently, the custom test suite has been developed to work with the functions that do not require arrays as an argument.
Provision for those functions can be added later, too.-
If you want to use your own custom test cases for running test cases, presently, these are the steps to be followed.
- Make sure that the line in the makefile that corresponds to test_suite will get executed.
- From the main directory of the repo, run
bash ./scripts/test.sh --all
-
If you want to define custom testcases that must be run everytime
bash ./scripts/test.sh --all
is executed, enter your custom test case in scripts/tests.sh.
The pattern for entering the test cases is specified in test.sh, down below in a function. -
If you want to run a custom testcase and try it out just once, presently, these are the steps to be followed.
- Run
make
- Run
./test_suite <operation> <intal1> <intal2 (if applicable)>
- Run
-
For the manual page on test_suite, run
./test_suite --help
Usage: $ ./test_suite <operation> <intal1> <intal2 (if applicable)> <num> : arbitrary length number with preceeding + or - <operation> : -add : num1 + num2 -diff : num1 - num2 -mul : (num1)*(num2) -comp : num1 =/!= num2 -mod : num1%num2 -pow : (num1)^(num2) -gcd : gcd(num1, num2) -fib : (num1)th Fibonacci element -fact : (num1)! -bco : num1 C num2
-
While checking the code for memory errors/memory leaks with valgrind, it is recommended that intal_sampletest.c be used, since it accounts for freeing the variables being used as parameters as well.
Unless you've a shell script that makes sure the commandline arguments aren't accounted for by valgrind by one way or another, please refrain from using it, since it may lead to erroneous results, and unnecessary confusion.
If you want to run valgrind, presently, these are the steps to be followed.
- Make sure in the makefile that to intal_client will get executed.
- Run
make
- Run
valgrind --leak-check=full -s ./intal_client