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 std::filesystem::path cmake_cache_dir() const;
30
31 [[nodiscard]]
32 const main_paths& main() const noexcept { return m_Main; }
33
34 [[nodiscard]]
35 const build_paths& build() const noexcept { return m_Build; }
36
37 private:
38 main_paths m_Main;
39 build_paths m_Build;
40
41 [[nodiscard]]
42 runtime::shell_command run(const std::filesystem::path& outputDir, std::string_view options) const;
43 };
44
46 {
47 public:
48 using free_test::free_test;
49
50 [[nodiscard]]
51 std::filesystem::path source_file() const;
52
53 void run_tests();
54 private:
55
56 void test_project_creation();
57
58 [[nodiscard]]
59 std::filesystem::path generated_project() const;
60
61 void copy_aux_materials(const std::filesystem::path& relativeFrom, const std::filesystem::path& relativeTo) const;
62
63 void create_run_and_check(std::string_view description, const cmd_builder& b);
64
65 void run_and_check(std::string_view description, const cmd_builder& b, std::string_view relOutputDir, std::string_view options);
66
67 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);
68
69 void check_project_files(std::string_view description, const cmd_builder& b);
70 };
71}
Shell Command specifically for the testing framework.
Core functionality for the testing framework.
Definition: ShellCommands.hpp:20
class template from which all concrete tests should derive.
Definition: FreeTestCore.hpp:144
Paths relating to the build directory.
Definition: ProjectPaths.hpp:227
Definition: TestRunnerEndToEndFreeTest.hpp:18
Paths relating to the main cpp.
Definition: ProjectPaths.hpp:66
Definition: TestRunnerEndToEndFreeTest.hpp:46