]> andersk Git - libyaml.git/commitdiff
Rewrite make test-suite
authorTina Müller <cpan2@tinita.de>
Sat, 2 Dec 2017 00:06:12 +0000 (01:06 +0100)
committerTina Müller <cpan2@tinita.de>
Sat, 2 Dec 2017 21:23:23 +0000 (22:23 +0100)
No recursive make anymore

Remove MY_LD_LIBRARY_PATH and friends

This is now done by the wrapper script

Remove LIBYAML_DIR variable

not needed anymore

Merge ReadMe.md files to one

12 files changed:
.gitignore
Makefile.am
tests/CMakeLists.txt
tests/Makefile.am
tests/run-emitter-test-suite.c [moved from tests/run-test-suite/src/libyaml-emitter.c with 100% similarity]
tests/run-parser-test-suite.c [moved from tests/run-test-suite/src/libyaml-parser.c with 100% similarity]
tests/run-test-suite/Makefile
tests/run-test-suite/ReadMe.md
tests/run-test-suite/src/Makefile [deleted file]
tests/run-test-suite/src/ReadMe.md [deleted file]
tests/run-test-suite/test/libyaml-emitter.t
tests/run-test-suite/test/libyaml-parser.t

index 2bda964df34f80f93a5be0b7da22c6902f40ad99..74165f519865daab693eade7d82069deddbc27d9 100644 (file)
@@ -32,8 +32,10 @@ Makefile.in
 /libyaml.a
 /run-dumper
 /run-emitter
+/run-emitter-test-suite
 /run-loader
 /run-parser
+/run-parser-test-suite
 /run-scanner
 /src/Makefile
 /stamp-h1
@@ -46,8 +48,10 @@ Makefile.in
 /tests/example-reformatter-alt
 /tests/run-dumper
 /tests/run-emitter
+/tests/run-emitter-test-suite
 /tests/run-loader
 /tests/run-parser
+/tests/run-parser-test-suite
 /tests/run-scanner
 /tests/run-test-suite/data
 tests/run-test-suite/src/libyaml/
index d68289293f68fde417f47eb03085996f392d2926..c63b274da0a5d28051b520d9733e4abd5033d200 100644 (file)
@@ -25,6 +25,6 @@ test: all
        make -C tests check-TESTS
 
 test-suite:
-       (export LIBYAML_DIR=$$PWD; make -C tests/run-test-suite test)
+       make -C tests/run-test-suite test
 
 test-all: test test-suite
index d10b42468651de96885ce64f21e04fb4beab100c..be2ce399a6bf32f133c5db358081dd74b0c4b2b9 100644 (file)
@@ -11,8 +11,10 @@ foreach(name IN ITEMS
   example-reformatter-alt
   run-dumper
   run-emitter
+  run-emitter-test-suite
   run-loader
   run-parser
+  run-parser-test-suite
   run-scanner
   test-reader
   test-version
index 81decb40044af68c67750fddfc4ef03b9fe2a486..9597b7fef3ef8191287323b227e6d3affb328bb8 100644 (file)
@@ -5,4 +5,5 @@ TESTS = test-version test-reader
 check_PROGRAMS = test-version test-reader
 noinst_PROGRAMS = run-scanner run-parser run-loader run-emitter run-dumper     \
                                  example-reformatter example-reformatter-alt   \
-                                 example-deconstructor example-deconstructor-alt
+                                 example-deconstructor example-deconstructor-alt \
+                                 run-parser-test-suite run-emitter-test-suite
index 3d39edc3568ad31f969a661a7b65174cc8f5d901..4b9570e414706a332a28e7a4b770eeb42634111c 100644 (file)
@@ -1,7 +1,6 @@
 .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
 
@@ -10,11 +9,8 @@ help:
        @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)
+test: data
+       prove -lv test
 
 clean:
        rm -fr data
@@ -22,9 +18,3 @@ clean:
 data:
        git clone $(TEST_SUITE_URL) $@ --branch=$@
 
-%/libyaml-parser %/libyaml-emitter: %
-       (cd $<; make clean build)
-       (cd $<; make clean build)
-
-libyaml-parser-emitter:
-       git clone $(GITHUB_ORG_URI)/$@ $@
index c1ef208a3beda8c2eaf4df56ac10efd7f8cb93e8..f991b378e30495d527d9b11e82c30c49668a4699 100644 (file)
@@ -1,17 +1,35 @@
 LibYAML Test Runner
 ===================
 
-Run libyaml-parser and libyaml-emitter against yaml-test-suite
+Run run-parser-test-suite and run-emitter-test-suite against yaml-test-suite
 
 # Synopsis
 
 ```
 make test
+# Run tests from yaml-test-suite
+make test-suite
 ```
 
 # Overview
 
 See:
 
-* https://github.com/yaml/libyaml
 * https://github.com/yaml/yaml-test-suite
