aboutsummaryrefslogtreecommitdiff
path: root/tests/Makefile
blob: 4c6f82bec3e14ba8a8f675c71d6db11374fcd9eb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
RUBY=ruby
UNITY_DIR=./Unity
CC=gcc
CFLAGS=-I$(UNITY_DIR)/src

.PHONY: all
all: build run

.PHONY: build
build:
	for testfile in $$(find . -type f -name "*.tests.c")                                                ;\
	do                                                                                                   \
	    $(RUBY) $(UNITY_DIR)/auto/generate_test_runner.rb $$testfile                                    ;\
	    $(CC) $(CFLAGS) -o $${testfile%.c} $(UNITY_DIR)/src/unity.c $$testfile $${testfile%.c}_Runner.c ;\
	done

.PHONY: run
run:
	for runner in $$(find . -type f -name "*.tests") ;\
	do                                               \
	    $$runner || exit                            ;\
	done