forked from yaml/libyaml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include libyaml-test and libyaml-parser-emitter
Before the `make test-suite` command would clone yaml/libyaml-test which would in tuen clone yaml/libyaml-parser-emitter. Now they are part of the repository since they are not really useful outside the repository. They still clone the data branch of yaml/yaml-test-suite. That is where all the actual test data resides. That belongs outside the repo because it is intended for all yaml frameworks.
- Loading branch information
1 parent
52b6634
commit a672b07
Showing
19 changed files
with
876 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,62 @@ | ||
CMakeCache.txt | ||
CMakeFiles/ | ||
CTestTestfile.cmake | ||
Makefile | ||
Makefile.in | ||
Testing/ | ||
aclocal.m4 | ||
autom4te.cache | ||
cmake_install.cmake | ||
configure | ||
config | ||
config.h | ||
config.h.in | ||
config.h.in~ | ||
config.log | ||
config.status | ||
example-deconstructor | ||
example-deconstructor-alt | ||
example-reformatter | ||
example-reformatter-alt | ||
libtool | ||
libyaml.a | ||
libyaml-test/ | ||
run-dumper | ||
run-emitter | ||
run-loader | ||
run-parser | ||
run-scanner | ||
stamp-h1 | ||
test-reader | ||
test-version | ||
tests/test-reader | ||
tests/test-reader.log | ||
tests/test-reader.trs | ||
tests/test-suite.log | ||
tests/test-version | ||
tests/test-version.log | ||
tests/test-version.trs | ||
.deps | ||
.libs | ||
.deps/ | ||
.libs/ | ||
*~ | ||
*.BAK | ||
*.la | ||
*.lo | ||
*.o | ||
*.pc | ||
/CMakeCache.txt | ||
/CMakeFiles/ | ||
/CTestTestfile.cmake | ||
/Makefile | ||
Makefile.in | ||
/Testing/ | ||
/aclocal.m4 | ||
/autom4te.cache | ||
/cmake_install.cmake | ||
/config | ||
/config.h | ||
/config.h.in | ||
/config.h.in~ | ||
/config.log | ||
/config.status | ||
/configure | ||
/example-deconstructor | ||
/example-deconstructor-alt | ||
/example-reformatter | ||
/example-reformatter-alt | ||
/include/Makefile | ||
/libtool | ||
/libyaml.a | ||
/run-dumper | ||
/run-emitter | ||
/run-loader | ||
/run-parser | ||
/run-scanner | ||
/src/Makefile | ||
/stamp-h1 | ||
/test-reader | ||
/test-version | ||
/tests/Makefile | ||
/tests/example-deconstructor | ||
/tests/example-deconstructor-alt | ||
/tests/example-reformatter | ||
/tests/example-reformatter-alt | ||
/tests/run-dumper | ||
/tests/run-emitter | ||
/tests/run-loader | ||
/tests/run-parser | ||
/tests/run-scanner | ||
/tests/run-test-suite/data | ||
tests/run-test-suite/src/libyaml/ | ||
tests/run-test-suite/src/libyaml-emitter | ||
tests/run-test-suite/src/libyaml-parser | ||
/tests/test-reader | ||
/tests/test-reader.log | ||
/tests/test-reader.trs | ||
/tests/test-suite.log | ||
/tests/test-version | ||
/tests/test-version.log | ||
/tests/test-version.trs | ||
/win32/Makefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-kr -nut -nce -l250 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)/$@ $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
LibYAML Test Runner | ||
=================== | ||
|
||
Run libyaml-parser and libyaml-emitter against yaml-test-suite | ||
|
||
# Synopsis | ||
|
||
``` | ||
make test | ||
``` | ||
|
||
# Overview | ||
|
||
See: | ||
|
||
* https://github.com/yaml/libyaml | ||
* https://github.com/yaml/yaml-test-suite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
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 | ||
``` |
Oops, something went wrong.