Browse Source

build: update cmake configure

master
Dnomd343 1 year ago
parent
commit
166fe96b0b
  1. 2
      CMakeLists.txt
  2. 28
      src/core_test/CMakeLists.txt
  3. 7
      src/core_test/cases/all_cases.cc

2
CMakeLists.txt

@ -8,7 +8,7 @@ endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
get_filename_component(KLOTSKI_ROOT_PATH "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE)
get_filename_component(KLOTSKI_ROOT "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE)
################################################################################

28
src/core_test/CMakeLists.txt

@ -2,19 +2,29 @@ cmake_minimum_required(VERSION 3.0)
set(CMAKE_CXX_STANDARD 20)
include_directories(${KLOTSKI_ROOT_PATH}/third_party/googletest/googletest/include)
add_subdirectory(${KLOTSKI_ROOT_PATH}/third_party/googletest googletest EXCLUDE_FROM_ALL)
###############################################################################################
#unset(CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
include_directories(${KLOTSKI_ROOT_PATH}/third_party/md5sum)
#add_library(md5 STATIC ${KLOTSKI_ROOT_PATH}/third_party/md5/md5.cpp)
add_subdirectory(${KLOTSKI_ROOT_PATH}/third_party/md5sum md5sum EXCLUDE_FROM_ALL)
include_directories(${KLOTSKI_ROOT}/third_party/md5sum)
add_subdirectory(${KLOTSKI_ROOT}/third_party/md5sum md5sum EXCLUDE_FROM_ALL)
include_directories(${KLOTSKI_ROOT}/third_party/googletest/googletest/include)
add_subdirectory(${KLOTSKI_ROOT}/third_party/googletest googletest EXCLUDE_FROM_ALL)
set(KLOTSKI_TEST_DEPS klotski-core gtest gtest_main md5sum)
include_directories(${KLOTSKI_ROOT_PATH}/src/core/all_cases)
include_directories(${KLOTSKI_ROOT_PATH}/src/core/utils)
###############################################################################################
include_directories(${KLOTSKI_ROOT}/src/core/utils)
include_directories(${KLOTSKI_ROOT}/src/core/all_cases)
###############################################################################################
add_executable(test_klotski_cases cases/all_cases.cc)
set(KLOTSKI_TEST_CASES_SRC
cases/all_cases.cc
)
add_executable(test_klotski_cases ${KLOTSKI_TEST_CASES_SRC})
target_link_libraries(test_klotski_cases PRIVATE ${KLOTSKI_TEST_DEPS})
add_test(NAME klotski_cases COMMAND test_klotski_cases)
###############################################################################################

7
src/core_test/cases/all_cases.cc

@ -1,9 +1,10 @@
#include <string>
#include <thread>
#include <vector>
#include "gtest/gtest.h"
#include "all_cases.h"
#include "md5sum.h"
#include "all_cases.h"
#include "gtest/gtest.h"
using md5::md5sum;
@ -89,3 +90,5 @@ TEST(Cases, all_cases_data) {
}
EXPECT_EQ(md5sum(all_cases_str), ALL_CASES_MD5);
}
// TODO: test all_cases_parallel_build

Loading…
Cancel
Save