Invoke the LibMem CTest for unit testing and validation of LibMem functions from the BUILD_DIR/test directory.
The following test categories are supported:
Iterator testing (increments by 1B till Page_Size) [0B-4KB]
Shift testing (Tests for standard sizes) [8B,16B,32B…32MB]
Alignment testing (Modifies the src and dst alignment) [1B-4KB] src [0-63] dst [0-63]
Report Description
CTest validation report will be stored in this path:
build_dir/test/Testing/Temporary/LastTest.log
Storing the test logs with Timestamp:
$ ctest -R "memcpy_shift" -O ctest_results_$(date +%Y_%m_%d_%H%M%S).log
Arguments for the framework:
$ ctest -R <Matching test regex> -E <Exclude regex> -j [<jobs>]
<regex>: function_[MODE]
"memcpy","memset","memmove","memcmp", "mempcpy"
"strcpy","strncpy","strcmp","strncmp","strlen" (Runs all the test cases iter,shift and alignment)
"iter" (Runs Iterator test cases on all the functions)
"shift" (Runs Shift test cases on all the functions)
"align" (Runs Alignment test cases on all the functions)
"threshold" (Runs threshold specific test cases based on L2 and threshold_nt values)
"aligned_vector" (Runs ZEN5 specific aligned vector threshold checks)
"function_MODE" (Runs the specified MODE:iter,shift,align, and threshold on the input function)
jobs: Optional parameter for maximum no. of concurrent processes to be used. [0...$(nproc)]
For Minimized logs
Storing only failure logs:
$ ctest --progress --output-on-failure -j $(nproc)
Examples:
Running CTest for all modes and all functions (default config):
$ ctest
Running CTest for memcpy all modes:
$ ctest -R "memcpy" -j $(nproc)
Running CTest for memcmp align mode:
$ ctest -R "memcmp_align" -j $(nproc)
Running CTest for memmove iterative mode:
$ ctest -R "memmove_iter" -j $(nproc)
Running CTest for memset shift mode:
$ ctest -R "memset_shift" -j $(nproc)
Running with multiple inputs:
$ ctest -R "memcpy|memmove|strcpy_iter"
Running threshold checks:
$ ctest -R "memcpy_threshold"
Using Exclude regex:
$ ctest -R "memcpy|strcpy" -E "iter|shift" # Runs memcpy_align and strcpy_align; ignores iter and shift test cases
Test log reports with timestamp:
$ ctest -R "memcpy_shift" -O ctest_results_$(date +%Y_%m_%d_%H%M%S).log
Note
Running CTest on Memcmp, Strcmp and Strncmp takes additional time as all the bytes are compared.