HART  0.2.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 "dependencies/CLI11/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_option (
55 "--cents-decimals",
56 m_centsDecimals,
57 "Number of displayed decimal places for values in cents in test output"
58 )->default_val (0);
59
60 app.add_flag ("--run-generators,-g", m_runGeneratorsNotTests, "Run generators instead of tests");
61 app.add_flag ("--shuffle", m_shuffle, "Shuffle task order. Obeys --seed value.");
62 }
63
64 CLI::App& getCLIApp() { return app; }
65
66 std::string getDataRootPath() { return m_dataRootPath; }
67 uint_fast32_t getRandomSeed() { return m_seed; }
68
69 /// @see linPrecision
70 int getLinDecimals() { return m_linDecimals; }
71
72 /// @see dbPrecision
73 int getDbDecimals() { return m_dbDecimals; }
74
75 /// @see secPrecision
76 int getSecDecimals() { return m_secDecimals; }
77
78 /// @see hzPrecision
79 int getHzDecimals() { return m_hzDecimals; }
80
81 /// @see radPrecision
82 int getRadDecimals() { return m_radDecimals; }
83
84 /// @see centsPrecision
85 int getCentsDecimals() { return m_centsDecimals; }
86
87 bool shouldRunGenerators() { return m_runGeneratorsNotTests; }
88 bool shouldShuffleTasks() { return m_shuffle; }
89
90private:
91 CLI::App app { "HART" };
92
93 std::string m_dataRootPath = ".";
94 std::string m_tags = "";
95 uint_fast32_t m_seed = 0;
96 bool m_runGeneratorsNotTests = false;
97 bool m_shuffle = false;
98
99 int m_linDecimals = 0;
100 int m_dbDecimals = 0;
101 int m_secDecimals = 0;
102 int m_hzDecimals = 0;
103 int m_radDecimals = 0;
104 int m_centsDecimals = 0;
105
106 CLIConfig() = default;
107};
108
109} // namespace hart
uint_fast32_t getRandomSeed()
std::string getDataRootPath()
CLI::App & getCLIApp()
static CLIConfig & getInstance()