Skip to content

Commit

Permalink
tests: test-dir-plugins works
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorz committed Dec 6, 2019
1 parent 7574946 commit d33e561
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
2 changes: 2 additions & 0 deletions core/CMakeLists.txt
Expand Up @@ -165,6 +165,8 @@ IF (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
string(APPEND WINEPATH "Z:${CMAKE_CURRENT_BINARY_DIR}/src/lib\\\\;")
string(APPEND WINEPATH "Z:${CMAKE_CURRENT_BINARY_DIR}/src/fastlz\\\\;")
string(APPEND WINEPATH "Z:${CMAKE_CURRENT_BINARY_DIR}/src/findlib\\\\;")
string(APPEND WINEPATH "Z:${CMAKE_CURRENT_BINARY_DIR}/src/stored\\\\;")
string(APPEND WINEPATH "Z:${CMAKE_CURRENT_BINARY_DIR}/src/cats\\\\;")


MESSAGE(${WINEPATH})
Expand Down
14 changes: 11 additions & 3 deletions core/src/tests/CMakeLists.txt
Expand Up @@ -101,7 +101,6 @@ target_link_libraries(test_fd_plugins
PROPERTIES ENVIRONMENT "WINEPATH=${WINEPATH}" )


IF(NOT HAVE_WIN32)

####### test_sd_plugins #####################################
add_executable(test_sd_plugins
Expand All @@ -115,7 +114,11 @@ target_link_libraries(test_sd_plugins
${GTEST_MAIN_LIBRARIES}
)

gtest_discover_tests(test_sd_plugins TEST_PREFIX gtest:)
gtest_add_tests(TARGET test_sd_plugins
TEST_PREFIX gtest:
TEST_LIST found_tests)
set_tests_properties(${found_tests}
PROPERTIES ENVIRONMENT "WINEPATH=${WINEPATH}" )

####### test_dir_plugins #####################################
add_executable(test_dir_plugins
Expand All @@ -131,8 +134,13 @@ target_link_libraries(test_dir_plugins
${GTEST_MAIN_LIBRARIES}
)

gtest_discover_tests(test_dir_plugins TEST_PREFIX gtest:)
gtest_add_tests(TARGET test_dir_plugins
TEST_PREFIX gtest:
TEST_LIST found_tests)
set_tests_properties(${found_tests}
PROPERTIES ENVIRONMENT "WINEPATH=${WINEPATH}" )

IF(NOT HAVE_WIN32)
ENDIF()
IF(HAVE_WIN32)

Expand Down
9 changes: 9 additions & 0 deletions core/src/tests/test_dir_plugins.cc
Expand Up @@ -26,8 +26,17 @@
/** @file
* BAREOS pluginloader
*/
#if defined(HAVE_MINGW)
#define _S_IFDIR S_IFDIR
#define _stat stat
#include "minwindef.h"
#include "include/bareos.h"
#include "gtest/gtest.h"
#else
#include "gtest/gtest.h"
#include "include/bareos.h"
#endif

#include "dird/dird.h"
#include "dird/dird_globals.h"
#include "dird/dir_plugins.h"
Expand Down
9 changes: 9 additions & 0 deletions core/src/tests/test_sd_plugins.cc
Expand Up @@ -22,8 +22,17 @@
*/
/* originally Kern Sibbald, October 2007 */

#if defined(HAVE_MINGW)
#define _S_IFDIR S_IFDIR
#define _stat stat
#include "minwindef.h"
#include "include/bareos.h"
#include "gtest/gtest.h"
#else
#include "gtest/gtest.h"
#include "include/bareos.h"
#endif

#include "stored/stored.h"
#include "stored/stored_globals.h"
#include "stored/sd_plugins.h"
Expand Down

0 comments on commit d33e561

Please sign in to comment.