Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
93 lines (70 loc) · 3.08 KB
/
Copy pathMakefile
File metadata and controls
93 lines (70 loc) · 3.08 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
SHELL=bash
.DEFAULT_GOAL := help
# See https://tech.davis-hansson.com/p/make/
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
.PHONY: help
help:
@printf "\033[33mUsage:\033[0m\n make TARGET\n\n\033[32m#\n# Commands\n#---------------------------------------------------------------------------\033[0m\n\n"
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' | awk 'BEGIN {FS = ":"}; {printf "\033[33m%s:\033[0m%s\n", $$1, $$2}'
#
# Variables
#---------------------------------------------------------------------------
CODECEPTION_ADAPTER = sources/codeception-adapter/tests/e2e/Codeception_Basic/composer.json
CODECEPTION_COPY_HASH = tests/Codeception/source.hash
CODECEPTION_COPY_SOURCES = $(shell find sources/codeception-adapter/tests/e2e/Codeception_Basic -type f 2>/dev/null)
PHPSPEC_ADAPTER = sources/phpspec-adapter/tests/e2e/PhpSpec/README.md
PHPSPEC_COPY_HASH = tests/PhpSpec/source.hash
PHPSPEC_COPY_SOURCES = $(shell find sources/phpspec-adapter/tests/e2e/PhpSpec -type f 2>/dev/null)
INFECTION = sources/infection/README.md
INFECTION_BIN = sources/infection/bin/infection
INFECTION_VENDOR = sources/infection/vendor
EXTENSION_INSTALLER = sources/extension-installer/composer.json
ABSTRACT_TESTFRAMEWORK_ADAPTER = sources/abstract-testframework-adapter/composer.json
#
# Commands (phony targets)
#---------------------------------------------------------------------------
.PHONY: test
test: ## Test the adapters
test: test-phpspec test-codeception
.PHONY: test-phpspec
test-phpspec: tests/PhpSpec/vendor ## Test the PHPSpec Adapter
cd tests/PhpSpec && vendor/bin/infection --test-framework=phpspec
.PHONY: test-codeception
test-codeception: tests/Codeception/vendor ## Test the Codeception Adapter
cd tests/Codeception && vendor/bin/infection --test-framework=codeception
#
# Rules from files (non-phony targets)
#---------------------------------------------------------------------------
$(INFECTION):
git submodule update --init sources/infection
touch -c $@
$(INFECTION_BIN): sources/infection/vendor
touch -c $@
sources/infection/vendor:
composer install --working-dir=sources/infection
touch -c $@
$(CODECEPTION_ADAPTER):
git submodule update --init sources/codeception-adapter
touch -c $@
$(PHPSPEC_ADAPTER):
git submodule update --init sources/phpspec-adapter
touch -c $@
$(EXTENSION_INSTALLER):
git submodule update --init sources/extension-installer
touch -c $@
$(ABSTRACT_TESTFRAMEWORK_ADAPTER):
git submodule update --init sources/abstract-testframework-adapter
touch -c $@
tests/Codeception/vendor: $(CODECEPTION_COPY_HASH) | $(EXTENSION_INSTALLER) $(ABSTRACT_TESTFRAMEWORK_ADAPTER)
composer update --working-dir=tests/Codeception
touch -c $@
$(CODECEPTION_COPY_HASH): $(CODECEPTION_ADAPTER) $(CODECEPTION_COPY_SOURCES)
./bin/sync-codeception-copy.sh
touch -c $@
tests/PhpSpec/vendor: $(PHPSPEC_COPY_HASH) | $(EXTENSION_INSTALLER) $(ABSTRACT_TESTFRAMEWORK_ADAPTER)
composer update --working-dir=tests/PhpSpec
touch -c $@
$(PHPSPEC_COPY_HASH): $(PHPSPEC_ADAPTER) $(PHPSPEC_COPY_SOURCES)
./bin/sync-phpspec-copy.sh
touch -c $@