forked from pirxpilot/postcss-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
77 lines (57 loc) · 2.32 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
65
66
67
68
69
70
71
72
73
74
75
76
77
all: clean lint test
lint:
./node_modules/.bin/jshint *.js
TESTS = opts stdout stdin config config-all js-config js-config-all invalid
DIFF = diff -q
test: test/build test-help test-version $(patsubst %,test/build/%.css,$(TESTS)) test-multi test-replace test-local-plugins
test-help:
./bin/postcss --help
test-version:
./bin/postcss --version
test-multi:
./bin/postcss -u postcss-url --dir test/build test/multi*.css
$(DIFF) test/build/multi*.css --to-file=test/ref
test-replace:
cp test/replace.css test/build/replace.css
./bin/postcss -u postcss-url --postcss-url.url "inline" --replace test/build/replace.css
$(DIFF) test/build/replace.css test/ref/replace.css
test-watch: test/import-*.css
echo '@import "import-foo.css";' > test/import-index.css
./bin/postcss -c test/config-watch.js -w & echo $$! > test/watch.pid
sleep 0.2
$(DIFF) test/build/watch.css test/ref/watch-1.css
echo '@import "import-bar.css";' >> test/import-index.css
sleep 0.2
$(DIFF) test/build/watch.css test/ref/watch-2.css
kill `cat test/watch.pid` # FIXME: never reached on failure
rm test/watch.pid
test-local-plugins:
cd test; ../bin/postcss --use a-dummy-plugin --local-plugins -o build/local-plugins in.css
test/build/opts.css: test/in.css
./bin/postcss -u postcss-url --postcss-url.url=rebase -o $@ $<
$(DIFF) $@ $(subst build,ref,$@)
test/build/stdout.css: test/in.css
./bin/postcss --use ./test/dummy-plugin $< > $@
$(DIFF) $@ $(subst build,ref,$@)
test/build/stdin.css: test/in.css
./bin/postcss --use ./test/dummy-plugin --output $@ < $<
$(DIFF) $@ $(subst build,ref,$@)
test/build/invalid.css: test/in-force-error.css
./bin/postcss --use ./test/dummy-plugin --dummy-plugin.fail=true -o $@ $< || echo Error is OK here....
test/build/config.css: test/in.css
./bin/postcss -u postcss-url -c test/config.json -o $@ $<
$(DIFF) $@ $(subst build,ref,$@)
test/build/config-all.css: test/in.css
./bin/postcss -c test/config-all.json
$(DIFF) $@ $(subst build,ref,$@)
test/build/js-config.css: test/in.css
./bin/postcss -u postcss-url -c test/config.js -o $@ $<
$(DIFF) $@ $(subst build,ref,$@)
test/build/js-config-all.css: test/in.css
./bin/postcss -c test/config-all.js
$(DIFF) $@ $(subst build,ref,$@)
test/build:
mkdir -p $@
clean:
rm -rf test/build
.PHONY: all lint clean test test-help test-version test-multi test-watch test-replace