Skip to content
Snippets Groups Projects
Commit c58c8bf8 authored by Sergey Yakubov's avatar Sergey Yakubov
Browse files

adjust for MacOs

parent 22755766
Branches
Tags
No related merge requests found
......@@ -15,6 +15,11 @@ typedef SSIZE_T ssize_t;
#include "../../../../../../../../usr/include/netinet/in.h"
#endif
#ifdef __APPLE__
# define MSG_NOSIGNAL 0
#endif
namespace asapo {
class SystemIO final : public IO {
......
......@@ -24,6 +24,8 @@ do
echo 'db.data.insert({"_id":'$i',"size":100,"name":"'$i'","lastchange":1})' | mongo ${database_name}
done
sleep 1
$@ 127.0.0.1:8400 $database_name 2 $token_test_run 1000 | grep "Processed 3 file(s)"
......
......@@ -5,8 +5,9 @@ set(SOURCE_FILES
src/event_detector_factory.cpp
src/folder_event_detector.cpp
)
IF(WIN32)
IF (APPLE)
#do nothing
ELSEIF(WIN32)
set(SOURCE_FILES ${SOURCE_FILES} src/system_folder_watch_windows.cpp
src/single_folder_watch_windows.cpp
src/watch_io.cpp
......@@ -15,7 +16,7 @@ IF(WIN32)
)
ELSEIF(UNIX)
set(SOURCE_FILES ${SOURCE_FILES} src/system_folder_watch_linux.cpp src/inotify_event.cpp src/inotify_linux.cpp)
ENDIF(WIN32)
ENDIF(APPLE)
......@@ -55,13 +56,14 @@ set(TEST_SOURCE_FILES
unittests/test_event_detector_factory.cpp
unittests/test_folder_event_detector.cpp
)
IF(UNIX)
IF (APPLE)
#do nothing
ELSEIF(UNIX)
set(TEST_SOURCE_FILES ${TEST_SOURCE_FILES} unittests/test_system_folder_watch_linux.cpp)
ELSE()
set(TEST_SOURCE_FILES ${TEST_SOURCE_FILES} unittests/test_system_folder_watch_windows.cpp
unittests/test_single_folder_watch_windows.cpp)
ENDIF(UNIX)
ENDIF(APPLE)
set(TEST_LIBRARIES "${TARGET_NAME}")
......
......@@ -5,9 +5,14 @@
#include "system_folder_watch_windows.h"
#endif
#if defined(__linux__) || defined (__APPLE__)
#if defined(__linux__)
#include "system_folder_watch_linux.h"
#endif
#if defined(__APPLE__)
#include "system_folder_watch_macos_dummy.h"
#endif
#endif //ASAPO_SYSTEM_FODLER_WATCH_H
#ifndef ASAPO_SYSTEM_FOLDER_WATCH_MACOS_DUMMY_H
#define ASAPO_SYSTEM_FOLDER_WATCH_MACOS_DUMMY_H
#include "common.h"
#include "preprocessor/definitions.h"
// dummy file to make it compile on macos
namespace asapo {
class SystemFolderWatch {
public:
VIRTUAL Error StartFolderMonitor(const std::string &root_folder, const std::vector<std::string> &monitored_folders) {
return nullptr;
};
VIRTUAL FilesToSend GetFileList(Error* err) {
return {};
};
};
}
#endif //ASAPO_SYSTEM_FOLDER_WATCH_MACOS_DUMMY_H
......@@ -162,8 +162,7 @@ TEST_F(RequestTests, HandleProcessesRequests) {
TEST_F(RequestTests, DataIsNullAtInit) {
auto& data = request->GetData();
ASSERT_THAT(data, Eq(nullptr));
ASSERT_THAT(data.get(), Eq(nullptr));
}
TEST_F(RequestTests, GetDataIsNotNullptr) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment