mirror of
https://github.com/falk-werner/webfused
synced 2024-10-27 20:44:08 +00:00
refactored tests
This commit is contained in:
parent
364d19bdea
commit
933789b045
@ -119,32 +119,33 @@ include(GoogleTest)
|
|||||||
pkg_check_modules(GMOCK gmock)
|
pkg_check_modules(GMOCK gmock)
|
||||||
|
|
||||||
add_executable(alltests
|
add_executable(alltests
|
||||||
test/mock_config_builder.cc
|
test/mock/config_builder.cc
|
||||||
test/mock_logger.cc
|
test/mock/logger.cc
|
||||||
test/mock_credentials.cc
|
test/mock/credentials.cc
|
||||||
test/mock_settings.cc
|
test/mock/settings.cc
|
||||||
test/mock_pam.cc
|
test/mock/pam.cc
|
||||||
test/mock_libconfig.cc
|
test/mock/libconfig.cc
|
||||||
test/mock_linux.cc
|
test/mock/linux.cc
|
||||||
test/mock_server.cc
|
test/mock/server.cc
|
||||||
test/test_config_factory.cc
|
test/config/factory.cc
|
||||||
test/test_config.cc
|
test/config/config.cc
|
||||||
test/test_settings.cc
|
test/config/settings.cc
|
||||||
test/test_auth_factory.cc
|
test/auth/factory.cc
|
||||||
test/test_file_authenticator.cc
|
test/auth/file_authenticator.cc
|
||||||
test/test_pam_authenticator.cc
|
test/auth/pam_authenticator.cc
|
||||||
test/test_mountpoint_factory.cc
|
test/log/log.cc
|
||||||
test/test_log.cc
|
test/log/log_manager.cc
|
||||||
test/test_log_manager.cc
|
test/log/stderr_logger.cc
|
||||||
test/test_stderr_logger.cc
|
test/log/syslog_logger.cc
|
||||||
test/test_syslog_logger.cc
|
test/daemon.cc
|
||||||
test/test_daemon.cc
|
test/change_user.cc
|
||||||
test/test_change_user.cc
|
test/mountpoint_factory.cc
|
||||||
test/test_userdb.cc
|
test/userdb.cc
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(alltests PRIVATE
|
target_include_directories(alltests PRIVATE
|
||||||
src
|
src
|
||||||
|
test
|
||||||
${GMOCK_INCLUDE_DIRS}
|
${GMOCK_INCLUDE_DIRS}
|
||||||
${GTEST_INCLUDE_DIRS}
|
${GTEST_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#include "webfused/auth/factory.h"
|
#include "webfused/auth/factory.h"
|
||||||
#include "webfused/auth/authenticator.h"
|
#include "webfused/auth/authenticator.h"
|
||||||
#include "webfused/log/log.h"
|
#include "webfused/log/log.h"
|
||||||
#include "mock_logger.hpp"
|
#include "mock/logger.hpp"
|
||||||
|
|
||||||
using ::testing::_;
|
using ::testing::_;
|
||||||
using ::webfused_test::MockLogger;
|
using ::webfused_test::MockLogger;
|
@ -3,8 +3,8 @@
|
|||||||
#include "webfused/config/settings.h"
|
#include "webfused/config/settings.h"
|
||||||
#include "webfused/auth/factory.h"
|
#include "webfused/auth/factory.h"
|
||||||
|
|
||||||
#include "mock_credentials.hpp"
|
#include "mock/credentials.hpp"
|
||||||
#include "mock_settings.hpp"
|
#include "mock/settings.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <libconfig.h>
|
#include <libconfig.h>
|
@ -3,9 +3,9 @@
|
|||||||
#include "webfused/config/settings.h"
|
#include "webfused/config/settings.h"
|
||||||
#include "webfused/auth/factory.h"
|
#include "webfused/auth/factory.h"
|
||||||
|
|
||||||
#include "mock_credentials.hpp"
|
#include "mock/credentials.hpp"
|
||||||
#include "mock_settings.hpp"
|
#include "mock/settings.hpp"
|
||||||
#include "mock_pam.hpp"
|
#include "mock/pam.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
#include "webfused/change_user.h"
|
#include "webfused/change_user.h"
|
||||||
#include "mock_linux.hpp"
|
#include "mock/linux.hpp"
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
using ::webfused_test::MockLinux;
|
using ::webfused_test::MockLinux;
|
@ -1,11 +1,11 @@
|
|||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include "webfused/config/config.h"
|
#include "webfused/config/config.h"
|
||||||
#include "webfused/config/config_intern.h"
|
#include "webfused/config/config_intern.h"
|
||||||
#include "mock_settings.hpp"
|
#include "mock/settings.hpp"
|
||||||
|
|
||||||
#include "webfused/log/logger.h"
|
#include "webfused/log/logger.h"
|
||||||
#include "webfused/log/log.h"
|
#include "webfused/log/log.h"
|
||||||
#include "mock_logger.hpp"
|
#include "mock/logger.hpp"
|
||||||
using ::webfused_test::MockLogger;
|
using ::webfused_test::MockLogger;
|
||||||
using ::testing::_;
|
using ::testing::_;
|
||||||
|
|
@ -3,9 +3,9 @@
|
|||||||
#include "webfused/config/factory.h"
|
#include "webfused/config/factory.h"
|
||||||
#include "webfused/log/logger.h"
|
#include "webfused/log/logger.h"
|
||||||
#include "webfused/log/log.h"
|
#include "webfused/log/log.h"
|
||||||
#include "mock_logger.hpp"
|
#include "mock/logger.hpp"
|
||||||
#include "mock_config_builder.hpp"
|
#include "mock/config_builder.hpp"
|
||||||
#include "mock_libconfig.hpp"
|
#include "mock/libconfig.hpp"
|
||||||
|
|
||||||
using ::testing::_;
|
using ::testing::_;
|
||||||
using ::testing::Return;
|
using ::testing::Return;
|
@ -1,6 +1,6 @@
|
|||||||
#include "webfused/daemon.h"
|
#include "webfused/daemon.h"
|
||||||
|
|
||||||
#include "mock_server.hpp"
|
#include "mock/server.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "webfused/log/logger.h"
|
#include "webfused/log/logger.h"
|
||||||
#include "webfused/log/log.h"
|
#include "webfused/log/log.h"
|
||||||
#include "mock_logger.hpp"
|
#include "mock/logger.hpp"
|
||||||
|
|
||||||
using ::testing::_;
|
using ::testing::_;
|
||||||
using ::testing::StrEq;
|
using ::testing::StrEq;
|
@ -3,7 +3,7 @@
|
|||||||
#include "webfused/log/logger.h"
|
#include "webfused/log/logger.h"
|
||||||
#include "webfused/log/log.h"
|
#include "webfused/log/log.h"
|
||||||
|
|
||||||
#include "mock_settings.hpp"
|
#include "mock/settings.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
@ -1,4 +1,4 @@
|
|||||||
#include "mock_config_builder.hpp"
|
#include "mock/config_builder.hpp"
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
@ -1,4 +1,4 @@
|
|||||||
#include "mock_credentials.hpp"
|
#include "mock/credentials.hpp"
|
||||||
|
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
@ -1,5 +1,5 @@
|
|||||||
#include "mock_libconfig.hpp"
|
#include "mock/libconfig.hpp"
|
||||||
#include "wrap_utils.hpp"
|
#include "util/wrap.hpp"
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
@ -1,5 +1,5 @@
|
|||||||
#include "mock_linux.hpp"
|
#include "mock/linux.hpp"
|
||||||
#include "wrap_utils.hpp"
|
#include "util/wrap.hpp"
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
@ -1,4 +1,4 @@
|
|||||||
#include "mock_logger.hpp"
|
#include "mock/logger.hpp"
|
||||||
#include "webfused/log/logger.h"
|
#include "webfused/log/logger.h"
|
||||||
#include "webfused/log/log.h"
|
#include "webfused/log/log.h"
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
#include "mock_pam.hpp"
|
#include "mock/pam.hpp"
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
@ -1,5 +1,5 @@
|
|||||||
#include "mock_server.hpp"
|
#include "mock/server.hpp"
|
||||||
#include "wrap_utils.hpp"
|
#include "util/wrap.hpp"
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
@ -1,4 +1,4 @@
|
|||||||
#include "mock_settings.hpp"
|
#include "mock/settings.hpp"
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
@ -1,5 +1,5 @@
|
|||||||
#ifndef WFD_WRAP_UTILS_HPP
|
#ifndef WFD_UTIL_WRAP_HPP
|
||||||
#define WFD_WRAP_UTILS_HPP
|
#define WFD_UTIL_WRAP_HPP
|
||||||
|
|
||||||
#define WFD_WRAP_FUNC0( GLOBAL_VAR, RETURN_TYPE, FUNC_NAME ) \
|
#define WFD_WRAP_FUNC0( GLOBAL_VAR, RETURN_TYPE, FUNC_NAME ) \
|
||||||
extern RETURN_TYPE __real_ ## FUNC_NAME (); \
|
extern RETURN_TYPE __real_ ## FUNC_NAME (); \
|
Loading…
Reference in New Issue
Block a user