Refactored tests; make just builds library, make test builds/runs tests

This commit is contained in:
Meredith L. Patterson 2012-11-13 22:29:25 -05:00
parent 236ec733a1
commit de8db18db4
12 changed files with 613 additions and 615 deletions

View file

@ -1,5 +1,6 @@
// At this point, this is just a compile/link test.
#include <glib.h>
#include "hammer.h"
#include "test_suite.h"
HParserTestcase testcases[] = {
{(unsigned char*)"1,2,3", 5, "(u0x31 u0x32 u0x33)"},
@ -9,14 +10,13 @@ HParserTestcase testcases[] = {
{ NULL, 0, NULL }
};
void test_benchmark_1() {
static void test_benchmark_1() {
const HParser *parser = h_sepBy1(h_choice(h_ch('1'), h_ch('2'), h_ch('3'), NULL), h_ch(','));
HBenchmarkResults *res = h_benchmark(parser, testcases);
h_benchmark_report(stderr, res);
}
int main(int argc, char **argv) {
test_benchmark_1();
return 0;
void register_benchmark_tests(void) {
g_test_add_func("/core/benchmark/1", test_benchmark_1);
}