Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Also add the mpich3 binaries in the dependencies of make tests
[simgrid.git] / teshsuite / smpi / mpich3-test / attr / CMakeLists.txt
index d410c76..5d6930f 100644 (file)
@@ -1,6 +1,4 @@
-cmake_minimum_required(VERSION 2.6)
-
-if(enable_smpi)
+if(enable_smpi AND enable_smpi_MPICH3_testsuite)
   if(WIN32)
     set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
   else()
@@ -8,105 +6,25 @@ if(enable_smpi)
     set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
   endif()
 
-  set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
-  set(MPICH_FLAGS "-DHAVE_STDLIB_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DUSE_STDARG=1 -DHAVE_LONG_DOUBLE=1 -DHAVE_PROTOTYPES=1 -DHAVE_SIGNAL_H=1 -DHAVE_SIGACTION=1 -DHAVE_SLEEP=1 -DHAVE_SYSCONF=1")
-
-  include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
-  include_directories("${CMAKE_CURRENT_BINARY_DIR}/../include/")
-
-  add_executable(attr2type attr2type.c ../util/mtest.c)
-  add_executable(attrend2 attrend2.c ../util/mtest.c)
-  add_executable(attrend attrend.c ../util/mtest.c)
-  add_executable(attrerr attrerr.c ../util/mtest.c)
-  add_executable(attrerrcomm attrerrcomm.c ../util/mtest.c)
-  add_executable(attrerrtype attrerrtype.c ../util/mtest.c)
-  add_executable(attric attric.c ../util/mtest.c)
-  add_executable(attrorder attrorder.c ../util/mtest.c)
-  add_executable(attrordercomm attrordercomm.c ../util/mtest.c)
-  add_executable(attrordertype attrordertype.c ../util/mtest.c)
-  add_executable(attrt attrt.c ../util/mtest.c)
-  add_executable(baseattr2 baseattr2.c ../util/mtest.c)
-  add_executable(baseattrcomm baseattrcomm.c ../util/mtest.c)
-  add_executable(fkeyval fkeyval.c ../util/mtest.c)
-  add_executable(fkeyvalcomm fkeyvalcomm.c ../util/mtest.c)
-  add_executable(fkeyvaltype fkeyvaltype.c ../util/mtest.c)
-  add_executable(keyval_double_free keyval_double_free.c ../util/mtest.c)
-
+  include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
+  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
 
-  target_link_libraries(attr2type  simgrid)
-  target_link_libraries(attrend2 simgrid)
-  target_link_libraries(attrend simgrid)
-  target_link_libraries(attrerr simgrid)
-  target_link_libraries(attrerrcomm simgrid)
-  target_link_libraries(attrerrtype simgrid)
-  target_link_libraries(attric simgrid)
-  target_link_libraries(attrorder simgrid)
-  target_link_libraries(attrordercomm simgrid)
-  target_link_libraries(attrordertype simgrid)
-  target_link_libraries(attrt simgrid)
-  target_link_libraries(baseattr2 simgrid)
-  target_link_libraries(baseattrcomm simgrid)
-  target_link_libraries(fkeyval simgrid)
-  target_link_libraries(fkeyvalcomm simgrid)
-  target_link_libraries(fkeyvaltype simgrid)
-  target_link_libraries(keyval_double_free simgrid)
-
-
-  set_target_properties(attr2type  PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(attrend2 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(attrend PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(attrerr PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(attrerrcomm PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(attrerrtype PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(attric PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(attrorder PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(attrordercomm PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(attrordertype PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(attrt PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(baseattr2 PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(baseattrcomm PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(fkeyval PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(fkeyvalcomm PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(fkeyvaltype PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
-  set_target_properties(keyval_double_free PROPERTIES COMPILE_FLAGS "${MPICH_FLAGS}")
+  foreach(file attr2type attrdeleteget attrend2 attrend attrerr attrerrcomm attrerrtype attrorder attrordercomm attrordertype attrt
+          baseattr2 baseattrcomm fkeyval fkeyvalcomm fkeyvaltype keyval_double_free) #attric 
+    add_executable(${file} EXCLUDE_FROM_ALL ${file}.c)
+    add_dependencies(tests ${file})
+    target_link_libraries(${file} simgrid mtest_c)
+  endforeach()
+endif()
 
+if (enable_smpi_MPICH3_testsuite AND HAVE_RAW_CONTEXTS)
+  ADD_TEST(test-smpi-mpich3-attr-raw       ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/attr ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests "-wrapper=${TESH_WRAPPER}" -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/attr -tests=testlist -execarg=--cfg=contexts/factory:raw)
+  SET_TESTS_PROPERTIES(test-smpi-mpich3-attr-raw PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
 endif()
 
-set(tesh_files
-  ${tesh_files}
-  PARENT_SCOPE
-  )
-set(xml_files
-  ${xml_files}
-  PARENT_SCOPE
-  )
-set(examples_src
-  ${examples_src}
-  ${CMAKE_CURRENT_SOURCE_DIR}/attr2type.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/attrend2.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/attrend.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/attrerr.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/attrerrcomm.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/attrerrtype.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/attric.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/attrorder.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/attrordercomm.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/attrordertype.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/attrt.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/baseattr2.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/baseattrcomm.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/fkeyval.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/fkeyvalcomm.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/fkeyvaltype.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/keyval_double_free.c
-  PARENT_SCOPE
-  )
-set(bin_files
-  ${bin_files}
-  PARENT_SCOPE
-  )
-set(txt_files
-  ${txt_files}
-  ${CMAKE_CURRENT_SOURCE_DIR}/testlist
-  PARENT_SCOPE
-  )
+foreach(file attr2type attrdeleteget attrend2 attrend attrerr attrerrcomm attrerrtype attrorder attrordercomm attrordertype attrt
+        baseattr2 baseattrcomm fkeyval attric fkeyvalcomm fkeyvaltype keyval_double_free keyval_double_free_comm keyval_double_free_type keyval_double_free_win)
+  set(examples_src  ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/${file}.c)
+endforeach()
+set(examples_src  ${examples_src}                                        PARENT_SCOPE)
+set(txt_files     ${txt_files}     ${CMAKE_CURRENT_SOURCE_DIR}/testlist  PARENT_SCOPE)