gbasm: add support for generating source input

By adding an "init" function per test, it is easier to
generate code that would be laborious to write by hand.
This commit is contained in:
2017-05-20 16:50:49 -07:00
parent 70a7e80d3e
commit b0577cebc6
2 changed files with 6 additions and 1 deletions

View File

@@ -36,6 +36,10 @@ static void run_test(const void *test_data)
int rc;
size_t len;
if (test->init != NULL) {
test->init();
}
src = strdup(test->asm_source);
memset(program, 0, sizeof(program));

View File

@@ -4,10 +4,11 @@
#include <stdint.h>
struct gbasm_test {
void (*init)(void);
const char *name;
const char *asm_source;
const uint8_t *expected_output;
const int expected_output_len;
int expected_output_len;
};
struct gbasm_tests {