This feature is now implemented in CVS CMake.<div><br></div><div>See notes in bug tracker for more info:<div><a href="http://public.kitware.com/Bug/view.php?id=7885">http://public.kitware.com/Bug/view.php?id=7885</a><br><br>
</div><div>Proper syntax is demonstrated in CMake/Tests/Environment/CMakeLists.txt, as in:</div><div><div><br></div><div>set_tests_properties(Environment1 EchoEnvironment1 PROPERTIES</div><div> ENVIRONMENT "CMAKE_ENVIRONMENT_TEST_VAR=Happy Thanksgiving!"</div>
<div> PASS_REGULAR_EXPRESSION "CMAKE_ENV.*Happy Thanksgiving"</div><div>)</div><div><br></div><div><br></div><div>Have a good one,</div><div>David</div><div><br></div></div><div><br><div class="gmail_quote">On Wed, Oct 29, 2008 at 9:46 AM, Judicaël Bedouet <span dir="ltr"><<a href="mailto:j.bedouet@infonie.fr">j.bedouet@infonie.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Thanks for your fast answers.<br><br>Reported as <a href="http://public.kitware.com/Bug/view.php?id=7885" target="_blank">http://public.kitware.com/Bug/view.php?id=7885</a><br>
<br>J. Bedouet<div><div></div><div class="Wj3C7c"><br><br><br><div class="gmail_quote">On Wed, Oct 29, 2008 at 2:53 PM, Bill Hoffman <span dir="ltr"><<a href="mailto:bill.hoffman@kitware.com" target="_blank">bill.hoffman@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex"><div><div></div><div>Judicaël Bedouet wrote:<br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
Hello,<br>
<br>
I have a test which must be executed in different environments. Test results depend on values of environment variables.<br>
Is there a way to easily set environment variables before running a test ? Somewhat like<br>
<br>
ADD_TEST (TestEnv1 testEnv)<br>
SET_TEST_PROPERTIES (TestEnv1 PROPERTIES ENV TEST_ENV="testEnvValue1")<br>
SET_TEST_PROPERTIES (TestEnv1 PROPERTIES WILL_FAIL true)<br>
<br>
ADD_TEST (TestEnv2 testEnv)<br>
SET_TEST_PROPERTIES (TestEnv2 PROPERTIES ENV TEST_ENV="testEnvValue2")<br>
<br>
</blockquote>
<br></div></div>
Currently, there is not. Please create a feature request in the bug tracker. Right now the only work around would be to have the test be run from a cmake -P script.<br><font color="#888888">
<br>
-Bill<br>
</font></blockquote></div><br>
</div></div><br>_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org">CMake@cmake.org</a><br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br></div></div>