Improve audio and midi support.
This commit is contained in:
parent
9bcc0ae88e
commit
8b5f485d1e
47 changed files with 1446 additions and 634 deletions
13
test/test_utils/TestCase.h
Normal file
13
test/test_utils/TestCase.h
Normal file
|
@ -0,0 +1,13 @@
|
|||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
class TestCase
|
||||
{
|
||||
public:
|
||||
TestCase(){};
|
||||
virtual ~TestCase() = default;
|
||||
TestCase(const TestCase&) = delete;
|
||||
virtual bool Run() {return false;};
|
||||
};
|
||||
using TestCasePtr = std::unique_ptr<TestCase>;
|
26
test/test_utils/TestCaseRunner.cpp
Normal file
26
test/test_utils/TestCaseRunner.cpp
Normal file
|
@ -0,0 +1,26 @@
|
|||
#include "TestCaseRunner.h"
|
||||
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
|
||||
void TestCaseRunner::AddTestCase(const std::string& label, TestCasePtr testCase)
|
||||
{
|
||||
mCases.push_back({label, std::move(testCase)});
|
||||
}
|
||||
|
||||
bool TestCaseRunner::Run()
|
||||
{
|
||||
bool testsPassed = true;
|
||||
for(const auto& test : mCases)
|
||||
{
|
||||
std::cout << "Running " << test.first << std::endl;
|
||||
const auto result = test.second->Run();
|
||||
if (!result)
|
||||
{
|
||||
std::cout << test.first << " Failed" << std::endl;
|
||||
testsPassed = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return testsPassed;
|
||||
}
|
18
test/test_utils/TestCaseRunner.h
Normal file
18
test/test_utils/TestCaseRunner.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
#pragma once
|
||||
|
||||
#include "TestCase.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class TestCaseRunner
|
||||
{
|
||||
public:
|
||||
|
||||
void AddTestCase(const std::string& label, TestCasePtr testCase);
|
||||
|
||||
bool Run();
|
||||
|
||||
private:
|
||||
using TestInstance = std::pair<std::string, TestCasePtr>;
|
||||
std::vector<TestInstance> mCases;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue