-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (28 loc) · 897 Bytes
/
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
config_files = test/dbc.json
default: run-unit-tests
.PHONY: \
clean \
default \
test-dependencies \
run-unit-tests
clean:
rm -rf composer.lock vendor
composer.lock: | composer.json
composer install
vendor: composer.lock
composer install
${config_files}: %: | %.example
cp "$|" "$@"
test-dependencies: vendor ${config_files}
test/db-scripts/create-database.sql: test/dbc.json vendor
mkdir -p test/db-scripts
vendor/bin/generate-create-database-sql "$<" >"$@"
test/db-scripts/drop-database.sql: test/dbc.json vendor
mkdir -p test/db-scripts
vendor/bin/generate-drop-database-sql "$<" >"$@"
create-database: %: test/db-scripts/%.sql
cat '$<' | sudo -u postgres psql -v ON_ERROR_STOP=1
drop-database: %: test/db-scripts/%.sql
cat '$<' | sudo -u postgres psql -v ON_ERROR_STOP=1
run-unit-tests: test-dependencies
vendor/bin/phpunit --bootstrap test/phpunit-bootstrap.php test