From db1df4b379b3e088b50f6e573ba9b0887b59c96a Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Wed, 4 Jul 2018 10:07:30 +0200 Subject: [PATCH] better integration of the new MC unit tests Same functionalities than before, but leveraging boost_unit_test instead of our own unit testing. --- src/mc/snapshot/unitTest/PageStore_unit.cpp | 134 --------- src/mc/snapshot/unitTest/mc_snapshot_unit.cpp | 239 ---------------- src/mc/sosp/PageStore_test.cpp | 149 ++++++++++ src/mc/sosp/mc_snapshot_test.cpp | 257 ++++++++++++++++++ tools/cmake/DefinePackages.cmake | 2 + tools/cmake/Tests.cmake | 28 +- 6 files changed, 422 insertions(+), 387 deletions(-) delete mode 100644 src/mc/snapshot/unitTest/PageStore_unit.cpp delete mode 100644 src/mc/snapshot/unitTest/mc_snapshot_unit.cpp create mode 100644 src/mc/sosp/PageStore_test.cpp create mode 100644 src/mc/sosp/mc_snapshot_test.cpp diff --git a/src/mc/snapshot/unitTest/PageStore_unit.cpp b/src/mc/snapshot/unitTest/PageStore_unit.cpp deleted file mode 100644 index 6a33e9e4c6..0000000000 --- a/src/mc/snapshot/unitTest/PageStore_unit.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/* Copyright (c) 2015-2018. 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. */ - -#define BOOST_TEST_MODULE PAGESTORE -#define BOOST_TEST_DYN_LINK -#include - -#include -#include -#include - -#include -#include - -#include - -#include "src/mc/sosp/PageStore.hpp" - -using simgrid::mc::PageStore; - -/***********************************/ -// a class to hold the variable used in the test cases -class BOOST_tests { - public: - static std::size_t pagesize; - static std::unique_ptr store; - static void* data; - static size_t pageno1, pageno2, pageno3, pageno4; - static int value; - public: // member functions used by the test suite(s) - static void Init(); - static void store_page_once(); - static void store_same_page(); - static void store_new_page(); - static void unref_pages(); - static void reallocate_page(); - - static void new_content(void* data, std::size_t size); - static void* getpage(); -}; - -// static member datat initialization -std::size_t BOOST_tests::pagesize = 0; -std::unique_ptr BOOST_tests::store = nullptr; -void* BOOST_tests::data = nullptr; -size_t BOOST_tests::pageno1 = 0; -size_t BOOST_tests::pageno2 = 0; -size_t BOOST_tests::pageno3 = 0; -size_t BOOST_tests::pageno4 = 0; -int BOOST_tests::value = 0; - -void BOOST_tests::Init() { - pagesize = (size_t) getpagesize(); - store = std::unique_ptr(new simgrid::mc::PageStore(500)); - data = getpage(); - BOOST_CHECK_MESSAGE(store->size()==0, "Bad size"); -} - -void BOOST_tests::store_page_once() { - new_content(data, pagesize); - pageno1 = store->store_page(data); - BOOST_CHECK_MESSAGE(store->get_ref(pageno1)==1, "Bad refcount"); - const void* copy = store->get_page(pageno1); - BOOST_CHECK_MESSAGE(::memcmp(data, copy, pagesize)==0, "Page data should be the same"); - BOOST_CHECK_MESSAGE(store->size()==1, "Bad size"); -} - -void BOOST_tests::store_same_page() { - pageno2 = store->store_page(data); - BOOST_CHECK_MESSAGE(pageno1==pageno2, "Page should be the same"); - BOOST_CHECK_MESSAGE(store->get_ref(pageno1)==2, "Bad refcount"); - BOOST_CHECK_MESSAGE(store->size()==1, "Bad size"); -} - -void BOOST_tests::store_new_page() { - new_content(data, pagesize); - pageno3 = store->store_page(data); - BOOST_CHECK_MESSAGE(pageno1 != pageno3, "New page should be different"); - BOOST_CHECK_MESSAGE(store->size()==2, "Bad size"); -} - -void BOOST_tests::unref_pages() { - store->unref_page(pageno1); - BOOST_CHECK_MESSAGE(store->get_ref(pageno1)==1, "Bad refcount"); - BOOST_CHECK_MESSAGE(store->size()==2, "Bad size"); - store->unref_page(pageno2); - BOOST_CHECK_MESSAGE(store->size()==1, "Bad size"); -} - -void BOOST_tests::reallocate_page() { - new_content(data, pagesize); - pageno4 = store->store_page(data); - BOOST_CHECK_MESSAGE(pageno1 == pageno4, "Page was not reused"); - BOOST_CHECK_MESSAGE(store->get_ref(pageno4)==1, "Bad refcount"); - BOOST_CHECK_MESSAGE(store->size()==2, "Bad size"); -} - -void BOOST_tests::new_content(void* data, std::size_t size) { - ::memset(data, ++value, size); -} - -void* BOOST_tests::getpage() { - return mmap(nullptr, getpagesize(), PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); -} - -namespace utf = boost::unit_test; // for test case dependence - -BOOST_AUTO_TEST_SUITE(PAGESTORE) -BOOST_AUTO_TEST_CASE(Init) { - BOOST_tests::Init(); -} - -BOOST_AUTO_TEST_CASE(store_page_once, * utf::depends_on("PAGESTORE/Init")) { - BOOST_tests::store_page_once(); -} - -BOOST_AUTO_TEST_CASE(store_same_page, * utf::depends_on("PAGESTORE/store_page_once")) { - BOOST_tests::store_same_page(); -} - -BOOST_AUTO_TEST_CASE(store_new_page, * utf::depends_on("PAGESTORE/store_same_page")) { - BOOST_tests::store_new_page(); -} - -BOOST_AUTO_TEST_CASE(unref_pages, * utf::depends_on("PAGESTORE/store_new_page")) { - BOOST_tests::unref_pages(); -} - -BOOST_AUTO_TEST_CASE(reallocate_page, * utf::depends_on("PAGESTORE/unref_pages")) { - BOOST_tests::reallocate_page(); -} -BOOST_AUTO_TEST_SUITE_END() diff --git a/src/mc/snapshot/unitTest/mc_snapshot_unit.cpp b/src/mc/snapshot/unitTest/mc_snapshot_unit.cpp deleted file mode 100644 index ef2d0dab3a..0000000000 --- a/src/mc/snapshot/unitTest/mc_snapshot_unit.cpp +++ /dev/null @@ -1,239 +0,0 @@ -/* Copyright (c) 2014-2018. 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. */ - -#define BOOST_TEST_MODULE snapshots -#define BOOST_TEST_DYN_LINK -#include - -#include -#include - -#include - -#include "src/mc/mc_config.hpp" -#include "src/mc/mc_mmu.hpp" -#include "src/mc/mc_private.hpp" -#include "src/mc/sosp/mc_snapshot.hpp" - -/**************** Class BOOST_tests *************************/ -using simgrid::mc::RegionSnapshot; -class BOOST_tests { - public: - static void init_memory(void* mem, size_t size); - static void Init(bool sparse_ckpt); - typedef struct { - size_t size; - void* src; - void* dstn; - RegionSnapshot region0; - RegionSnapshot region; - } prologue_return; - static prologue_return prologue(int n); // common to the below 5 fxs - static void read_whole_region(); - static void read_region_parts(); - static void compare_whole_region(); - static void compare_region_parts(); - static void read_pointer(); - - static void cleanup() { - delete mc_model_checker; - mc_model_checker = nullptr; - } - - public: - static bool sparse_checkpoint; - static std::unique_ptr process; -}; - -// static member variables init. -bool BOOST_tests::sparse_checkpoint = 0; -std::unique_ptr BOOST_tests::process = nullptr; - -void -BOOST_tests::init_memory(void* mem, size_t size) { - char* dest = (char*) mem; - for (size_t i = 0; i < size; ++i) { - dest[i] = rand() & 255; - } -} - -void -BOOST_tests::Init(bool sparse_ckpt) { - _sg_mc_sparse_checkpoint = sparse_ckpt; - BOOST_CHECK_EQUAL(xbt_pagesize, getpagesize()); - BOOST_CHECK_EQUAL(1 << xbt_pagebits, xbt_pagesize); - - process = std::unique_ptr(new simgrid::mc::RemoteClient(getpid(), -1)); - process->init(); - mc_model_checker = new ::simgrid::mc::ModelChecker(std::move(process)); -} - - -BOOST_tests::prologue_return BOOST_tests::prologue(int n) { - // Store region page(s): - size_t byte_size = n * xbt_pagesize; - void* source = mmap(nullptr, byte_size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); - BOOST_CHECK_MESSAGE(source!=MAP_FAILED, "Could not allocate source memory"); - - // Init memory and take snapshots: - init_memory(source, byte_size); - simgrid::mc::RegionSnapshot region0 = simgrid::mc::sparse_region( - simgrid::mc::RegionType::Unknown, source, source, byte_size); - for(int i=0; i + +#include +#include +#include + +#include +#include + +#include + +#include "src/mc/sosp/PageStore.hpp" + +using simgrid::mc::PageStore; + +/***********************************/ +// a class to hold the variable used in the test cases +class BOOST_tests { +public: + static std::size_t pagesize; + static std::unique_ptr store; + static void* data; + static size_t pageno1, pageno2, pageno3, pageno4; + static int value; + +public: // member functions used by the test suite(s) + static void Init(); + static void store_page_once(); + static void store_same_page(); + static void store_new_page(); + static void unref_pages(); + static void reallocate_page(); + + static void new_content(void* data, std::size_t size); + static void* getpage(); +}; + +// static member datat initialization +std::size_t BOOST_tests::pagesize = 0; +std::unique_ptr BOOST_tests::store = nullptr; +void* BOOST_tests::data = nullptr; +size_t BOOST_tests::pageno1 = 0; +size_t BOOST_tests::pageno2 = 0; +size_t BOOST_tests::pageno3 = 0; +size_t BOOST_tests::pageno4 = 0; +int BOOST_tests::value = 0; + +void BOOST_tests::Init() +{ + pagesize = (size_t)getpagesize(); + store = std::unique_ptr(new simgrid::mc::PageStore(500)); + data = getpage(); + BOOST_CHECK_MESSAGE(store->size() == 0, "Bad size"); +} + +void BOOST_tests::store_page_once() +{ + new_content(data, pagesize); + pageno1 = store->store_page(data); + BOOST_CHECK_MESSAGE(store->get_ref(pageno1) == 1, "Bad refcount"); + const void* copy = store->get_page(pageno1); + BOOST_CHECK_MESSAGE(::memcmp(data, copy, pagesize) == 0, "Page data should be the same"); + BOOST_CHECK_MESSAGE(store->size() == 1, "Bad size"); +} + +void BOOST_tests::store_same_page() +{ + pageno2 = store->store_page(data); + BOOST_CHECK_MESSAGE(pageno1 == pageno2, "Page should be the same"); + BOOST_CHECK_MESSAGE(store->get_ref(pageno1) == 2, "Bad refcount"); + BOOST_CHECK_MESSAGE(store->size() == 1, "Bad size"); +} + +void BOOST_tests::store_new_page() +{ + new_content(data, pagesize); + pageno3 = store->store_page(data); + BOOST_CHECK_MESSAGE(pageno1 != pageno3, "New page should be different"); + BOOST_CHECK_MESSAGE(store->size() == 2, "Bad size"); +} + +void BOOST_tests::unref_pages() +{ + store->unref_page(pageno1); + BOOST_CHECK_MESSAGE(store->get_ref(pageno1) == 1, "Bad refcount"); + BOOST_CHECK_MESSAGE(store->size() == 2, "Bad size"); + store->unref_page(pageno2); + BOOST_CHECK_MESSAGE(store->size() == 1, "Bad size"); +} + +void BOOST_tests::reallocate_page() +{ + new_content(data, pagesize); + pageno4 = store->store_page(data); + BOOST_CHECK_MESSAGE(pageno1 == pageno4, "Page was not reused"); + BOOST_CHECK_MESSAGE(store->get_ref(pageno4) == 1, "Bad refcount"); + BOOST_CHECK_MESSAGE(store->size() == 2, "Bad size"); +} + +void BOOST_tests::new_content(void* data, std::size_t size) +{ + ::memset(data, ++value, size); +} + +void* BOOST_tests::getpage() +{ + return mmap(nullptr, getpagesize(), PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); +} + +namespace utf = boost::unit_test; // for test case dependence + +BOOST_AUTO_TEST_SUITE(PAGESTORE) +BOOST_AUTO_TEST_CASE(Init) +{ + BOOST_tests::Init(); +} + +BOOST_AUTO_TEST_CASE(store_page_once, *utf::depends_on("PAGESTORE/Init")) +{ + BOOST_tests::store_page_once(); +} + +BOOST_AUTO_TEST_CASE(store_same_page, *utf::depends_on("PAGESTORE/store_page_once")) +{ + BOOST_tests::store_same_page(); +} + +BOOST_AUTO_TEST_CASE(store_new_page, *utf::depends_on("PAGESTORE/store_same_page")) +{ + BOOST_tests::store_new_page(); +} + +BOOST_AUTO_TEST_CASE(unref_pages, *utf::depends_on("PAGESTORE/store_new_page")) +{ + BOOST_tests::unref_pages(); +} + +BOOST_AUTO_TEST_CASE(reallocate_page, *utf::depends_on("PAGESTORE/unref_pages")) +{ + BOOST_tests::reallocate_page(); +} +BOOST_AUTO_TEST_SUITE_END() diff --git a/src/mc/sosp/mc_snapshot_test.cpp b/src/mc/sosp/mc_snapshot_test.cpp new file mode 100644 index 0000000000..51f8b130ea --- /dev/null +++ b/src/mc/sosp/mc_snapshot_test.cpp @@ -0,0 +1,257 @@ +/* Copyright (c) 2014-2018. 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. */ + +#define BOOST_TEST_MODULE snapshots +#define BOOST_TEST_DYN_LINK +#include + +#include +#include + +#include + +#include "src/mc/mc_config.hpp" +#include "src/mc/mc_mmu.hpp" +#include "src/mc/mc_private.hpp" +#include "src/mc/sosp/mc_snapshot.hpp" + +/**************** Class BOOST_tests *************************/ +using simgrid::mc::RegionSnapshot; +class BOOST_tests { +public: + static void init_memory(void* mem, size_t size); + static void Init(bool sparse_ckpt); + typedef struct { + size_t size; + void* src; + void* dstn; + RegionSnapshot region0; + RegionSnapshot region; + } prologue_return; + static prologue_return prologue(int n); // common to the below 5 fxs + static void read_whole_region(); + static void read_region_parts(); + static void compare_whole_region(); + static void compare_region_parts(); + static void read_pointer(); + + static void cleanup() + { + delete mc_model_checker; + mc_model_checker = nullptr; + } + +public: + static bool sparse_checkpoint; + static std::unique_ptr process; +}; + +// static member variables init. +bool BOOST_tests::sparse_checkpoint = 0; +std::unique_ptr BOOST_tests::process = nullptr; + +void BOOST_tests::init_memory(void* mem, size_t size) +{ + char* dest = (char*)mem; + for (size_t i = 0; i < size; ++i) { + dest[i] = rand() & 255; + } +} + +void BOOST_tests::Init(bool sparse_ckpt) +{ + _sg_mc_sparse_checkpoint = sparse_ckpt; + BOOST_CHECK_EQUAL(xbt_pagesize, getpagesize()); + BOOST_CHECK_EQUAL(1 << xbt_pagebits, xbt_pagesize); + + process = std::unique_ptr(new simgrid::mc::RemoteClient(getpid(), -1)); + process->init(); + mc_model_checker = new ::simgrid::mc::ModelChecker(std::move(process)); +} + +BOOST_tests::prologue_return BOOST_tests::prologue(int n) +{ + // Store region page(s): + size_t byte_size = n * xbt_pagesize; + void* source = mmap(nullptr, byte_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + BOOST_CHECK_MESSAGE(source != MAP_FAILED, "Could not allocate source memory"); + + // Init memory and take snapshots: + init_memory(source, byte_size); + simgrid::mc::RegionSnapshot region0 = + simgrid::mc::sparse_region(simgrid::mc::RegionType::Unknown, source, source, byte_size); + for (int i = 0; i < n; i += 2) { + init_memory((char*)source + i * xbt_pagesize, xbt_pagesize); + } + simgrid::mc::RegionSnapshot region = + simgrid::mc::sparse_region(simgrid::mc::RegionType::Unknown, source, source, byte_size); + + void* destination = mmap(nullptr, byte_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + BOOST_CHECK_MESSAGE(source != MAP_FAILED, "Could not allocate destination memory"); + + return {.size = byte_size, + .src = source, + .dstn = destination, + .region0 = std::move(region0), + .region = std::move(region)}; +} + +void BOOST_tests::read_whole_region() +{ + for (int n = 1; n != 256; ++n) { + + prologue_return ret = prologue(n); + const void* read = MC_region_read(&(ret.region), ret.dstn, ret.src, ret.size); + BOOST_CHECK_MESSAGE(not memcmp(ret.src, read, ret.size), "Mismatch in MC_region_read()"); + + munmap(ret.dstn, ret.size); + munmap(ret.src, ret.size); + } +} + +void BOOST_tests::read_region_parts() +{ + for (int n = 1; n != 256; ++n) { + + prologue_return ret = prologue(n); + + for (int j = 0; j != 100; ++j) { + size_t offset = rand() % ret.size; + size_t size = rand() % (ret.size - offset); + const void* read = MC_region_read(&(ret.region), ret.dstn, (const char*)ret.src + offset, size); + BOOST_CHECK_MESSAGE(not memcmp((char*)ret.src + offset, read, size), "Mismatch in MC_region_read()"); + } + munmap(ret.dstn, ret.size); + munmap(ret.src, ret.size); + } +} + +void BOOST_tests::compare_whole_region() +{ + for (int n = 1; n != 256; ++n) { + + prologue_return ret = prologue(n); + + BOOST_CHECK_MESSAGE(MC_snapshot_region_memcmp(ret.src, &(ret.region0), ret.src, &(ret.region), ret.size), + "Unexpected match in MC_snapshot_region_memcmp() with previous snapshot"); + + munmap(ret.dstn, ret.size); + munmap(ret.src, ret.size); + } +} + +void BOOST_tests::compare_region_parts() +{ + for (int n = 1; n != 256; ++n) { + + prologue_return ret = prologue(n); + + // xbt_test_add("Compare parts of region data for %i page(s) with itself", n); + for (int j = 0; j != 100; ++j) { + size_t offset = rand() % ret.size; + size_t size = rand() % (ret.size - offset); + BOOST_CHECK_MESSAGE(not MC_snapshot_region_memcmp((char*)ret.src + offset, &(ret.region), (char*)ret.src + offset, + &(ret.region), size), + "Mismatch in MC_snapshot_region_memcmp()"); + } + munmap(ret.dstn, ret.size); + munmap(ret.src, ret.size); + } +} + +void BOOST_tests::read_pointer() +{ + + prologue_return ret = prologue(1); + // xbt_test_add("Read pointer for %i page(s)", n); + memcpy(ret.src, &mc_model_checker, sizeof(void*)); + simgrid::mc::RegionSnapshot region2 = + simgrid::mc::sparse_region(simgrid::mc::RegionType::Unknown, ret.src, ret.src, ret.size); + BOOST_CHECK_MESSAGE(MC_region_read_pointer(®ion2, ret.src) == mc_model_checker, + "Mismtach in MC_region_read_pointer()"); + + munmap(ret.dstn, ret.size); + munmap(ret.src, ret.size); +} + +/*************** End: class BOOST_tests *****************************/ + +namespace utf = boost::unit_test; // for test case dependence + +BOOST_AUTO_TEST_SUITE(flat_snapshot) +BOOST_AUTO_TEST_CASE(Init) +{ + BOOST_tests::Init(0); +} + +BOOST_AUTO_TEST_CASE(read_whole_region, *utf::depends_on("flat_snapshot/Init")) +{ + BOOST_tests::read_whole_region(); +} + +BOOST_AUTO_TEST_CASE(read_region_parts, *utf::depends_on("flat_snapshot/read_whole_region")) +{ + BOOST_tests::read_region_parts(); +} + +BOOST_AUTO_TEST_CASE(compare_whole_region, *utf::depends_on("flat_snapshot/read_region_parts")) +{ + BOOST_tests::compare_whole_region(); +} + +BOOST_AUTO_TEST_CASE(compare_region_parts, *utf::depends_on("flat_snapshot/compare_whole_region")) +{ + BOOST_tests::compare_region_parts(); +} + +BOOST_AUTO_TEST_CASE(read_pointer, *utf::depends_on("flat_snapshot/compare_region_parts")) +{ + BOOST_tests::read_pointer(); +} + +// not really a test, just for cleanup the resources +BOOST_AUTO_TEST_CASE(cleanup, *utf::depends_on("flat_snapshot/read_pointer")) +{ + BOOST_tests::cleanup(); +} +BOOST_AUTO_TEST_SUITE_END() + +BOOST_AUTO_TEST_SUITE(page_snapshots) +BOOST_AUTO_TEST_CASE(Init) +{ + BOOST_tests::Init(1); +} + +BOOST_AUTO_TEST_CASE(read_whole_region, *utf::depends_on("page_snapshots/Init")) +{ + BOOST_tests::read_whole_region(); +} + +BOOST_AUTO_TEST_CASE(read_region_parts, *utf::depends_on("page_snapshots/read_whole_region")) +{ + BOOST_tests::read_region_parts(); +} + +BOOST_AUTO_TEST_CASE(compare_whole_region, *utf::depends_on("page_snapshots/read_region_parts")) +{ + BOOST_tests::compare_whole_region(); +} + +BOOST_AUTO_TEST_CASE(compare_region_parts, *utf::depends_on("page_snapshots/compare_whole_region")) +{ + BOOST_tests::compare_region_parts(); +} + +BOOST_AUTO_TEST_CASE(read_pointer, *utf::depends_on("page_snapshots/compare_region_parts")) +{ + BOOST_tests::read_pointer(); +} + +// not really a test, just for cleanup the resources +BOOST_AUTO_TEST_CASE(cleanup, *utf::depends_on("page_snapshots/read_pointer")) +{ + BOOST_tests::cleanup(); +} +BOOST_AUTO_TEST_SUITE_END() diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index 881846683f..9b9281354c 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -43,6 +43,8 @@ set(EXTRA_DIST src/surf/network_ib.hpp src/surf/ns3/ns3_simulator.hpp src/surf/trace_mgr_test.cpp + src/mc/sosp/mc_snapshot_test.cpp + src/mc/sosp/PageStore_test.cpp src/surf/xml/simgrid.dtd src/surf/xml/simgrid_dtd.h src/surf/xml/simgrid_dtd.c diff --git a/tools/cmake/Tests.cmake b/tools/cmake/Tests.cmake index 8ce1386d0e..d0968fff0c 100644 --- a/tools/cmake/Tests.cmake +++ b/tools/cmake/Tests.cmake @@ -90,38 +90,38 @@ ADD_TEST(testall ${CMAKE_BINARY_DIR}/testall) # New tests should use the Boost Unit Test Framework if(Boost_UNIT_TEST_FRAMEWORK_FOUND) - add_executable (unit_tmgr src/surf/trace_mgr_test.cpp) add_library(boost_unit_test_framework SHARED IMPORTED) set_target_properties(boost_unit_test_framework PROPERTIES IMPORTED_LOCATION ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) - target_link_libraries(unit_tmgr simgrid boost_unit_test_framework) - ADD_TEST(unit_tmgr ${CMAKE_BINARY_DIR}/unit_tmgr --build_info=yes) + + add_executable (unit-tmgr src/surf/trace_mgr_test.cpp) + target_link_libraries(unit-tmgr simgrid boost_unit_test_framework) + ADD_TEST(unit-tmgr ${CMAKE_BINARY_DIR}/unit-tmgr --build_info=yes) set_property( - TARGET unit_tmgr + TARGET unit-tmgr APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}" ) if (SIMGRID_HAVE_MC) # snapshot - add_executable (unit_snapshot src/mc/snapshot/unitTest/mc_snapshot_unit.cpp) - target_link_libraries(unit_snapshot simgrid boost_unit_test_framework) - ADD_TEST(unit_snapshot ${CMAKE_BINARY_DIR}/unit_snapshot --build_info=yes) + add_executable (unit-mc-snapshot src/mc/sosp/mc_snapshot_test.cpp) + target_link_libraries(unit-mc-snapshot simgrid boost_unit_test_framework) + ADD_TEST(unit-mc-snapshot ${CMAKE_BINARY_DIR}/unit-mc-snapshot --build_info=yes) set_property( - TARGET unit_snapshot + TARGET unit-mc-snapshot APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}" ) - # PAGESTORE - add_executable (unit_PAGESTORE src/mc/snapshot/unitTest/PageStore_unit.cpp) - target_link_libraries(unit_PAGESTORE simgrid boost_unit_test_framework) - ADD_TEST(unit_PAGESTORE ${CMAKE_BINARY_DIR}/unit_PAGESTORE --build_info=yes) + # pagestore + add_executable (unit-mc-pagestore src/mc/sosp/PageStore_test.cpp) + target_link_libraries(unit-mc-pagestore simgrid boost_unit_test_framework) + ADD_TEST(unit-mc-pagestore ${CMAKE_BINARY_DIR}/unit-mc-pagestore --build_info=yes) set_property( - TARGET unit_PAGESTORE + TARGET unit-mc-pagestore APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}" ) endif() - else() set(EXTRA_DIST ${EXTRA_DIST} src/surf/trace_mgr_test.cpp) endif() -- 2.20.1