Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cunit: make it work (again) with C++ test suites
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 2 Mar 2016 12:44:36 +0000 (13:44 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 2 Mar 2016 12:44:43 +0000 (13:44 +0100)
src/xbt/cunit.c
tools/cmake/UnitTesting.cmake

index b8353b4..5235db6 100644 (file)
@@ -7,6 +7,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 /* This is partially inspirated from the OSSP ts (Test Suite Library)       */
+/* At some point we should use https://github.com/google/googletest instead */
 
 #include "src/portable.h"
 
index 1417fef..fe83e00 100644 (file)
@@ -27,7 +27,8 @@ endif()
 
 foreach(file ${FILES_CONTAINING_UNITTESTS})
   get_filename_component(basename ${file} NAME_WE)
-  set(EXTRACTED_TEST_SOURCE_FILES ${EXTRACTED_TEST_SOURCE_FILES} ${CMAKE_CURRENT_BINARY_DIR}/src/${basename}_unit.c)
+  get_filename_component(ext ${file} EXT)
+  set(EXTRACTED_TEST_SOURCE_FILES ${EXTRACTED_TEST_SOURCE_FILES} ${CMAKE_CURRENT_BINARY_DIR}/src/${basename}_unit${ext})
 endforeach()
   
 set(EXTRACTED_TEST_SOURCE_FILES ${EXTRACTED_TEST_SOURCE_FILES} ${CMAKE_CURRENT_BINARY_DIR}/src/simgrid_units_main.c)