Sequoia
Loading...
Searching...
No Matches
TestRunnerEndToEndFreeTest.hpp
Go to the documentation of this file.
1
2// Copyright Oliver J. Rosten 2021. //
3// Distributed under the GNU GENERAL PUBLIC LICENSE, Version 3.0. //
4// (See accompanying file LICENSE.md or copy at //
5// https://www.gnu.org/licenses/gpl-3.0.en.html) //
7
8#pragma once
9
14
15namespace sequoia::testing
16{
18 {
19 public:
20 cmd_builder(const std::filesystem::path& projRoot, const build_paths& applicationBuildPaths);
21
22 void create_build_run(const std::filesystem::path& creationOutput, std::string_view buildOutput, const std::filesystem::path& output) const;
23
24 void rebuild_run(const std::filesystem::path& outputDir, std::string_view cmakeOutput, std::string_view buildOutput, std::string_view options) const;
25
26 void run_executable(const std::filesystem::path& outputDir, std::string_view options) const;
27
28 [[nodiscard]]
29 const std::filesystem::path& cmake_cache_dir() const;
30
31 [[nodiscard]]
32 const main_paths& get_main_paths() const noexcept { return m_Main; }
33
34 [[nodiscard]]
35 const build_paths& get_build_paths() const noexcept { return m_Build; }
36 private:
37 main_paths m_Main;
38 build_paths m_Build;
39 };
40
42 {
43 public:
44 using free_test::free_test;
45
46 [[nodiscard]]
47 std::filesystem::path source_file() const;
48
49 [[nodiscard]]
50 std::string summary_discriminator() const
51 {
52 return with_msvc_v ? "msvc" : std::string{};
53 }
54
55 void run_tests();
56 private:
57 void test_project_creation();
58
59 [[nodiscard]]
60 std::filesystem::path generated_project() const;
61
62 void copy_aux_materials(const std::filesystem::path& relativeFrom, const std::filesystem::path& relativeTo) const;
63
64 void create_run_and_check(std::string_view description, const cmd_builder& b);
65
66 void run_and_check(std::string_view description, const cmd_builder& b, std::string_view relOutputDir, std::string_view options);
67
68 void rebuild_run_and_check(std::string_view description, const cmd_builder& b, std::string_view relOutputDir, std::string_view CMakeOutput, std::string_view BuildOutput, std::string_view options);
69
70 void check_project_files(std::string_view description, const cmd_builder& b);
71 };
72}
Shell Command specifically for the testing framework.
Core functionality for the testing framework.
class template from which all concrete tests should derive.
Definition: FreeTestCore.hpp:144
Paths relating to the build directory.
Definition: ProjectPaths.hpp:226
Definition: TestRunnerEndToEndFreeTest.hpp:18
Paths relating to the main cpp.
Definition: ProjectPaths.hpp:65
Definition: TestRunnerEndToEndFreeTest.hpp:42