From 4c3515936daf6b8f05826eb278142698ccd40c38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingy=20d=C3=B6t=20Net?= Date: Tue, 2 Jun 2020 10:21:17 -0700 Subject: [PATCH] Run external test suites from the yaml/libyaml-test repo --- .github/workflows/main.yml | 2 +- .gitignore | 2 +- .makefile | 6 ++--- Makefile.am | 46 +++++++++++++++++++++----------------- tests/run-all-tests.sh | 3 +-- 5 files changed, 30 insertions(+), 29 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c2bdef47..e8eeb0d7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,7 +43,7 @@ jobs: - run: | git clean -d -x -f - rm -fr tests/run-test-suite + rm -fr libyaml-test git worktree prune - name: Compiler version diff --git a/.gitignore b/.gitignore index 90840c8a..7c8f2230 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,7 @@ config.h* stamp-h1 !config/config.h.in /packaging/ +/libyaml-test/ /tests/run-dumper /tests/run-emitter /tests/run-emitter-test-suite @@ -40,7 +41,6 @@ stamp-h1 /tests/example-deconstructor-alt /tests/example-reformatter /tests/example-reformatter-alt -/tests/run-test-suite /tests/test-reader /tests/test-version /dist/ diff --git a/.makefile b/.makefile index 9d526a4d..06d17895 100644 --- a/.makefile +++ b/.makefile @@ -28,8 +28,7 @@ MAKE_TARGETS := \ test-all \ test-suite \ -# SOURCE_FILES := $(shell find . | grep '\.c$$') -SOURCE_FILES := $(shell find tests/run-test-suite | grep '\.c$$') +SOURCE_FILES := $(shell find . | grep '\.c$$') ifneq ($(shell which gindent),) INDENT := gindent else @@ -59,5 +58,4 @@ indent: distclean purge: git clean -dxf -e GNUmakefile - rm -fr tests/run-test-suite - git worktree prune + rm -fr libyaml-test diff --git a/Makefile.am b/Makefile.am index 551c7407..3a09c03c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,9 +5,18 @@ 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 := $(PWD) + +LIBYAML_TEST_REPO ?= https://github.com/yaml/libyaml-test +LIBYAML_TEST_COMMIT ?= 1f1b00ab6763647d05e44200b63fa62f1d2269a3 + +# XXX +LIBYAML_TEST_REPO := https://github.com/yaml/libyaml-test +LIBYAML_TEST_COMMIT := origin/master + +# NOTE: Uncomment to use a local copy of libyaml-test +# LIBYAML_TEST_REPO := ../libyaml-test/.git +# LIBYAML_TEST_COMMIT := master pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = yaml-0.1.pc @@ -17,38 +26,33 @@ maintainer-clean-local: -find ${builddir} -name Makefile.in -exec rm -f '{}' ';' distclean-local: - rm -fr tests/run-test-suite packaging + rm -fr libyaml-test packaging -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 +test-suite: libyaml-test all + make -C $< $@ -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 - -packaging: - -git branch --track $@ origin/$@ - git worktree add --force $@ $@ +libyaml-test: + -git clone $(LIBYAML_TEST_REPO) $@ + ( cd $@ && git reset --hard $(LIBYAML_TEST_COMMIT) ) docker-dist: packaging make -C $