summaryrefslogtreecommitdiff
path: root/tests/run-test-suite/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run-test-suite/Makefile')
-rw-r--r--tests/run-test-suite/Makefile29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/run-test-suite/Makefile b/tests/run-test-suite/Makefile
new file mode 100644
index 0000000..bdf89f6
--- /dev/null
+++ b/tests/run-test-suite/Makefile
@@ -0,0 +1,29 @@
+.PHONY: test
+GITHUB_ORG_URI := https://github.com/yaml
+TEST_SUITE_URL := $(GITHUB_ORG_URI)/yaml-test-suite
+LIBYAML_DIR ?= $(PWD)/libyaml-parser-emitter/libyaml
+
+default: help
+
+help:
+ @echo 'test - Run the tests'
+ @echo 'clean - Remove generated files'
+ @echo 'help - Show help'
+
+# Depends on parser and emitter but, building parser will also build emitter.
+# Building twice makes things fail. Note: Some environments like on OS X, the
+# shell resets the {DY,}LD_LIBRARY_PATH vars, so we work around it like so:
+test: data src/libyaml-parser
+ (export MY_LD_LIBRARY_PATH=$(LIBYAML_DIR)/src/.libs; prove -lv test)
+
+clean:
+ rm -fr data
+
+data:
+ git clone $(TEST_SUITE_URL) $@ --branch=$@
+
+%/libyaml-parser %/libyaml-emitter: %
+ (cd $<; make build)
+
+libyaml-parser-emitter:
+ git clone $(GITHUB_ORG_URI)/$@ $@