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

adjust for MacOs

parent 22755766
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,11 @@ typedef SSIZE_T ssize_t; ...@@ -15,6 +15,11 @@ typedef SSIZE_T ssize_t;
#include "../../../../../../../../usr/include/netinet/in.h" #include "../../../../../../../../usr/include/netinet/in.h"
#endif #endif
#ifdef __APPLE__
# define MSG_NOSIGNAL 0
#endif
namespace asapo { namespace asapo {
class SystemIO final : public IO { class SystemIO final : public IO {
......
...@@ -24,6 +24,8 @@ do ...@@ -24,6 +24,8 @@ do
echo 'db.data.insert({"_id":'$i',"size":100,"name":"'$i'","lastchange":1})' | mongo ${database_name} echo 'db.data.insert({"_id":'$i',"size":100,"name":"'$i'","lastchange":1})' | mongo ${database_name}
done done
sleep 1
$@ 127.0.0.1:8400 $database_name 2 $token_test_run 1000 | grep "Processed 3 file(s)" $@ 127.0.0.1:8400 $database_name 2 $token_test_run 1000 | grep "Processed 3 file(s)"
......
...@@ -5,8 +5,9 @@ set(SOURCE_FILES ...@@ -5,8 +5,9 @@ set(SOURCE_FILES
src/event_detector_factory.cpp src/event_detector_factory.cpp
src/folder_event_detector.cpp src/folder_event_detector.cpp
) )
IF (APPLE)
IF(WIN32) #do nothing
ELSEIF(WIN32)
set(SOURCE_FILES ${SOURCE_FILES} src/system_folder_watch_windows.cpp set(SOURCE_FILES ${SOURCE_FILES} src/system_folder_watch_windows.cpp
src/single_folder_watch_windows.cpp src/single_folder_watch_windows.cpp
src/watch_io.cpp src/watch_io.cpp
...@@ -15,7 +16,7 @@ IF(WIN32) ...@@ -15,7 +16,7 @@ IF(WIN32)
) )
ELSEIF(UNIX) ELSEIF(UNIX)
set(SOURCE_FILES ${SOURCE_FILES} src/system_folder_watch_linux.cpp src/inotify_event.cpp src/inotify_linux.cpp) 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 ...@@ -55,13 +56,14 @@ set(TEST_SOURCE_FILES
unittests/test_event_detector_factory.cpp unittests/test_event_detector_factory.cpp
unittests/test_folder_event_detector.cpp unittests/test_folder_event_detector.cpp
) )
IF (APPLE)
IF(UNIX) #do nothing
ELSEIF(UNIX)
set(TEST_SOURCE_FILES ${TEST_SOURCE_FILES} unittests/test_system_folder_watch_linux.cpp) set(TEST_SOURCE_FILES ${TEST_SOURCE_FILES} unittests/test_system_folder_watch_linux.cpp)
ELSE() ELSE()
set(TEST_SOURCE_FILES ${TEST_SOURCE_FILES} unittests/test_system_folder_watch_windows.cpp set(TEST_SOURCE_FILES ${TEST_SOURCE_FILES} unittests/test_system_folder_watch_windows.cpp
unittests/test_single_folder_watch_windows.cpp) unittests/test_single_folder_watch_windows.cpp)
ENDIF(UNIX) ENDIF(APPLE)
set(TEST_LIBRARIES "${TARGET_NAME}") set(TEST_LIBRARIES "${TARGET_NAME}")
......
...@@ -5,9 +5,14 @@ ...@@ -5,9 +5,14 @@
#include "system_folder_watch_windows.h" #include "system_folder_watch_windows.h"
#endif #endif
#if defined(__linux__) || defined (__APPLE__) #if defined(__linux__)
#include "system_folder_watch_linux.h" #include "system_folder_watch_linux.h"
#endif #endif
#if defined(__APPLE__)
#include "system_folder_watch_macos_dummy.h"
#endif
#endif //ASAPO_SYSTEM_FODLER_WATCH_H #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) { ...@@ -162,8 +162,7 @@ TEST_F(RequestTests, HandleProcessesRequests) {
TEST_F(RequestTests, DataIsNullAtInit) { TEST_F(RequestTests, DataIsNullAtInit) {
auto& data = request->GetData(); auto& data = request->GetData();
ASSERT_THAT(data.get(), Eq(nullptr));
ASSERT_THAT(data, Eq(nullptr));
} }
TEST_F(RequestTests, GetDataIsNotNullptr) { TEST_F(RequestTests, GetDataIsNotNullptr) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment