|
HART
0.2.0
High level Audio Regression and Testing
|
Runs the tests. More...
Classes | |
| struct | CLIConfig |
| Holds values set by the user via CLI interface. More... | |
| class | AudioTestBuilder< SampleType > |
| A DSP host used for building and running tests inside a test case. More... | |
| class | TestRegistry |
| Runs the test cases. More... | |
Macros | |
| #define | HART_FAIL_TEST_MSG(message) throw hart::TestAssertException (std::string ("HART_FAIL_TEST_MSG() triggered test fail at line ") + std::to_string (__LINE__) + " with message: \"" + message + '\"') |
| Fails a test case unconditionally with a text message. | |
| #define | HART_FAIL_TEST() throw hart::TestAssertException (std::string ("HART_FAIL_TEST() triggered test fail at line ") + std::to_string (__LINE__)) |
| Fails a test case unconditionally. | |
| #define | HART_TEST_WITH_TAGS(name, tags) HART_ITEM_WITH_TAGS(name, tags, hart::TaskCategory::test) |
| Declares a test case with tags. | |
| #define | HART_GENERATE_WITH_TAGS(name, tags) HART_ITEM_WITH_TAGS(name, tags, hart::TaskCategory::generate) |
| Declares a generator with tags. | |
| #define | HART_TEST(name) HART_TEST_WITH_TAGS(name, "") |
| Declares a test case. | |
| #define | HART_GENERATE(name) HART_GENERATE_WITH_TAGS(name, "") |
| Declares a generator. | |
| #define | HART_REQUIRES_DATA_PATH_ARG if (hart::CLIConfig::getInstance().getDataRootPath().empty()) { throw hart::ConfigurationError ("This test requires a data path set by the --data-root-path CLI argument, but it's empty"); } |
| Put it at the beginning of your tese case if it requires a properly set data path. | |
| #define | HART_RUN_ALL_TESTS(argc, argv) |
| Runs all tests or generators. | |
Enumerations | |
| enum class | Save { always , whenFails , never } |
| Determines when to save a file. More... | |
| enum class | ResetSignal { no , yes } |
| Determines whether to reset the Signal in a given context. More... | |
Functions | |
| template<typename DSPType > | |
| AudioTestBuilder< typename std::decay< DSPType >::type::SampleTypePublicAlias > | processAudioWith (DSPType &&dsp) |
| Call this to start building your test using a DSP object. | |
| template<typename DSPType > | |
| AudioTestBuilder< typename DSPType::SampleTypePublicAlias > | processAudioWith (std::unique_ptr< DSPType > &&dsp) |
| Call this to start building your test using a smart pointer to a DSP object. | |
| AudioTestBuilder< float > | processAudioWith (std::function< float(float)> dspFunction, const std::string &label={}) |
| Call this to start building your test using a sample-wise function. | |
| AudioTestBuilder< float > | processAudioWith (std::function< void(AudioBuffer< float > &)> dspFunction, const std::string &label={}) |
| Call this to start building your test using a block-wise in-place function. | |
| AudioTestBuilder< float > | processAudioWith (std::function< void(const AudioBuffer< float > &, AudioBuffer< float > &)> dspFunction, const std::string &label={}) |
| Call this to start building your test using a block-wise non-replacing function. | |
| AudioTestBuilder< double > | processAudioWith (std::function< double(double)> dspFunction, const std::string &label={}) |
See the description of the float version of this function. | |
| AudioTestBuilder< double > | processAudioWith (std::function< void(AudioBuffer< double > &)> dspFunction, const std::string &label={}) |
See the description of the float version of this function. | |
| AudioTestBuilder< double > | processAudioWith (std::function< void(const AudioBuffer< double > &, AudioBuffer< double > &)> dspFunction, const std::string &label={}) |
See the description of the float version of this function. | |
Runs the tests.
| #define HART_FAIL_TEST_MSG | ( | message | ) | throw hart::TestAssertException (std::string ("HART_FAIL_TEST_MSG() triggered test fail at line ") + std::to_string (__LINE__) + " with message: \"" + message + '\"') |
| #define HART_FAIL_TEST | ( | ) | throw hart::TestAssertException (std::string ("HART_FAIL_TEST() triggered test fail at line ") + std::to_string (__LINE__)) |
| #define HART_TEST_WITH_TAGS | ( | name, | |
| tags | |||
| ) | HART_ITEM_WITH_TAGS(name, tags, hart::TaskCategory::test) |
| #define HART_GENERATE_WITH_TAGS | ( | name, | |
| tags | |||
| ) | HART_ITEM_WITH_TAGS(name, tags, hart::TaskCategory::generate) |
| #define HART_TEST | ( | name | ) | HART_TEST_WITH_TAGS(name, "") |
| #define HART_GENERATE | ( | name | ) | HART_GENERATE_WITH_TAGS(name, "") |
| #define HART_REQUIRES_DATA_PATH_ARG if (hart::CLIConfig::getInstance().getDataRootPath().empty()) { throw hart::ConfigurationError ("This test requires a data path set by the --data-root-path CLI argument, but it's empty"); } |
| #define HART_RUN_ALL_TESTS | ( | argc, | |
| argv | |||
| ) |
Runs all tests or generators.
Place this macro in your main() function
|
strong |
Determines when to save a file.
| Enumerator | |
|---|---|
| always | File will be saved always, after the test is performed. |
| whenFails | File will be saved only when the test has failed. |
| never | File will not be saved. |
Definition at line 34 of file hart_process_audio.hpp.
|
strong |
Determines whether to reset the Signal in a given context.
| Enumerator | |
|---|---|
| no | The signal will continue from whatever state it was in. |
| yes | The signal's state will be reset. |
Definition at line 43 of file hart_process_audio.hpp.
| AudioTestBuilder< typename std::decay< DSPType >::type::SampleTypePublicAlias > processAudioWith | ( | DSPType && | dsp | ) |
Call this to start building your test using a DSP object.
| dsp | Instance of your DSP effect |
Definition at line 951 of file hart_process_audio.hpp.
| AudioTestBuilder< typename DSPType::SampleTypePublicAlias > processAudioWith | ( | std::unique_ptr< DSPType > && | dsp | ) |
Call this to start building your test using a smart pointer to a DSP object.
Call this for DSP objects that do not support moving or copying
| dsp | Instance of your DSP effect wrapped in a smart pointer |
Definition at line 962 of file hart_process_audio.hpp.
|
inline |
Call this to start building your test using a sample-wise function.
This overload allows defining a DSP processor using a function or lambda that operates on individual samples.
The function is applied independently to each sample.
For more details, see DSPFunction documentation, as it merely forwards the arguments to its constructor.
| dspFunction | Function to process each sample. |
| label | Optional human-readable label for error reporting. |
Definition at line 993 of file hart_process_audio.hpp.
|
inline |
Call this to start building your test using a block-wise in-place function.
The provided function processes audio in-place. The buffer is pre-filled with input data and must be modified directly.
For more details, see DSPFunction documentation, as it merely forwards the arguments to its constructor.
| dspFunction | Function that processes the buffer in-place. |
| label | Optional human-readable label for error reporting. |
Definition at line 1021 of file hart_process_audio.hpp.
|
inline |
Call this to start building your test using a block-wise non-replacing function.
This overload provides separate input and output buffers for processing.
For more details, see DSPFunction documentation, as it merely forwards the arguments to its constructor.
| dspFunction | Function that generates output from input. |
| label | Optional human-readable label for error reporting. |
Definition at line 1048 of file hart_process_audio.hpp.
|
inline |
See the description of the float version of this function.
Definition at line 1062 of file hart_process_audio.hpp.
|
inline |
See the description of the float version of this function.
Definition at line 1069 of file hart_process_audio.hpp.
|
inline |
See the description of the float version of this function.
Definition at line 1076 of file hart_process_audio.hpp.