flint: add tests directory

This commit is contained in:
Dmitry Simonenko 2016-11-24 16:13:49 +03:00
parent 16fcb6add0
commit 2f96859234
2 changed files with 35 additions and 0 deletions

16
tests/env.c Normal file
View File

@ -0,0 +1,16 @@
/*
* machinarium.
*
* Cooperative multitasking engine.
*/
#include <machinarium.h>
int
main(int argc, char *argv[])
{
mm_t env = mm_new();
mm_free(env);
return 0;
}

19
tests/makefile Normal file
View File

@ -0,0 +1,19 @@
CC = gcc
RM = rm
CFLAGS = -I. -Wall -g -O0 -I../machinarium
LFLAGS_LIB = ../machinarium/libmachinarium.a
LFLAGS = $(LFLAGS_LIB) -luv
all: validate clean env
env:
$(CC) $(CFLAGS) env.c $(LFLAGS) -o env
validate:
@if [ ! -f $(LFLAGS_LIB) ]; then \
echo ""; \
echo "Please build the library first."; \
echo ""; \
exit 1; \
fi
.c.o:
$(CC) $(CFLAGS) -c $<
clean:
$(RM) -f env