mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-26 13:20:32 +01:00
Replace std::filesystem with boost::filesystem.
Somehow, travis still doesn't support the right one.
This commit is contained in:
@@ -10,10 +10,11 @@ before_script:
|
|||||||
- cd 2019
|
- cd 2019
|
||||||
|
|
||||||
# CMake build
|
# CMake build
|
||||||
script: cmake . && make && ./test_solutions
|
script: cmake . && make && make test
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
|
- libboost-filesystem-dev
|
||||||
- libboost-program-options-dev
|
- libboost-program-options-dev
|
||||||
- libboost-test-dev
|
- libboost-test-dev
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.12)
|
|||||||
|
|
||||||
project(aoc2019)
|
project(aoc2019)
|
||||||
|
|
||||||
find_package(Boost REQUIRED COMPONENTS program_options unit_test_framework)
|
find_package(Boost REQUIRED COMPONENTS program_options unit_test_framework filesystem)
|
||||||
|
|
||||||
add_library(AoCSolutions src/solutions.hpp src/solutions.cpp src/day01.cpp)
|
add_library(AoCSolutions src/solutions.hpp src/solutions.cpp src/day01.cpp)
|
||||||
target_compile_features(AoCSolutions PUBLIC cxx_std_17)
|
target_compile_features(AoCSolutions PUBLIC cxx_std_17)
|
||||||
@@ -13,7 +13,7 @@ target_link_libraries(runner AoCSolutions Boost::program_options)
|
|||||||
|
|
||||||
add_executable(test_solutions tests/test_solutions.cpp)
|
add_executable(test_solutions tests/test_solutions.cpp)
|
||||||
target_compile_features(test_solutions PUBLIC cxx_std_17)
|
target_compile_features(test_solutions PUBLIC cxx_std_17)
|
||||||
target_link_libraries(test_solutions AoCSolutions Boost::unit_test_framework)
|
target_link_libraries(test_solutions AoCSolutions Boost::unit_test_framework Boost::filesystem)
|
||||||
target_include_directories(test_solutions PRIVATE "${CMAKE_SOURCE_DIR}/src")
|
target_include_directories(test_solutions PRIVATE "${CMAKE_SOURCE_DIR}/src")
|
||||||
|
|
||||||
enable_testing()
|
enable_testing()
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
#define BOOST_TEST_MODULE solutions_tests
|
#define BOOST_TEST_MODULE solutions_tests
|
||||||
|
|
||||||
#include <filesystem>
|
|
||||||
#include <regex>
|
#include <regex>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <tuple>
|
#include <boost/filesystem.hpp>
|
||||||
#include <boost/test/included/unit_test.hpp>
|
#include <boost/test/included/unit_test.hpp>
|
||||||
#include <boost/test/data/test_case.hpp>
|
#include <boost/test/data/test_case.hpp>
|
||||||
#include "solutions.hpp"
|
#include "solutions.hpp"
|
||||||
|
|
||||||
std::vector<std::string> get_samples() {
|
std::vector<std::string> get_samples() {
|
||||||
std::vector<std::string> samples;
|
std::vector<std::string> samples;
|
||||||
for (auto entry : std::filesystem::directory_iterator("./samples")) {
|
for (const auto &entry : boost::filesystem::directory_iterator("./samples")) {
|
||||||
if (entry.path().filename().extension() == ".in") {
|
if (entry.path().filename().extension() == ".in") {
|
||||||
samples.push_back(entry.path().string());
|
samples.push_back(entry.path().string());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user