<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
I have a macro which takes a variety of arguments and does all the
things necessary for making a test: compiling the exec (or copying
the script), putting input files in the right place and setting
desired properties on the test. I use the <a
href="http://www.cmake.org/Wiki/CMakeMacroParseArguments">ParseArguments</a>
macro found on the Wiki to handle all the switches and optional list
arguments and at some point I ended up using this system to pass a
PASS_REGULAR_EXPRESSION property through my macro and the argument
parser. Unfortunately, by the time it was processed by the embedded
SET_TESTS_PROPERTIES command, what would have been a simple:<br>
<pre>SET_TESTS_PROPERTIES (Unscheduled_03_t PROPERTIES PASS_REGULAR_EXPRESSION
"Assertion `handle.isValid\\(\\) == require_presence_' failed."
)
</pre>
command became:<br>
<pre>cet_test(Unscheduled_03_t HANDBUILT
TEST_EXEC test_must_abort
TEST_ARGS art -c "Unscheduled_03_t.fcl"
TEST_PROPERTIES PASS_REGULAR_EXPRESSION
"Assertion `handle.isValid\\\\\\\\(\\\\\\\\) == require_presence_' failed."
DATAFILES
fcl/Unscheduled_03_t.fcl
fcl/messageDefaults.fcl
)
</pre>
Note that the parentheses required no less than eight backslash
escapes each in order to be interpreted correctly by the time they
were seen by the SET_TESTS_PROPERTIES command.<br>
<br>
Is there any way at all to pass this (or any other) argument through
the cet_test macro's argument parser and embedded
SET_TESTS_PROPERTIES command without getting all those backslashes
swallowed? If not, can there be?<br>
<br>
For illustration purposes, the relevant lines from cet_macro are:<br>
<pre>MACRO(cet_test CET_TARGET)
#<snip>
CET_PARSE_ARGS(CET
"DATAFILES;DEPENDENCIES;LIBRARIES;SOURCES;TEST_ARGS;TEST_EXEC;TEST_PROPERTIES"
"HANDBUILT;PREBUILT;NO_AUTO;USE_BOOST_UNIT;INSTALL_EXAMPLE;INSTALL_SOURCE"
${ARGN}
)
#<snip>
IF(CET_TEST_PROPERTIES)
SET_TESTS_PROPERTIES(${CET_TARGET} PROPERTIES ${CET_TEST_PROPERTIES})
ENDIF()
#<snip>
</pre>
Thanks for your help,<br>
Chris.<br>
</body>
</html>