HART  0.1.0
High level Audio Regression and Testing
Loading...
Searching...
No Matches
hart_cliconfig.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include "CLI11.hpp"
5
6namespace hart
7{
8
10{
11public:
13 {
14 static CLIConfig cfg;
15 return cfg;
16 }
17
19 {
20 app.add_option ("--data-root-path,-d", m_dataRootPath, "Data root path");
21 app.add_option ("--tags,-t", m_tags, "Test tags. Nut supported yet!");
22 app.add_option ("--seed,-s", m_seed, "Random seed")->default_val (0);
23
24 app.add_option (
25 "--lin-decimals",
26 m_linDecimals,
27 "Number of displayed decimal places for samples' linear values in test output"
28 )->default_val (6);
29
30 app.add_option (
31 "--db-decimals",
32 m_dbDecimals,
33 "Number of displayed decimal places for values in decidels in test output"
34 )->default_val (1);
35
36 app.add_option (
37 "--sec-decimals",
38 m_secDecimals,
39 "Number of displayed decimal places for values in seconds in test output"
40 )->default_val (3);
41
42 app.add_option (
43 "--hz-decimals",
44 m_hzDecimals,
45 "Number of displayed decimal places for values in hertz in test output"
46 )->default_val (1);
47
48 app.add_option (
49 "--rad-decimals",
50 m_radDecimals,
51 "Number of displayed decimal places for values in radians in test output"
52 )->default_val (1);
53
54 app.add_flag ("--run-generators,-g", m_runGeneratorsNotTests, "Run generators instead of tests");
55 app.add_flag ("--shuffle", m_shuffle, "Shuffle task order. Obeys --seed value.");
56 }
57
58 CLI::App& getCLIApp() { return app; }
59
60 std::string getDataRootPath() { return m_dataRootPath; }
61 uint_fast32_t getRandomSeed() { return m_seed; }
62
63 /// @see linPrecision
64 int getLinDecimals() { return m_linDecimals; }
65
66 /// @see dbPrecision
67 int getDbDecimals() { return m_dbDecimals; }
68
69 /// @see secPrecision
70 int getSecDecimals() { return m_secDecimals; }
71
72 /// @see hzPrecision
73 int getHzDecimals() { return m_hzDecimals; }
74
75 /// @see radPrecision
76 int getRadDecimals() { return m_radDecimals; }
77
78 bool shouldRunGenerators() { return m_runGeneratorsNotTests; }
79 bool shouldShuffleTasks() { return m_shuffle; }
80
81private:
82 CLI::App app { "HART" };
83
84 std::string m_dataRootPath = ".";
85 std::string m_tags = "";
86 uint_fast32_t m_seed = 0;
87 bool m_runGeneratorsNotTests = false;
88 bool m_shuffle = false;
89
90 int m_linDecimals = 0;
91 int m_dbDecimals = 0;
92 int m_secDecimals = 0;
93 int m_hzDecimals = 0;
94 int m_radDecimals = 0;
95
96 CLIConfig() = default;
97};
98
99} // namespace hart
uint_fast32_t getRandomSeed()
std::string getDataRootPath()
CLI::App & getCLIApp()
static CLIConfig & getInstance()