[CMake] ctest puts LD_LIBRARY_PATH into environment impacts sub-runs of cmake/ctest

Wheeler, Frederick W (GE, Research) wheeler at crd.ge.com
Tue Sep 9 14:50:25 EDT 2008


> If you used the command based ctest scripts, you have much 
> more control 
> of when the env vars are set.
> 
> This came up recently in a bug report:
> http://public.kitware.com/Bug/view.php?id=4954
> 
> Basically, you want something like this:
> 
> CTEST_START (Nightly)
> CTEST_UPDATE (SOURCE "${CTEST_SOURCE_DIRECTORY}")
> CTEST_CONFIGURE (BUILD "${CTEST_BINARY_DIRECTORY}")
> CTEST_READ_CUSTOM_FILES("${CTEST_BINARY_DIRECTORY}")
> CTEST_BUILD (BUILD "${CTEST_BINARY_DIRECTORY}")
> SET(ENV{LD_LIBRARY_PATH} "...=....")
> CTEST_TEST (BUILD "${CTEST_BINARY_DIRECTORY}")
> CTEST_SUBMIT ()
> 
> That will use the LD_LIBRARY_PATH for just the tests.  You 
> can keep it 
> out of the configure step if you need to.
> 
> -Bill

Thanks for this helpful tip, which is panning out well, though I'm still
testing/fixing a few things.  I have a few follow-up questions, and I'm
grateful for any advice on any of them from anybody.

1.  What is the right way to add a notes file when ctest-scripting like
this?  Is there a script equivalent of the command-line option ctest -A
Notes.txt ?   Or does -A Notes.txt still need to be on the ctest
command-line?

2.  Does it make sense to use both CTEST_TEST() *and* CTEST_MEMCHECK()
for valgrind builds?  I've always just done one of the other, but cannot
remember why.

3.  There used to be a file $BLDTREE/Testing/TAG that had the date
string (e.g. "20080909-1705") of the most recent output directory used
by ctest.  I've been checking for the presence of
$BLDTREE/Testing/string_taken_from_TAG/Configure.xml to determine
whether a continuous ctest build just the a CVS update and found no
changes, or did a CVS update and then did a build/test/submit.  My
reason is that if a continuous build actually does something I want to
trigger dependent builds (other cmake projects), but not otherwise.  So
my question is this: if I'm right that TAG is now gone, how can I
determine whether a continuous build actually did build.  Hmmm.  I guess
I could use CTEST_UPDATE( SOURCE "\${CTEST_SOURCE_DIRECTORY}"
RETURN_VALUE res ) and write a file or not based on 'res'.  Is that the
right thing to do here?

4.  With my older ctest command-line runs, continuous builds used to
automatically end if there were no changes during the CVS update.  Is
that still true with these ctest scripts?  My guess is no, and you need
to check the RETURN_VALUE of CTEST_UPDATE and take care of this yourself
by putting the rest of the steps in an IF/ENDIF.  Is that right?



Thanks,
Fred


More information about the CMake mailing list