From 7b73fcf75045930398622e76341db8e62ea1e765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingy=20d=C3=B6t=20Net?= Date: Sun, 7 Jan 2018 23:08:56 -0800 Subject: Move testing code into run-test-suite-code branch --- .gitignore | 2 +- Makefile | 14 ++++----- ReadMe.md | 9 +++--- conf/pin.tsv | 4 +-- src/test/example-2.27-invoice.events | 59 ------------------------------------ src/test/example-2.27-invoice.out | 26 ---------------- src/test/example-2.27-invoice.yaml | 29 ------------------ src/test/libyaml-emitter.t | 26 ---------------- src/test/libyaml-parser.t | 26 ---------------- test/libyaml-emitter.t | 34 --------------------- test/libyaml-parser-error.t | 26 ---------------- test/libyaml-parser.t | 32 ------------------- 12 files changed, 15 insertions(+), 272 deletions(-) delete mode 100644 src/test/example-2.27-invoice.events delete mode 100644 src/test/example-2.27-invoice.out delete mode 100644 src/test/example-2.27-invoice.yaml delete mode 100644 src/test/libyaml-emitter.t delete mode 100644 src/test/libyaml-parser.t delete mode 100755 test/libyaml-emitter.t delete mode 100755 test/libyaml-parser-error.t delete mode 100755 test/libyaml-parser.t diff --git a/.gitignore b/.gitignore index c6eed6a..1cd1b24 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ /data/ -/list/ +/test/ diff --git a/Makefile b/Makefile index e039d7e..ecb0478 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ PINNED_COMMITS := $(shell ./bin/pin) $(eval MASTER_COMMIT = $(word 1, $(PINNED_COMMITS))) -$(eval LIST_COMMIT = $(word 2, $(PINNED_COMMITS))) +$(eval CODE_COMMIT = $(word 2, $(PINNED_COMMITS))) $(eval DATA_COMMIT = $(word 3, $(PINNED_COMMITS))) default: help @@ -13,19 +13,19 @@ help: @echo 'clean - Remove generated files' @echo 'help - Show help' -test: data list +test: data code prove -lv test clean: - rm -fr data list + rm -fr data test -git worktree prune data: git clone https://github.com/yaml/yaml-test-suite $@ --branch=$@ (cd $@ && git reset --hard $(DATA_COMMIT)) -list: - -git branch --track run-test-suite-list origin/run-test-suite-list +code: + -git branch --track run-test-suite-code origin/run-test-suite-code -git worktree prune - git worktree add $@ run-test-suite-list - (cd $@ && git reset --hard $(LIST_COMMIT)) + -git worktree add test run-test-suite-code + (cd test && git reset --hard $(CODE_COMMIT)) diff --git a/ReadMe.md b/ReadMe.md index 802361e..cdedab4 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -34,13 +34,14 @@ master and running `make test-suite`. The HEAD commit of your master is checked against `conf/pin.tsv`. The first row in the tsv file whose master-commit is found in your master history is used. -This will pin to the correct yaml-test-suite commit and the correct whitelist -commit. +This will pin to the correct yaml-test-suite commit and the correct +run-test-suite-code branch commit. -The whitelists are stored in the libyaml branch `run-test-suite-list`. +The test code and whitelists are stored in the libyaml branch +`run-test-suite-code`. NOTE: If no pinning is found, you will get a warning and the HEAD commit will -be used for the data and whitelist commits. +be used for the data and test code commits. # Test Runner Usage diff --git a/conf/pin.tsv b/conf/pin.tsv index 5f8fb20..c58a2be 100644 --- a/conf/pin.tsv +++ b/conf/pin.tsv @@ -1,2 +1,2 @@ -master commit........................... test suite white lists commit........... yaml-test-suite data branch commit...... -e4aee06ff401668404de21b4af4c6a90be0f35a6 2d6f87fb533aef06b7eccad44140ede3b9f76889 daf799e56372aa93c324d111c73b47a431d7e03b +master commit........................... run-test-suite-code commit.............. yaml-test-suite data branch commit...... +e4aee06ff401668404de21b4af4c6a90be0f35a6 c0a4e7a388658bffa53078a6ac28b3d2e118861b daf799e56372aa93c324d111c73b47a431d7e03b diff --git a/src/test/example-2.27-invoice.events b/src/test/example-2.27-invoice.events deleted file mode 100644 index fdd1b5f..0000000 --- a/src/test/example-2.27-invoice.events +++ /dev/null @@ -1,59 +0,0 @@ -+STR -+DOC --- -+MAP -=VAL :invoice -=VAL :34843 -=VAL :date -=VAL :2001-01-23 -=VAL :bill-to -+MAP &id001 -=VAL :given -=VAL :Chris -=VAL :family -=VAL :Dumars -=VAL :address -+MAP -=VAL :lines -=VAL |458 Walkman Dr.\nSuite #292\n -=VAL :city -=VAL :Royal Oak -=VAL :state -=VAL :MI -=VAL :postal -=VAL :48046 --MAP --MAP -=VAL :ship-to -=ALI *id001 -=VAL :product -+SEQ -+MAP -=VAL :sku -=VAL :BL394D -=VAL :quantity -=VAL :4 -=VAL :description -=VAL :Basketball -=VAL :price -=VAL :450.00 --MAP -+MAP -=VAL :sku -=VAL :BL4438H -=VAL :quantity -=VAL :1 -=VAL :description -=VAL :Super Hoop -=VAL :price -=VAL :2392.00 --MAP --SEQ -=VAL :tax -=VAL :251.42 -=VAL :total -=VAL :4443.52 -=VAL :comments -=VAL :Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338. --MAP --DOC --STR diff --git a/src/test/example-2.27-invoice.out b/src/test/example-2.27-invoice.out deleted file mode 100644 index 1a876c9..0000000 --- a/src/test/example-2.27-invoice.out +++ /dev/null @@ -1,26 +0,0 @@ ---- ! -invoice: 34843 -date: 2001-01-23 -bill-to: &id001 - given: Chris - family: Dumars - address: - lines: | - 458 Walkman Dr. - Suite #292 - city: Royal Oak - state: MI - postal: 48046 -ship-to: *id001 -product: -- sku: BL394D - quantity: 4 - description: Basketball - price: 450.00 -- sku: BL4438H - quantity: 1 - description: Super Hoop - price: 2392.00 -tax: 251.42 -total: 4443.52 -comments: Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338. diff --git a/src/test/example-2.27-invoice.yaml b/src/test/example-2.27-invoice.yaml deleted file mode 100644 index 4625739..0000000 --- a/src/test/example-2.27-invoice.yaml +++ /dev/null @@ -1,29 +0,0 @@ ---- ! -invoice: 34843 -date : 2001-01-23 -bill-to: &id001 - given : Chris - family : Dumars - address: - lines: | - 458 Walkman Dr. - Suite #292 - city : Royal Oak - state : MI - postal : 48046 -ship-to: *id001 -product: - - sku : BL394D - quantity : 4 - description : Basketball - price : 450.00 - - sku : BL4438H - quantity : 1 - description : Super Hoop - price : 2392.00 -tax : 251.42 -total: 4443.52 -comments: - Late afternoon is best. - Backup contact is Nancy - Billsmer @ 338-4338. diff --git a/src/test/libyaml-emitter.t b/src/test/libyaml-emitter.t deleted file mode 100644 index 7afd5f0..0000000 --- a/src/test/libyaml-emitter.t +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -got=$(mktemp) - -count=0 -for test in test/*.events; do - want=${test//.events/.out} - label="Emitting '$test' equals '$want'" - rc=0 - ./libyaml-emitter $test > $got || rc=$? - if [[ $rc -ne 0 ]]; then - echo "not ok $((++count)) - Error code $rc" - continue - fi - rc=0 - diff=$(diff -u $want $got) || rc=$? - if [[ $rc -eq 0 ]]; then - echo "ok $((++count)) - $label" - else - echo "not ok $((++count)) - $label" - diff=${diff//$'\n'/$'\n'# } - echo "# $diff" - fi -done - -echo "1..$count" diff --git a/src/test/libyaml-parser.t b/src/test/libyaml-parser.t deleted file mode 100644 index 40c56da..0000000 --- a/src/test/libyaml-parser.t +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -got=$(mktemp) - -count=0 -for test in test/*.yaml; do - want=${test//.yaml/.events} - label="Parsing '$test' equals '$want'" - rc=0 - ./libyaml-parser $test > $got || rc=$? - if [[ $rc -ne 0 ]]; then - echo "not ok $((++count)) - Error code $rc" - continue - fi - rc=0 - diff=$(diff -u $want $got) || rc=$? - if [[ $rc -eq 0 ]]; then - echo "ok $((++count)) - $label" - else - echo "not ok $((++count)) - $label" - diff=${diff//$'\n'/$'\n'# } - echo "# $diff" - fi -done - -echo "1..$count" diff --git a/test/libyaml-emitter.t b/test/libyaml-emitter.t deleted file mode 100755 index 573349d..0000000 --- a/test/libyaml-emitter.t +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -set -e - -if [[ $# -gt 0 ]]; then - ids=("$@") -else - ids=($(cut -d: -f1 < list/libyaml-emitter.list)) -fi - -count=0 -for id in "${ids[@]}"; do - dir="data/$id" - label="$id: $(< $dir/===)" - [[ -e "$dir/in.yaml" ]] || continue - want="$dir/out.yaml" - [[ -e $want ]] || want="$dir/in.yaml" - ../../tests/run-emitter-test-suite "$dir/test.event" > /tmp/test.out || { - ( - cat "$dir/test.event" - cat "$want" - ) | sed 's/^/# /' - } - ok=true - output="$(${DIFF:-diff} -u $want /tmp/test.out)" || ok=false - if $ok; then - echo "ok $((++count)) $label" - else - echo "not ok $((++count)) $label" - echo "$output" | sed 's/^/# /' - fi -done - -echo "1..$count" diff --git a/test/libyaml-parser-error.t b/test/libyaml-parser-error.t deleted file mode 100755 index 9eaacdd..0000000 --- a/test/libyaml-parser-error.t +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash - -set -e - -if [[ $# -gt 0 ]]; then - ids=("$@") -else - ids=($(cut -d: -f1 < list/libyaml-parser-error.list)) -fi - -count=0 -for id in "${ids[@]}"; do - dir="data/$id" - label="$id: $(< $dir/===)" - [[ -e "$dir/in.yaml" ]] || continue - ok=true - ../../tests/run-parser-test-suite "$dir/in.yaml" > /tmp/test.out 2>&1 || ok=false - if $ok; then - echo "not ok $((++count)) $label" - sed 's/^/# /' /tmp/test.out - else - echo "ok $((++count)) $label" - fi -done - -echo "1..$count" diff --git a/test/libyaml-parser.t b/test/libyaml-parser.t deleted file mode 100755 index f615fe7..0000000 --- a/test/libyaml-parser.t +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -set -e - -if [[ $# -gt 0 ]]; then - ids=("$@") -else - ids=($(cut -d: -f1 < list/libyaml-parser.list)) -fi - -count=0 -for id in "${ids[@]}"; do - dir="data/$id" - label="$id: $(< $dir/===)" - [[ -e "$dir/in.yaml" ]] || continue - ../../tests/run-parser-test-suite "$dir/in.yaml" > /tmp/test.out || { - ( - cat "$dir/in.yaml" - cat "$dir/test.event" - ) | sed 's/^/# /' - } - ok=true - output="$(${DIFF:-diff} -u $dir/test.event /tmp/test.out)" || ok=false - if $ok; then - echo "ok $((++count)) $label" - else - echo "not ok $((++count)) $label" - echo "$output" | sed 's/^/# /' - fi -done - -echo "1..$count" -- cgit v1.2.1