Notes |
|
(0014198)
|
David Cole
|
2008-11-26 14:39
|
|
Initial draft of feature is now in CVS CMake:
/cvsroot/CMake/CMake/Source/cmCTest.cxx,v <-- Source/cmCTest.cxx
new revision: 1.341; previous revision: 1.340
/cvsroot/CMake/CMake/Source/cmCTest.h,v <-- Source/cmCTest.h
new revision: 1.103; previous revision: 1.102
/cvsroot/CMake/CMake/Source/cmSystemTools.cxx,v <-- Source/cmSystemTools.cxx
new revision: 1.386; previous revision: 1.385
/cvsroot/CMake/CMake/Source/cmSystemTools.h,v <-- Source/cmSystemTools.h
new revision: 1.156; previous revision: 1.155
/cvsroot/CMake/CMake/Source/CTest/cmCTestBuildAndTestHandler.cxx,v <-- Source/CTest/cmCTestBuildAndTestHandler.cxx
new revision: 1.23; previous revision: 1.22
/cvsroot/CMake/CMake/Source/CTest/cmCTestTestHandler.cxx,v <-- Source/CTest/cmCTestTestHandler.cxx
new revision: 1.82; previous revision: 1.81
/cvsroot/CMake/CMake/Source/CTest/cmCTestTestHandler.h,v <-- Source/CTest/cmCTestTestHandler.h
new revision: 1.30; previous revision: 1.29
/cvsroot/CMake/CMake/Tests/CMakeLists.txt,v <-- Tests/CMakeLists.txt
new revision: 1.73; previous revision: 1.72
/cvsroot/CMake/CMake/Tests/Environment/CMakeLists.txt,v <-- Tests/Environment/CMakeLists.txt
initial revision: 1.1
/cvsroot/CMake/CMake/Tests/Environment/main.cxx,v <-- Tests/Environment/main.cxx
initial revision: 1.1 |
|
|
(0014199)
|
David Cole
|
2008-11-26 15:06
|
|
I implemented it with the word "ENVIRONMENT" as the name of the test property.
See example/test use in CMake/Tests/Environment/CMakeLists.txt. |
|
|
(0014201)
|
David Cole
|
2008-11-26 15:42
|
|
$ cvs commit -m "COMP: Using the proper type for local variables can eliminate compiler warnings." Source/cmSystemTools.cxx
/cvsroot/CMake/CMake/Source/cmSystemTools.cxx,v <-- Source/cmSystemTools.cxx
new revision: 1.387; previous revision: 1.386 |
|
|
(0014223)
|
David Cole
|
2008-11-28 10:50
|
|
$ cvs commit -m "STYLE: Fix line length style violation." Source/cmCTest.h
/cvsroot/CMake/CMake/Source/cmCTest.h,v <-- Source/cmCTest.h
new revision: 1.104; previous revision: 1.103 |
|
|
(0014229)
|
J. Bedouet
|
2008-11-28 17:00
|
|
It works fine for me.
Thanks a lot.
Will it to be integrated to a future release of CMake 2.6 ? |
|
|
(0015009)
|
Philip Lowman
|
2009-02-17 00:17
|
|
There's an issue with the patch. For some reason it doesn't seem to work for executing "ctest", but works fine for me on "make test". Also the property is not documented.
lowman@locke:~/tmp/cmake_tests/TestEnv/build$ make test
Running tests...
Start processing tests
Test project /home/lowman/tmp/cmake_tests/TestEnv/build
1/ 1 Testing foo .......................... Passed
100% tests passed, 0 tests failed out of 1
lowman@locke:~/tmp/cmake_tests/TestEnv/build$ ctest
Start processing tests
Test project /home/lowman/tmp/cmake_tests/TestEnv/build
1/ 1 Testing foo ***Failed
0% tests passed, 1 tests failed out of 1
The following tests FAILED:
1 - foo (Failed)
Errors while running CTest
=====================
CMakeLists.txt
=====================
project(Foo)
cmake_minimum_required(VERSION 2.6)
enable_testing(true)
add_executable(foo foo.cc)
add_test(foo foo)
set_tests_properties(foo PROPERTIES ENVIRONMENT foo=bar)
============================
foo.cc:
============================
#include <iostream>
#include <stdlib.h>
int main(int argc, char const* argv[])
{
char *foo = getenv("foo");
if(foo) std::cout << "foo = " << foo << std::endl;
else return 1;
return 0;
} |
|
|
(0015010)
|
Philip Lowman
|
2009-02-17 00:18
|
|
Index: cmTest.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTest.cxx,v
retrieving revision 1.11
diff -u -b -B -u -r1.11 cmTest.cxx
--- cmTest.cxx 7 Jan 2009 15:41:37 -0000 1.11
+++ cmTest.cxx 17 Feb 2009 05:16:51 -0000
@@ -122,6 +122,14 @@
"by setting MEASUREMENT to \"measurement=value\".");
cm->DefineProperty
+ ("ENVIRONMENT", cmProperty::TEST,
+ "Specify environment variables that should be defined before running "
+ "a test.",
+ "If set to a list of environment variables and values of the form "
+ "MYVAR=value those environment variables will be defined while "
+ "running the test.");
+
+ cm->DefineProperty
("PASS_REGULAR_EXPRESSION", cmProperty::TEST,
"The output must match this regular expression for the test to pass.",
"If set, the test output will be checked " |
|
|
(0015011)
|
Bill Hoffman
|
2009-02-17 09:21
|
|
This is closed. Just because it is not yet in a release does not mean the bug can not be closed. This will be in 2.8 when that comes out. |
|
|
(0015012)
|
Bill Hoffman
|
2009-02-17 09:30
|
|
Did you run the correct ctest?
ctest --version
make test will use a full path to ctest. |
|
|
(0015126)
|
Philip Lowman
|
2009-02-18 07:52
|
|
Yes, I was running the wrong version of ctest. Can't believe this didn't occur to me. |
|
|
(0015900)
|
David Cole
|
2009-04-03 11:43
|
|
Fixed in CVS HEAD of CMake
$ cvs commit -m "BUG: Fix documentation deficiency noted in issue 0007885. Thanks to Philip Lowman for the gist of the patch." Source/cmTest.cxx
/cvsroot/CMake/CMake/Source/cmTest.cxx,v <-- Source/cmTest.cxx
new revision: 1.14; previous revision: 1.13 |
|
|
(0024002)
|
David Cole
|
2010-12-14 18:45
|
|
Closing bugs that have been resolved for more than 3 months without any further updates. |
|