forked from scaleway/natasha
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (34 loc) · 1.17 KB
/
Makefile
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
ifeq ($(RTE_SDK),)
$(error "Please define RTE_SDK environment variable")
endif
ifndef RTE_TARGET
export RTE_TARGET=x86_64-native-linuxapp-gcc
endif
export RTE_SRCDIR=$(abspath src)
export RTE_OUTPUT=$(abspath build)
# `make` without argument calls the first rule. Call make in src/ to build
# natasha.
default:
$(MAKE) -C . -f $(RTE_SRCDIR)/Makefile
############
# Unitests #
############
# Directories names in src/tests/
TESTS=$(shell find $(RTE_SRCDIR)/tests \
-mindepth 1 -maxdepth 1 -type d \
-exec basename {} \;)
build_tests:
@for test in $(TESTS); do \
$(MAKE) -C . -f $(RTE_SRCDIR)/tests/$$test/Makefile \
--no-print-directory \
RTE_OUTPUT=$(RTE_OUTPUT)/$$test \
UNITTEST=1 \
build_test \
; done
run_tests: build_tests
@for test in $(TESTS); do \
sudo $(RTE_OUTPUT)/$$test/test \
&& echo "[OK] $$test" || \
echo "[FAIL] $$test (status=$$?)" \
; done
test: run_tests