mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-25 21:00:31 +01:00
Restructure header files.
This should prevent the tests from being recompiled.
This commit is contained in:
@@ -4,7 +4,7 @@ project(aoc2019)
|
|||||||
|
|
||||||
find_package(Boost REQUIRED COMPONENTS program_options unit_test_framework filesystem)
|
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/implementations.hpp src/implementations.cpp src/day01.cpp src/days.hpp)
|
||||||
target_compile_features(AoCSolutions PUBLIC cxx_std_17)
|
target_compile_features(AoCSolutions PUBLIC cxx_std_17)
|
||||||
|
|
||||||
add_executable(runner src/runner.cpp)
|
add_executable(runner src/runner.cpp)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
#include "solutions.hpp"
|
#include "days.hpp"
|
||||||
|
|
||||||
// Currently an implementation of 2018 day 1
|
// Currently an implementation of 2018 day 1
|
||||||
void aoc2019::day01_part1(std::istream &input, std::ostream &output) {
|
void aoc2019::day01_part1(std::istream &input, std::ostream &output) {
|
||||||
|
|||||||
@@ -3,10 +3,6 @@
|
|||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
|
|
||||||
namespace aoc2019 {
|
namespace aoc2019 {
|
||||||
typedef void (*solution_t)(std::istream &, std::ostream &);
|
|
||||||
|
|
||||||
solution_t get_implementation(int day, bool part2 = false);
|
|
||||||
|
|
||||||
// Declarations of all implemented days.
|
// Declarations of all implemented days.
|
||||||
void day01_part1(std::istream &input, std::ostream &output);
|
void day01_part1(std::istream &input, std::ostream &output);
|
||||||
void day01_part2(std::istream &input, std::ostream &output);
|
void day01_part2(std::istream &input, std::ostream &output);
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
#include <array>
|
#include <array>
|
||||||
#include "solutions.hpp"
|
#include "days.hpp"
|
||||||
|
#include "implementations.hpp"
|
||||||
|
|
||||||
constexpr const std::array<std::array<aoc2019::solution_t, 2>, 25> SOLUTIONS = {
|
constexpr const std::array<std::array<aoc2019::solution_t, 2>, 25> SOLUTIONS = {
|
||||||
{aoc2019::day01_part1, aoc2019::day01_part2}
|
{aoc2019::day01_part1, aoc2019::day01_part2}
|
||||||
9
2019/src/implementations.hpp
Normal file
9
2019/src/implementations.hpp
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <iosfwd>
|
||||||
|
|
||||||
|
namespace aoc2019 {
|
||||||
|
typedef void (*solution_t)(std::istream &, std::ostream &);
|
||||||
|
|
||||||
|
solution_t get_implementation(int day, bool part2 = false);
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "solutions.hpp"
|
#include "implementations.hpp"
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <boost/program_options.hpp>
|
#include <boost/program_options.hpp>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include <boost/filesystem.hpp>
|
#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 "implementations.hpp"
|
||||||
|
|
||||||
std::vector<std::string> get_samples() {
|
std::vector<std::string> get_samples() {
|
||||||
std::vector<std::string> samples;
|
std::vector<std::string> samples;
|
||||||
|
|||||||
Reference in New Issue
Block a user