Improved testing

* Refactored workflows to use a single workflow for both VM and non-VM builds
  * Compiler tests are now able to test compilation of different architectures
This commit is contained in:
kobalicek
2023-03-11 00:30:50 +01:00
parent d7edac813a
commit c1019f1642
8 changed files with 388 additions and 248 deletions

View File

@@ -29,33 +29,39 @@ public:
//! A test case interface for testing AsmJit's Compiler.
class TestCase {
public:
TestCase(const char* name = nullptr) {
TestCase(const char* name, asmjit::Arch arch) {
if (name)
_name.assign(name);
_arch = arch;
}
virtual ~TestCase() {}
inline const char* name() const { return _name.data(); }
inline asmjit::Arch arch() const { return _arch; }
virtual void compile(asmjit::BaseCompiler& cc) = 0;
virtual bool run(void* func, asmjit::String& result, asmjit::String& expect) = 0;
asmjit::String _name;
asmjit::Arch _arch;
};
class TestApp {
public:
std::vector<std::unique_ptr<TestCase>> _tests;
unsigned _nFailed = 0;
size_t _outputSize = 0;
const char* _arch = nullptr;
bool _helpOnly = false;
bool _verbose = false;
bool _dumpAsm = false;
bool _dumpHex = false;
TestApp() noexcept {}
unsigned _nFailed = 0;
size_t _outputSize = 0;
TestApp() noexcept
: _arch("all") {}
~TestApp() noexcept {}
void add(TestCase* test) noexcept {