Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Testing

Prashanth Menon edited this page Feb 5, 2018 · 17 revisions

Build and Run ALL Unit Test Cases

By default, all the test cases are first built and then run using AddressSanitizer. To build and run the tests:

cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_SANITIZER=Address ..
make check

PARALLEL MAKE

If your machine has more than 8 GB DRAM and 4 physical cores, you can increase the concurrency settings of make.

cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_SANITIZER=Address ..
make check -j4

Build and Run INDIVIDUAL Unit Test Case

Here's the command to build an individual test:

make $TEST_NAME

EXAMPLE:

make sample_test

To run an individual test using ctest, list the test cases:

ctest -N

Then run it thus:

ctest -I 26,26 -V

Write new Unit Test Cases

Refer to the README in the test subfolder: https://github.com/cmu-db/peloton/blob/master/test/README.md

Valgrind Command

ADVANCED: Here's the valgrind command to run an individual test (once it has already been built) :

valgrind "--trace-children=yes" "--leak-check=full" "--track-origins=yes" "--soname-synonyms=somalloc=*jemalloc*" "--error-exitcode=1" "--suppressions=/$LOCATION_OF_PELOTON_SOURCE_DIR/third_party/valgrind/valgrind.supp /$LOCATION_OF_PELOTON_BUILD_DIR/test/$TEST_NAME

EXAMPLE:

valgrind "--trace-children=yes" "--leak-check=full" "--track-origins=yes" "--soname-synonyms=somalloc=*jemalloc*" "--error-exitcode=1" "--suppressions=/home/parallels/git/peloton/third_party/valgrind/valgrind.supp" ./test/sample_test
Clone this wiki locally