Skip to content

Commit fe119d4

Browse files
committed
run tests with valgrind
1 parent c64e3bf commit fe119d4

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ run_tests: $(TEST_BINS)
4848
./$$test; \
4949
done
5050

51+
# Run tests with Valgrind
52+
valgrind_tests: $(TEST_BINS)
53+
for test in $(TEST_BINS); do \
54+
valgrind --leak-check=full --show-leak-kinds=all ./$$test; \
55+
done
56+
5157
# Clean up the directory
5258
.PHONY: clean
5359
clean:

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,28 +64,33 @@ This project has been thoroughly tested with the supported data types to ensure
6464
# **Usuage**
6565
## **Compiling the project**
6666
To compile the project and create the executables, run the following command:
67-
```
67+
```bash
6868
make all
6969
```
7070
This will compile all the source files, create object files and libraries, and link them to create the executables.
7171

7272
## **Creating Libraries**
7373
To just create the libraries, run the following command:
74-
```
74+
```bash
7575
make lib
7676
```
7777
It will populate .a and .lib files in lib directory.
7878

7979
## **Running tests**
8080
To run the tests, run the following command:
81-
```
81+
```bash
8282
make run_tests
8383
```
8484
This will compile and run all the tests in the tests directory.
8585

86+
```bash
87+
make valgrind_tests
88+
```
89+
The will compile and run all the tests in the tests directory and check for memory leaks. The valgrind --leak-check=full --show-leak-kinds=all command is used to execute the test binaries with Valgrind's memory leak detection capabilities.
90+
8691
## **Cleaning up the directory**
8792
To clean up the directory and remove all the compiled files, run the following command:
88-
```
93+
```bash
8994
make clean
9095
```
9196
This will remove all the object files, libraries, and executables.

0 commit comments

Comments
 (0)