Skip to content

Commit

Permalink
Run external test suites from the yaml/libyaml-test repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Jun 22, 2020
1 parent acd6f6f commit 04853de
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:

- run: |
git clean -d -x -f
rm -fr tests/run-test-suite
rm -fr libyaml-test
git worktree prune
- name: Compiler version
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ config.h*
/configure
stamp-h1
!config/config.h.in
/libyaml-test/
/tests/run-dumper
/tests/run-emitter
/tests/run-emitter-test-suite
Expand All @@ -39,7 +40,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/
3 changes: 3 additions & 0 deletions .libyaml-test
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This is the `libyaml-test` repository URL and the branch to use:

https://github.com/yaml/libyaml-test 2020-06-22
6 changes: 2 additions & 4 deletions .makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,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
Expand Down Expand Up @@ -61,5 +60,4 @@ indent:

distclean purge:
git clean -dxf -e GNUmakefile
rm -fr tests/run-test-suite
git worktree prune
rm -fr libyaml-test
32 changes: 14 additions & 18 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 '^https' .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
Expand All @@ -17,35 +19,29 @@ 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

docker-dist:
make -C pkg/docker libyaml-dist

libyaml-test:
-git clone $(LIBYAML_TEST_REPO) $@
( cd $@ && git reset --hard $(LIBYAML_TEST_COMMIT) )
22 changes: 11 additions & 11 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,37 @@ To build and install the library, run:

$ ./configure
$ make
# make install
$ make install

Required packages:

- gcc
- libtool
- make

If you checked the source code from the Git repository, run
If you cloned the source code from the Git repository, run:

$ ./bootstrap
$ ./configure
$ make
# make install
$ make install

Required packages:

- autoconf
- gcc
- libtool
- make

For more information, check the [LibYAML
homepage](https://github.com/yaml/libyaml).
This libyaml source code repository is hosted at
https://github.com/yaml/libyaml.

Discuss LibYAML with the maintainers in IRC #libyaml irc.freenode.net.
To contribute changes, see https://github.com/yaml/libyaml/wiki/Contributing.

You may also use the [YAML-Core mailing
list](http://lists.sourceforge.net/lists/listinfo/yaml-core).
Discuss LibYAML with the maintainers in IRC #libyaml irc.freenode.net.

Submit bug reports and feature requests to the [LibYAML bug
tracker](https://github.com/yaml/libyaml/issues/new).
Submit bug reports and feature requests to
https://github.com/yaml/libyaml/issues/.

This project was developed for Python Software Foundation as a part of Google
Summer of Code under the mentorship of Clark Evans.
Expand All @@ -43,4 +43,4 @@ The LibYAML module was written by Kirill Simonov <[email protected]>.
It is currently maintained by the YAML community.

LibYAML is released under the MIT license.
See the file LICENSE for more details.
See the file License for more details.
3 changes: 1 addition & 2 deletions tests/run-all-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ main() {

clean() {
git clean -d -x -f
rm -fr tests/run-test-suite
git worktree prune
rm -fr libyaml-test
}

main "$@"

0 comments on commit 04853de

Please sign in to comment.