-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
64 lines (52 loc) · 2 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# SPDX-License-Identifier: GPL-3.0-or-later
# Docker is default tool for running containers
CONTAINER_TOOL := docker
all: build-test check
podman: CONTAINER_TOOL = podman
podman: build-test check-podman
.PHONY: all podman
build-test: clean
$(CONTAINER_TOOL) build -t diff-shellcheck-test-image test/
.PHONY: build-test
check: check-$(CONTAINER_TOOL)
check-podman:
$(CONTAINER_TOOL) run -t -v "${PWD}:/home:O" --name diff-shellcheck-test diff-shellcheck-test-image 'cd /home && bats test'
check-docker:
$(CONTAINER_TOOL) run -t -v "${PWD}:/home" --name diff-shellcheck-test diff-shellcheck-test-image 'cd /home && bats test'
.PHONY: check check-podman check-docker
# coverage: clean coverage-$(CONTAINER_TOOL)
# Use ulimit -n 524288 as work-around for issue when kcov was using `ulimit -a`: "open files (-n) 1073741816" isntead of "-n: file descriptors 524288"
# coverage-podman: CONTAINER_TOOL = podman
# coverage-podman:
# $(CONTAINER_TOOL) container rm -f diff-shellcheck-test
# $(CONTAINER_TOOL) run -t -v "${PWD}:/home:O" --name diff-shellcheck-test diff-shellcheck-test-image \
# 'cd /home && mkdir --mode 777 coverage && \
# ulimit -n 524288 \
# kcov \
# --clean \
# --include-path . \
# --exclude-path test/bats \
# --exclude-path test/test_helper \
# coverage \
# bats test'
# $(CONTAINER_TOOL) cp diff-shellcheck-test:/home/coverage .
# coverage-docker:
# $(CONTAINER_TOOL) container rm -f diff-shellcheck-test
# $(CONTAINER_TOOL) run -t -v "${PWD}:/home" --name diff-shellcheck-test diff-shellcheck-test-image \
# 'cd /home && mkdir --mode 777 coverage && \
# ulimit -n 524288 \
# kcov \
# --clean \
# --include-path . \
# --exclude-path test/bats \
# --exclude-path test/test_helper \
# coverage \
# bats test'
.PHONY: coverage coverage-podman coverage-docker
clean:
$(CONTAINER_TOOL) container rm -f diff-shellcheck-test
rm -rf coverage/
# clean-podman could be used independently
clean-podman: CONTAINER_TOOL = podman
clean-podman: clean
.PHONY: clean clean-podman