From: Arnaud Giersch Date: Thu, 3 Oct 2013 20:38:54 +0000 (+0200) Subject: Add tests to check that the expected context factory is really used. X-Git-Tag: v3_9_90~41^2~2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/658ccb0d0068d2d26b9da551ca3b28a24267057b?ds=sidebyside Add tests to check that the expected context factory is really used. --- diff --git a/buildtools/Cmake/AddTests.cmake b/buildtools/Cmake/AddTests.cmake index e3cbdb42cb..669bddce36 100644 --- a/buildtools/Cmake/AddTests.cmake +++ b/buildtools/Cmake/AddTests.cmake @@ -68,6 +68,21 @@ if(NOT enable_memcheck) ADD_TEST(xbt-parmap ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/parmap_test.tesh) # BEGIN CONTEXTS FACTORY + if(HAVE_RAWCTX) + ADD_TEST(simix_factory_default ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/factory_raw.tesh) + elseif(CONTEXT_UCONTEXT) + ADD_TEST(simix_factory_default ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/factory_ucontext.tesh) + else() + ADD_TEST(simix_factory_default ${TESH_COMMAND} ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/factory_thread.tesh) + endif() + ADD_TEST(simix_factory_thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/factory_thread.tesh) + if(HAVE_RAWCTX) + ADD_TEST(simix_factory_raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/factory_raw.tesh) + endif() + if(CONTEXT_UCONTEXT) + ADD_TEST(simix_factory_ucontext ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:ucontext --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/factory_ucontext.tesh) + endif() + ADD_TEST(tesh-msg-get-sender-thread ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:thread --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/get_sender.tesh) if(HAVE_RAWCTX) ADD_TEST(tesh-msg-get-sender-raw ${TESH_COMMAND} ${TESH_OPTION} --cfg contexts/factory:raw --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/get_sender.tesh) diff --git a/buildtools/Cmake/DefinePackages.cmake b/buildtools/Cmake/DefinePackages.cmake index 06cdde79f9..8629c550ad 100644 --- a/buildtools/Cmake/DefinePackages.cmake +++ b/buildtools/Cmake/DefinePackages.cmake @@ -912,6 +912,7 @@ set(TESHSUITE_CMAKEFILES_TXT teshsuite/simdag/network/p2p/CMakeLists.txt teshsuite/simdag/partask/CMakeLists.txt teshsuite/simdag/platforms/CMakeLists.txt + teshsuite/simix/CMakeLists.txt teshsuite/smpi/CMakeLists.txt teshsuite/smpi/mpich3-test/CMakeLists.txt teshsuite/smpi/mpich3-test/attr/CMakeLists.txt diff --git a/buildtools/Cmake/MakeExe.cmake b/buildtools/Cmake/MakeExe.cmake index d3c78d3683..51fb860084 100644 --- a/buildtools/Cmake/MakeExe.cmake +++ b/buildtools/Cmake/MakeExe.cmake @@ -84,6 +84,8 @@ add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/network/p2p) add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/partask) add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms) +add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/simix) + add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi) add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test) add_subdirectory(${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/attr) diff --git a/teshsuite/simix/CMakeLists.txt b/teshsuite/simix/CMakeLists.txt new file mode 100644 index 0000000000..4c789622b0 --- /dev/null +++ b/teshsuite/simix/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 2.6) + +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + +add_executable(check_defaults check_defaults.c) +target_link_libraries(check_defaults simgrid) + +set(tesh_files + ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/factory_raw.tesh + ${CMAKE_CURRENT_SOURCE_DIR}/factory_thread.tesh + ${CMAKE_CURRENT_SOURCE_DIR}/factory_ucontext.tesh + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + PARENT_SCOPE + ) +set(teshsuite_src + ${teshsuite_src} + ${CMAKE_CURRENT_SOURCE_DIR}/check_defaults.c + PARENT_SCOPE + ) +set(bin_files + ${bin_files} + PARENT_SCOPE + ) +set(txt_files + ${txt_files} + PARENT_SCOPE + ) diff --git a/teshsuite/simix/check_defaults.c b/teshsuite/simix/check_defaults.c new file mode 100644 index 0000000000..f1af0078e3 --- /dev/null +++ b/teshsuite/simix/check_defaults.c @@ -0,0 +1,18 @@ +/* check_defaults -- simple program displaying its context factory */ + +/* Copyright (c) 2013. The SimGrid Team. + * All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ + +#include "simgrid/simix.h" +#include "xbt/log.h" + +int main(int argc, char *argv[]) +{ + xbt_log_control_set("root.fmt:[%c/%p]%e%m%n"); + xbt_log_control_set("simix_context.threshold:verbose"); + SIMIX_global_init(&argc, argv); + return 0; +} diff --git a/teshsuite/simix/factory_raw.tesh b/teshsuite/simix/factory_raw.tesh new file mode 100644 index 0000000000..7fc2525b19 --- /dev/null +++ b/teshsuite/simix/factory_raw.tesh @@ -0,0 +1,2 @@ +$ ./simix/check_defaults +> [simix_context/VERBOSE] Using raw contexts. Because the glibc is just not good enough for us. diff --git a/teshsuite/simix/factory_thread.tesh b/teshsuite/simix/factory_thread.tesh new file mode 100644 index 0000000000..fdb9520fad --- /dev/null +++ b/teshsuite/simix/factory_thread.tesh @@ -0,0 +1,2 @@ +$ ./simix/check_defaults +> [simix_context/VERBOSE] Activating thread context factory diff --git a/teshsuite/simix/factory_ucontext.tesh b/teshsuite/simix/factory_ucontext.tesh new file mode 100644 index 0000000000..bf4130af82 --- /dev/null +++ b/teshsuite/simix/factory_ucontext.tesh @@ -0,0 +1,2 @@ +$ ./simix/check_defaults +> [simix_context/VERBOSE] Activating SYSV context factory