aboutsummaryrefslogtreecommitdiff
path: root/tests/makefile
blob: 21f68dd8708041fc1956485fefe3ee514d1c088f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
include ./tests.mk

LLVM			?= 0
CROSS_COMPILE 		:=
COMPILER		!= [ "$(LLVM)" != "0" ] \
				&& echo clang --target="$(CROSS_COMPILE)" \
				|| echo $(CROSS_COMPILE)gcc

CFLAGS			:= -Wall -Wextra -O0 -g
INCLUDE_FLAGS		:= -I include
COMPILE_JIT_TEST 	:= $(COMPILER) $(CFLAGS) $(INCLUDE_FLAGS)
COMPILE_BCODE_TEST	:= $(COMPILER) $(CFLAGS) $(INCLUDE_FLAGS) -DFORCE_BCODE=1

.PHONY: check
check: check-bcode check-jit
	echo "Success!"

.PHONY: check-bcode
check-bcode: $(BCODE_TESTS)
	@echo "Running bytecode tests..."
	@set -e; for test in $(BCODE_TESTS); do \
		echo "Testing: $$test"; \
		./$$test; \
	done

.PHONY: check-jit
check-jit: $(JIT_TESTS)
	@echo "Running jit tests..."
	@set -e; for test in $(JIT_TESTS); do \
		echo "Testing: $$test"; \
		./$$test; \
	done