Skip to content

Commit 7c68c54

Browse files
committed
Add documentation to the CMake file in rs_port.
1 parent 269e72f commit 7c68c54

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

source/ports/rs_port/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,15 @@ if((OPTION_BUILD_ADDRESS_SANITIZER OR OPTION_BUILD_THREAD_SANITIZER) AND NOT RS_
149149
endif()
150150

151151
# If we have cargo-valgrind, run the tests with it
152+
# For installing it, first install valgrind on your system, then run:
153+
# cargo install cargo-valgrind
154+
# It will install the tooling necesary for running with valgrind.
155+
# For debugging the project run:
156+
#
157+
# cmake -DCMAKE_BUILD_TYPE=Debug -DOPTION_BUILD_PORTS=ON \
158+
# -DOPTION_BUILD_PORTS_RS=ON -DOPTION_TEST_MEMORYCHECK ..
159+
#
160+
# You can also add loaders for this command so you can test with them.
152161
if(OPTION_TEST_MEMORYCHECK AND NOT (OPTION_BUILD_ADDRESS_SANITIZER OR OPTION_BUILD_THREAD_SANITIZER))
153162
# Check if cargo-valgrind is installed
154163
execute_process(
@@ -162,6 +171,9 @@ if(OPTION_TEST_MEMORYCHECK AND NOT (OPTION_BUILD_ADDRESS_SANITIZER OR OPTION_BUI
162171
endif()
163172
endif()
164173

174+
# For running one test only, you can add:
175+
# --test=metacall_test --package=metacall
176+
# To the command, and it will run metacall_test only
165177
add_test(NAME ${target}
166178
COMMAND ${Rust_CARGO_EXECUTABLE} ${CARGO_VALGRIND} ${NIGHTLY_FLAGS} test ${BUILD_STD_FLAGS}
167179
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}

0 commit comments

Comments
 (0)