forked from larose/utt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (26 loc) · 1002 Bytes
/
Makefile
File metadata and controls
37 lines (26 loc) · 1002 Bytes
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
INTEGRATION_DIR = test/integration
UNIT_DIR = test/unit
TMP = tmp
TEST_TMP = $(TMP)/integration
CONTAINER_DATA_DIR = $(TEST_TMP)/py$*
CONTAINER_NAME = utt-integration-py$*
TEST_FILES := $(INTEGRATION_DIR)/Makefile $(INTEGRATION_DIR)/data $(TMP)/dist/utt-*.tar.gz
all:
clean:
rm -rf $(TMP)
integration: integration-py2 integration-py3
integration-py%: integration-container-py%
docker run --rm -ti $(CONTAINER_NAME) $(INTEGRATION_CMD)
integration-data-py%: sdist
mkdir -p $(CONTAINER_DATA_DIR)
rsync -rtm --delete $(TEST_FILES) $(CONTAINER_DATA_DIR)
integration-container-py%: integration-data-py% $(TEST_TMP)/py%/Dockerfile
docker build -t $(CONTAINER_NAME) $(TEST_TMP)/py$*
sdist:
mkdir -p $(TMP)
python3 setup.py sdist --dist-dir $(TMP)/dist --manifest $(TMP)/MANIFEST
unit:
python3 -munittest discover -s $(UNIT_DIR) $(TESTOPTS)
$(TEST_TMP)/py%/Dockerfile: $(INTEGRATION_DIR)/Dockerfile.template
sed -e "s/{{PYTHON_VERSION}}/$*/" $< > $@
.PHONY: all clean integration sdist unit