summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am32
1 files changed, 14 insertions, 18 deletions
diff --git a/Makefile.am b/Makefile.am
index 45d9c27..ecba6d5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,9 +5,11 @@ SUBDIRS = include src . tests
EXTRA_DIST = Changes ReadMe.md License CMakeLists.txt doc/doxygen.cfg
-LIBYAML_TEST_SUITE_RUN_REPO_DEFAULT := https://github.com/yaml/libyaml
-LIBYAML_TEST_SUITE_RUN_REPO ?= $(LIBYAML_TEST_SUITE_RUN_REPO_DEFAULT)
-LIBYAML_TEST_SUITE_RUN_BRANCH ?= run-test-suite
+export LIBYAML_ROOT := $(shell pwd)
+
+LIBYAML_TEST := $(shell grep -E '^(http|git)' .libyaml-test | tail -n1)
+LIBYAML_TEST_REPO ?= $(word 1, $(LIBYAML_TEST))
+LIBYAML_TEST_COMMIT ?= $(word 2, $(LIBYAML_TEST))
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = yaml-0.1.pc
@@ -17,31 +19,22 @@ maintainer-clean-local:
-find ${builddir} -name Makefile.in -exec rm -f '{}' ';'
distclean-local:
- rm -fr tests/run-test-suite
+ rm -fr libyaml-test
-git worktree prune
-.PHONY: bootstrap
+.PHONY: bootstrap libyaml-test
bootstrap: maintainer-clean
./bootstrap
./configure
make
+test-all: test test-suite
+
test: all
make -C tests check-TESTS
-test-suite: tests/run-test-suite all
- make -C $< test
-
-test-all: test test-suite
-
-tests/run-test-suite:
-ifeq ($(LIBYAML_TEST_SUITE_RUN_REPO),$(LIBYAML_TEST_SUITE_RUN_REPO_DEFAULT))
- -git branch --track $(LIBYAML_TEST_SUITE_RUN_BRANCH) origin/$(LIBYAML_TEST_SUITE_RUN_BRANCH)
- -git worktree prune
- git worktree add $@ $(LIBYAML_TEST_SUITE_RUN_BRANCH)
- else
- git clone --branch $(LIBYAML_TEST_SUITE_RUN_BRANCH) $(LIBYAML_TEST_SUITE_RUN_REPO) $@
- endif
+test-suite: libyaml-test all
+ make -C $< $@
docker-build:
make -C pkg/docker build
@@ -49,3 +42,6 @@ docker-build:
docker-dist:
make -C pkg/docker libyaml-dist
+libyaml-test:
+ -git clone $(LIBYAML_TEST_REPO) $@
+ ( cd $@ && git reset --hard $(LIBYAML_TEST_COMMIT) )