-
Notifications
You must be signed in to change notification settings - Fork 21
/
Makefile.test262
38 lines (30 loc) · 1.45 KB
/
Makefile.test262
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
SHELL=/bin/bash
ifeq ($(shell test -d test262; echo $$?),0)
TEST262_CORE_POSITIVE?=$(shell find test262/test/suite/ch{08,09,10,11,12,13,14} -name '*.js' -exec grep -L '@negative' {} \; | grep -vFf list-invalid-tests.txt)
TEST262_CORE_NEGATIVE?=$(shell find test262/test/suite/ch{08,09,10,11,12,13,14} -name '*.js' -exec grep -q '@negative' {} \; -print; cat list-invalid-tests.txt)
endif
.PHONY: test262-core
test262-core: test262-core-positive test262-core-negative
.PHONY: test262-core-positive
test262-core-positive: $(TEST262_CORE_POSITIVE:%=%.out.positive)
.PHONY: test262-core-negative
test262-core-negative: $(TEST262_CORE_NEGATIVE:%=%.out.negative)
%.js.out.positive:
$(call krun-test262,$*.js,"positive")
%.js.out.negative:
$(call krun-test262,$*.js,"negative")
define krun-test262
( cat prelude.js $(1) >$(1).prelude && \
./jsmassage.sh -f $(1).prelude >$(1).prelude.massage && \
krun -d . --pattern-matching $(1).prelude.massage >$(1).out 2>$(1).err && \
test "`sed -n '/<k>/,/<\/k>/{ p }' $(1).out | tr -d ' \n'`" = "<k>@Normal</k>"; \
echo $$? >$(1).exitcode )
@if [ $(2) = "positive" ]; then \
if [ `cat $(1).exitcode` -eq 0 ]; then echo "#### $(1) succeed"; else echo "#### $(1) failed"; exit 1; fi; \
else \
if ! [ `cat $(1).exitcode` -eq 0 ]; then echo "#### $(1) succeed"; else echo "#### $(1) failed"; exit 1; fi; \
fi
endef
.PHONY: test262-clean
test262-clean:
find test262/test/suite/ch{08,09,10,11,12,13,14} -name '*.js.*' -exec rm -f {} \;