[CMake] Setting environment before running a test

Mathieu Malaterre mathieu.malaterre at gmail.com
Wed Oct 29 09:51:20 EDT 2008


On Wed, Oct 29, 2008 at 2:45 PM, Judicaël Bedouet <j.bedouet at infonie.fr> wrote:
> Hello,
>
> I have a test which must be executed in different environments. Test results
> depend on values of environment variables.
> Is there a way to easily set environment variables before running a test ?
> Somewhat like
>
> ADD_TEST (TestEnv1 testEnv)
> SET_TEST_PROPERTIES (TestEnv1 PROPERTIES ENV TEST_ENV="testEnvValue1")
> SET_TEST_PROPERTIES (TestEnv1 PROPERTIES WILL_FAIL true)
>
> ADD_TEST (TestEnv2 testEnv)
> SET_TEST_PROPERTIES (TestEnv2 PROPERTIES ENV TEST_ENV="testEnvValue2")

I needed that feature too (to set PYTHONPATH):

http://gdcm.svn.sourceforge.net/viewvc/gdcm/trunk/CMake/UsePythonTest.cmake?view=markup

2cts
-- 
Mathieu


More information about the CMake mailing list