diff --git a/unittest/commands/CMakeLists.txt b/unittest/commands/CMakeLists.txt index 0fb0c8088e..6c68bfb274 100644 --- a/unittest/commands/CMakeLists.txt +++ b/unittest/commands/CMakeLists.txt @@ -3,17 +3,22 @@ if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows") ExternalProject_Add(plugins SOURCE_DIR "${LAMMPS_DIR}/examples/plugins" - BINARY_DIR "${CMAKE_BINARY_DIR}/plugins" + BINARY_DIR ${CMAKE_BINARY_DIR}/build-plugins + INSTALL_DIR ${CMAKE_BINARY_DIR} CMAKE_ARGS ${CMAKE_REQUEST_PIC} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_INSTALL_PREFIX= -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} - BUILD_BYPRODUCTS /morse2plugin${CMAKE_STATIC_LIBRARY_SUFFIX} - /nve2plugin${CMAKE_STATIC_LIBRARY_SUFFIX} - /helloplugin${CMAKE_STATIC_LIBRARY_SUFFIX} - INSTALL_COMMAND "" + BUILD_BYPRODUCTS /morse2plugin${CMAKE_SHARED_LIBRARY_SUFFIX} + /nve2plugin${CMAKE_SHARED_LIBRARY_SUFFIX} + /helloplugin${CMAKE_SHARED_LIBRARY_SUFFIX} + INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different + /morse2plugin${CMAKE_SHARED_LIBRARY_SUFFIX} + /nve2plugin${CMAKE_SHARED_LIBRARY_SUFFIX} + /helloplugin${CMAKE_SHARED_LIBRARY_SUFFIX} + ${CMAKE_CURRENT_BINARY_DIR} TEST_COMMAND "") endif() diff --git a/unittest/commands/test_simple_commands.cpp b/unittest/commands/test_simple_commands.cpp index 08fe53a6b9..0e26734dfb 100644 --- a/unittest/commands/test_simple_commands.cpp +++ b/unittest/commands/test_simple_commands.cpp @@ -347,9 +347,9 @@ TEST_F(SimpleCommandsTest, Units) TEST_F(SimpleCommandsTest, Plugin) { #if defined(__APPLE__) - std::string loadfmt("plugin load plugins/{}plugin.dylib"); + std::string loadfmt("plugin load {}plugin.dylib"); #else - std::string loadfmt("plugin load plugins/{}plugin.so"); + std::string loadfmt("plugin load {}plugin.so"); #endif ::testing::internal::CaptureStdout(); lmp->input->one(fmt::format(loadfmt, "hello")); @@ -361,7 +361,7 @@ TEST_F(SimpleCommandsTest, Plugin) lmp->input->one(fmt::format(loadfmt, "xxx")); text = ::testing::internal::GetCapturedStdout(); if (verbose) std::cout << text; - ASSERT_THAT(text, MatchesRegex(".*Open of file plugins/xxx.* failed.*")); + ASSERT_THAT(text, MatchesRegex(".*Open of file xxx.* failed.*")); ::testing::internal::CaptureStdout(); lmp->input->one(fmt::format(loadfmt, "nve2"));