+
+# Usage
+
+Print parse events for a YAML file (or stdin):
+```
+../run-parser-test-suite file.yaml
+../run-parser-test-suite < file.yaml
+cat file.yaml | ../run-parser-test-suite
+```
+
+Print the YAML for a libyaml-parser events file (or stdin):
+```
+../run-emitter-test-suite file.events
+../run-emitter-test-suite < file.events
+cat file.events | ../libyaml-run-test-suite
+```
+
diff --git a/tests/run-test-suite/src/Makefile b/tests/run-test-suite/src/Makefile
deleted file mode 100644 (file)
index de0d49a..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-LIBYAML_DIR ?= libyaml
-LIBYAML_REPO ?= https://github.com/yaml/libyaml
-LIBYAML_BRANCH ?= master
-define HELP
-This Makefile supports the following targets:
-
-    build    - Build ./libyaml-parser and ./libyaml-emitter
-    test     - Run tests
-
-endef
-export HELP
-
-help:
-       @echo "$$HELP"
-
-build: touch libyaml-parser libyaml-emitter
-
-touch:
-ifneq ($(LIBYAML_DIR),libyaml)
-       touch *.c
-endif
-
-libyaml-%: $(LIBYAML_DIR)/tests/.libs/run-%
-       cp $< $@
-
-$(LIBYAML_DIR)/tests/.libs/%: $(LIBYAML_DIR)/tests/%.c $(LIBYAML_DIR)/Makefile
-       make -C $(LIBYAML_DIR)
-ifneq ($(LIBYAML_DIR),libyaml)
-       (cd $(LIBYAML_DIR) && git checkout tests/run-parser.c tests/run-emitter.c)
-endif
-
-$(LIBYAML_DIR)/tests/run-%: libyaml-% $(LIBYAML_DIR)
-       cp $< $@
-.SECONDARY: \
-       $(LIBYAML_DIR)/tests/run-parser.c \
-       $(LIBYAML_DIR)/tests/run-emitter.c \
-       $(LIBYAML_DIR)/tests/.libs/run-parser \
-       $(LIBYAML_DIR)/tests/.libs/run-emitter
-
-$(LIBYAML_DIR)/Makefile: $(LIBYAML_DIR)
-       ( cd $< && ./bootstrap && ./configure )
-       touch $@
-
-$(LIBYAML_DIR):
-       git clone $(LIBYAML_REPO) $@
-       sleep 1
-       touch *.c
-
-.PHONY: test
-test: build
-       prove -lv test/
-
-clean:
-       rm -fr libyaml libyaml-parser libyaml-emitter
diff --git a/tests/run-test-suite/src/ReadMe.md b/tests/run-test-suite/src/ReadMe.md
deleted file mode 100644 (file)
index ced29cb..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-libyaml-parser-emitter
-======================
-
-Parser and Emitter CLI tools for libyaml
-
-# Synopsis
-
-```
-make build
-make test
-```
-
-# Usage
-
-Print parse events for a YAML file (or stdin):
-```
-./libyaml-parser file.yaml
-./libyaml-parser < file.yaml
-cat file.yaml | ./libyaml-parser
-```
-
-Print the YAML for a libyaml-parser events file (or stdin):
-```
-./libyaml-emitter file.events
-./libyaml-emitter < file.events
-cat file.events | ./libyaml-emitter
-```
-
-# Build
-
-```
-export LIBYAML_DIR=/path/to/libyaml   # Optional
-make build
-```
index 2b12b3a5d87ac9cd1de3643d18910017b3566fc5..b092c6fe389d5d4846d11cd152f9e068fc828fe5 100755 (executable)
@@ -8,11 +8,6 @@ else
   ids=($(cut -d: -f1 < test/libyaml-emitter.list))
 fi
 
-# Some environments like on OS X, the shell resets the following vars, so we
-# work around it like so:
-export LD_LIBRARY_PATH="${MY_LD_LIBRARY_PATH:?}"
-export DYLD_LIBRARY_PATH="${MY_LD_LIBRARY_PATH:?}"
-
 count=0
 for id in "${ids[@]}"; do
   dir="data/$id"
@@ -20,7 +15,7 @@ for id in "${ids[@]}"; do
   [[ -e "$dir/in.yaml" ]] || continue
   want="$dir/out.yaml"
   [[ -e $want ]] || want="$dir/in.yaml"
-  ./src/libyaml-emitter "$dir/test.event" > /tmp/test.out || {
+  ../../tests/run-emitter-test-suite "$dir/test.event" > /tmp/test.out || {
     (
       cat "$dir/test.event"
       cat "$want"
index 1c3d0c4d34f4777bb6720f2cf540b85f0445c3c6..6be2395d747748e2a730f196acb52e3bfb8d2234 100755 (executable)
@@ -13,7 +13,7 @@ for id in "${ids[@]}"; do
   dir="data/$id"
   label="$id: $(< $dir/===)"
   [[ -e "$dir/in.yaml" ]] || continue
-  ./src/libyaml-parser "$dir/in.yaml" > /tmp/test.out || {
+  ../../tests/run-parser-test-suite "$dir/in.yaml" > /tmp/test.out || {
     (
       cat "$dir/in.yaml"
       cat "$dir/test.event"
This page took 0.052216 seconds and 5 git commands to generate.