initial regression test suite
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 9 Sep 2019 19:37:43 +0000 (21:37 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 9 Sep 2019 22:37:53 +0000 (00:37 +0200)
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 [new file with mode: 0755]
t/t1001-seq.in [new file with mode: 0644]
t/t1001-seq.out [new file with mode: 0644]
t/t1002-sinewave.in [new file with mode: 0644]
t/t1002-sinewave.out [new file with mode: 0644]

diff --git a/t/regress.t b/t/regress.t
new file mode 100755 (executable)
index 0000000..ef28f6f
--- /dev/null
@@ -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 (file)
index 0000000..01e79c3
--- /dev/null
@@ -0,0 +1,3 @@
+1
+2
+3
diff --git a/t/t1001-seq.out b/t/t1001-seq.out
new file mode 100644 (file)
index 0000000..6947d1e
--- /dev/null
@@ -0,0 +1,3 @@
+1 -------------
+2 ------------------------+
+3 ------------------------+----->-------
diff --git a/t/t1002-sinewave.in b/t/t1002-sinewave.in
new file mode 100644 (file)
index 0000000..fb3ff0e
--- /dev/null
@@ -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 (file)
index 0000000..ec8ff3f
--- /dev/null
@@ -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 ----