%define with_detailed_base_url 0
%define detailed_base_url %nil
+%define with_sample_engine 0
+
Summary: A general purpose content screening and reputation solution
Name: csr-framework
Version: 2.0.0
%if 0%{?with_detailed_base_url}
-DDETAILED_URL_BASE:STRING=%{detailed_base_url} \
%endif
+%if 0%{?with_sample_engine}
+ -DWITH_SAMPLE_ENGINE:BOOL=ON \
+%else
+ -DWITH_SAMPLE_ENGINE:BOOL=OFF \
+%endif
%if "%{platform_version}" == "3.0"
-DPLATFORM_VERSION_3:BOOL=ON
%else
cp LICENSE.BSL-1.0 %{buildroot}%{ro_data_dir}/license/%{name}.BSL-1.0
cp LICENSE %{buildroot}%{ro_data_dir}/license/lib%{name}-client
cp LICENSE %{buildroot}%{ro_data_dir}/license/lib%{name}-common
+
cp LICENSE %{buildroot}%{ro_data_dir}/license/%{name}-test
cp LICENSE.BSL-1.0 %{buildroot}%{ro_data_dir}/license/%{name}-test.BSL-1.0
+
mkdir -p %{buildroot}%{rw_db_dir}
mkdir -p %{buildroot}%{ro_db_dir}
cp data/scripts/*.sql %{buildroot}%{ro_db_dir}
%attr(-, %{service_user}, %{service_group}) %{test_dir}/*
# sample engine related files
+%if 0%{?with_sample_engine}
%{engine_dir}/lib%{service_name}-cs-engine.so
%{engine_dir}/lib%{service_name}-wp-engine.so
%attr(-, %{service_user}, %{service_group}) %{engine_rw_working_dir}/*
+%endif
# @brief build test program of csr-framework
#
####################### sample engine #########################
-ADD_SUBDIRECTORY(engine)
+IF (WITH_SAMPLE_ENGINE)
+ ADD_SUBDIRECTORY(engine)
+ENDIF (WITH_SAMPLE_ENGINE)
###############################################################
FIND_PACKAGE(Threads REQUIRED)
pkgmgr-info
)
+IF (WITH_SAMPLE_ENGINE)
+ ADD_DEFINITIONS("-DWITH_SAMPLE_ENGINE")
+ SET(SAMPLE_ENGINE_LINKED_SRCS
+ test-cs-loader.cpp
+ test-wp-loader.cpp
+ test-api-engine-content-screening.cpp
+ test-api-engine-web-protection.cpp
+ )
+ENDIF (WITH_SAMPLE_ENGINE)
+
SET(${TARGET_CSR_INTERNAL_TEST}_SRCS
${CSR_FW_SRC_PATH}/common/exception.cpp
${CSR_FW_SRC_PATH}/db/connection.cpp
test-db.cpp
test-cpucore.cpp
test-file-system.cpp
- test-api-engine-content-screening.cpp
- test-api-engine-web-protection.cpp
- test-cs-loader.cpp
- test-wp-loader.cpp
test-package-info.cpp
test-main.cpp
+
+ ${SAMPLE_ENGINE_LINKED_SRCS}
)
INCLUDE_DIRECTORIES(
LINK_FLAGS "-pie -Wl,-rpath,${ENGINE_DIR}"
)
+IF (WITH_SAMPLE_ENGINE)
TARGET_LINK_LIBRARIES(${TARGET_CSR_INTERNAL_TEST}
${TARGET_CSR_TEST_COMMON}
${TARGET_CSR_COMMON}
-lboost_unit_test_framework
-ldl
)
+ELSE (WITH_SAMPLE_ENGINE)
+TARGET_LINK_LIBRARIES(${TARGET_CSR_INTERNAL_TEST}
+ ${TARGET_CSR_TEST_COMMON}
+ ${TARGET_CSR_COMMON}
+ ${${TARGET_CSR_INTERNAL_TEST}_DEP_LIBRARIES}
+ -lboost_unit_test_framework
+ -ldl
+)
+ENDIF (WITH_SAMPLE_ENGINE)
INSTALL(TARGETS ${TARGET_CSR_INTERNAL_TEST} DESTINATION ${BIN_DIR})
}
};
+BOOST_GLOBAL_FIXTURE(TestConfig)
+
+#ifdef WITH_SAMPLE_ENGINE
bool isEngineInitialized = false;
struct Initializer {
Initializer()
}
};
-BOOST_GLOBAL_FIXTURE(TestConfig)
BOOST_GLOBAL_FIXTURE(Initializer)
+#endif