Improve audio and midi support.

This commit is contained in:
jmsgrogan 2021-05-23 21:02:38 +01:00
parent 9bcc0ae88e
commit 8b5f485d1e
47 changed files with 1446 additions and 634 deletions

View 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>;

View 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;
}

View 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;
};