aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/cmake/RunBuildTest.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/cmake/RunBuildTest.cmake')
-rw-r--r--linden/indra/cmake/RunBuildTest.cmake22
1 files changed, 22 insertions, 0 deletions
diff --git a/linden/indra/cmake/RunBuildTest.cmake b/linden/indra/cmake/RunBuildTest.cmake
new file mode 100644
index 0000000..2da3e88
--- /dev/null
+++ b/linden/indra/cmake/RunBuildTest.cmake
@@ -0,0 +1,22 @@
1#This cmake script is meant to be run as a build time custom command.
2#The script is run using cmake w/ the -P option.
3# parameters are passed to this scripts execution with the -D option.
4# A full command line would look like this:
5# cmake -D LD_LIBRARY_PATH=~/checkout/libraries -D TEST_CMD=./llunit_test -D ARGS=--touch=llunit_test_ok.txt -P RunBuildTest.cmake
6
7# Parameters:
8# LD_LIBRARY_PATH: string, What to set the LD_LIBRARY_PATH env var.
9# TEST_CMD: string list, command to run the unit test with, followed by its args.
10set(ENV{LD_LIBRARY_PATH} ${LD_LIBRARY_PATH})
11#message("Running: ${TEST_CMD}")
12separate_arguments(TEST_CMD)
13#message("Running: ${TEST_CMD}")
14execute_process(
15 COMMAND ${TEST_CMD}
16 RESULT_VARIABLE RES
17 )
18
19if(NOT ${RES} STREQUAL 0)
20 message(STATUS "Failure running: ${TEST_CMD}")
21 message(FATAL_ERROR "Error: ${RES}")
22endif(NOT ${RES} STREQUAL 0) \ No newline at end of file