You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@etch.apache.org by fi...@apache.org on 2011/07/23 22:40:40 UTC

svn commit: r1150217 - in /incubator/etch/trunk/binding-cpp/runtime: CMakeLists.txt src/test/CMakeLists.txt src/test/main.cpp

Author: fitzner
Date: Sat Jul 23 20:40:39 2011
New Revision: 1150217

URL: http://svn.apache.org/viewvc?rev=1150217&view=rev
Log:
ETCH-152 build server integration

Add settings to enable memory leak detection for binding-cpp on windows builds

Added:
    incubator/etch/trunk/binding-cpp/runtime/src/test/main.cpp
Modified:
    incubator/etch/trunk/binding-cpp/runtime/CMakeLists.txt
    incubator/etch/trunk/binding-cpp/runtime/src/test/CMakeLists.txt

Modified: incubator/etch/trunk/binding-cpp/runtime/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/CMakeLists.txt?rev=1150217&r1=1150216&r2=1150217&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/CMakeLists.txt (original)
+++ incubator/etch/trunk/binding-cpp/runtime/CMakeLists.txt Sat Jul 23 20:40:39 2011
@@ -27,10 +27,12 @@ ENDIF (NOT ETCH_EXTERNAL_DEPENDS)
 #VLD
 SET(VLD ${ETCH_EXTERNAL_DEPENDS}/vld/1.9h)
 
-
 # GTest
 SET(GTEST ${ETCH_EXTERNAL_DEPENDS}/gtest/1.6.0)
 
+# Set build settings
+SET(BUILD_CHECK_MEMORY FALSE)
+
 # Set definitions
 IF (UNIX)
   add_definitions (-D_GNU_SOURCE -D_REENTRANT -DLINUX=2 -D__LINUX__)

Modified: incubator/etch/trunk/binding-cpp/runtime/src/test/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/test/CMakeLists.txt?rev=1150217&r1=1150216&r2=1150217&view=diff
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/test/CMakeLists.txt (original)
+++ incubator/etch/trunk/binding-cpp/runtime/src/test/CMakeLists.txt Sat Jul 23 20:40:39 2011
@@ -20,13 +20,12 @@ include_directories (${PROJECT_SOURCE_DI
 include_directories (${GTEST})
 include_directories (${GTEST}/include)
 
-IF (WIN32)
+IF (WIN32 AND BUILD_CHECK_MEMORY)
   include_directories (${VLD}/include)
-ENDIF (WIN32)
+  add_definitions (-DBUILD_CHECK_MEMORY)
+ENDIF (WIN32 AND BUILD_CHECK_MEMORY)
 
 add_executable (etch-cpp-test
-    ${GTEST}/src/gtest-all.cc
-    ${GTEST}/src/gtest_main.cc
     common/EtchInt32Test.cpp
     common/EtchBoolTest.cpp
     common/EtchByteTest.cpp
@@ -38,13 +37,19 @@ add_executable (etch-cpp-test
     common/EtchObjectTest.cpp
     common/EtchListTest.cpp
     util/EtchUtilTest.cpp
+    ${GTEST}/src/gtest-all.cc
+    main.cpp
 )
 
 target_link_libraries (etch-cpp-test etch-cpp)
 
-IF (WIN32)
+IF (WIN32 AND BUILD_CHECK_MEMORY)
+  file (COPY ${VLD}/vld.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})
+  file (COPY ${VLD}/bin/dbghelp.dll DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})
+  file (COPY ${VLD}/bin/vld.dll DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})
+
   target_link_libraries (etch-cpp-test ${VLD}/lib/vld.lib)
-ENDIF (WIN32)
+ENDIF (WIN32 AND BUILD_CHECK_MEMORY)
 
 IF (UNIX)
   set_target_properties (etch-cpp-test PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32 -pthread")

Added: incubator/etch/trunk/binding-cpp/runtime/src/test/main.cpp
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-cpp/runtime/src/test/main.cpp?rev=1150217&view=auto
==============================================================================
--- incubator/etch/trunk/binding-cpp/runtime/src/test/main.cpp (added)
+++ incubator/etch/trunk/binding-cpp/runtime/src/test/main.cpp Sat Jul 23 20:40:39 2011
@@ -0,0 +1,33 @@
+/* $Id$ 
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
+ * contributor license agreements. See the NOTICE file distributed with  
+ * this work for additional information regarding copyright ownership. 
+ * The ASF licenses this file to you under the Apache License, Version  
+ * 2.0 (the "License"); you may not use this file except in compliance  
+ * with the License. You may obtain a copy of the License at 
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0 
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and 
+ * limitations under the License. 
+ */
+
+#ifdef BUILD_CHECK_MEMORY
+#ifdef WIN32
+#include "vld.h"
+#endif
+#endif
+
+#include <iostream>
+#include "gtest/gtest.h"
+
+GTEST_API_ int main(int argc, char **argv) {
+  std::cout << "Running etch-cpp tests\n";
+
+  testing::InitGoogleTest(&argc, argv);
+  return RUN_ALL_TESTS();
+}
\ No newline at end of file