From cd9fc725abd4876848c20a78435a1456f707546e Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Mon, 9 Sep 2019 21:37:43 +0200 Subject: [PATCH] initial regression test suite Simple script to run barcat with different input from *.in, comparing to expected *.out files and returning results in TAP format. Execution at t/*.t for prove compatibility. --- t/regress.t | 18 ++++++++++++++++++ t/t1001-seq.in | 3 +++ t/t1001-seq.out | 3 +++ t/t1002-sinewave.in | 30 ++++++++++++++++++++++++++++++ t/t1002-sinewave.out | 30 ++++++++++++++++++++++++++++++ 5 files changed, 84 insertions(+) create mode 100755 t/regress.t create mode 100644 t/t1001-seq.in create mode 100644 t/t1001-seq.out create mode 100644 t/t1002-sinewave.in create mode 100644 t/t1002-sinewave.out diff --git a/t/regress.t b/t/regress.t new file mode 100755 index 0000000..ef28f6f --- /dev/null +++ b/t/regress.t @@ -0,0 +1,18 @@ +#!/bin/sh + +cd "${0%/*}" || exit 1 + +test_count=0 + +COLUMNS=40 +diffcmd='diff --unchanged-line-format= --old-line-format=<%L --new-line-format=>%L' + +for candidate in ${@:-t*.in} +do + test_count=$((test_count+1)) + name="${candidate%.out}" + barcat <"$name.in" | $diffcmd "$name.out" - || printf 'not ' + echo "ok $test_count - $name" +done + +echo "1..$test_count" diff --git a/t/t1001-seq.in b/t/t1001-seq.in new file mode 100644 index 0000000..01e79c3 --- /dev/null +++ b/t/t1001-seq.in @@ -0,0 +1,3 @@ +1 +2 +3 diff --git a/t/t1001-seq.out b/t/t1001-seq.out new file mode 100644 index 0000000..6947d1e --- /dev/null +++ b/t/t1001-seq.out @@ -0,0 +1,3 @@ +1 ------------- +2 ------------------------+ +3 ------------------------+----->------- diff --git a/t/t1002-sinewave.in b/t/t1002-sinewave.in new file mode 100644 index 0000000..fb3ff0e --- /dev/null +++ b/t/t1002-sinewave.in @@ -0,0 +1,30 @@ +0.0998334 +0.198669 +0.29552 +0.389418 +0.479426 +0.564642 +0.644218 +0.717356 +0.783327 +0.841471 +0.891207 +0.932039 +0.963558 +0.98545 +0.997495 +0.999574 +0.991665 +0.973848 +0.9463 +0.909297 +0.863209 +0.808496 +0.745705 +0.675463 +0.598472 +0.515501 +0.42738 +0.334988 +0.239249 +0.14112 diff --git a/t/t1002-sinewave.out b/t/t1002-sinewave.out new file mode 100644 index 0000000..ec8ff3f --- /dev/null +++ b/t/t1002-sinewave.out @@ -0,0 +1,30 @@ +0.0998334 --- + 0.198669 ------ + 0.29552 --------- + 0.389418 ------------ + 0.479426 -------------- + 0.564642 ---------------<- + 0.644218 ---------------<--= + 0.717356 ---------------<--=-+- + 0.783327 ---------------<--=-+--- + 0.841471 ---------------<--=-+---- + 0.891207 ---------------<--=-+---->- + 0.932039 ---------------<--=-+---->-- + 0.963558 ---------------<--=-+---->--- + 0.98545 ---------------<--=-+---->---- + 0.997495 ---------------<--=-+---->---- + 0.999574 ---------------<--=-+---->---- + 0.991665 ---------------<--=-+---->---- + 0.973848 ---------------<--=-+---->--- + 0.9463 ---------------<--=-+---->-- + 0.909297 ---------------<--=-+---->- + 0.863209 ---------------<--=-+----> + 0.808496 ---------------<--=-+--- + 0.745705 ---------------<--=-+- + 0.675463 ---------------<--=- + 0.598472 ---------------<-- + 0.515501 --------------- + 0.42738 ------------- + 0.334988 ---------- + 0.239249 ------- + 0.14112 ---- -- 2.30.0