make testing more robust
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
snippet testfile
|
||||
#include <criterion/criterion.h>
|
||||
#include "allocator.h"
|
||||
|
||||
Test($1, $2) {
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// This is used to have a single file that implements the allocators when all
|
||||
// the test files are compiled together.
|
||||
|
||||
#define ALLOCATOR_IMPLEMENTATION
|
||||
#include "allocator.h"
|
||||
@@ -18,7 +18,7 @@ test:
|
||||
echo "No test files found!"; \
|
||||
else \
|
||||
echo "Compiling all test files into $(TESTBIN)..."; \
|
||||
$(CC) $(CFLAGS) $$files -o $(TESTBIN) $(LDFLAGS); \
|
||||
$(CC) $(CFLAGS) _allocator_impl.c $$files -o $(TESTBIN) $(LDFLAGS); \
|
||||
echo "Running tests..."; \
|
||||
$(TESTBIN); \
|
||||
fi
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <criterion/criterion.h>
|
||||
#define ALLOCATOR_IMPLEMENTATION
|
||||
#include "allocator.h"
|
||||
|
||||
|
||||
Test(std_allocator, test) {
|
||||
allocator_t this = allocator_stdlib;
|
||||
void *ptr = allocator_alloc(this, 10);
|
||||
|
||||
Reference in New Issue
Block a user