Package: src:bats
Version: 0.4.0-1
Severity: important
Tags: patch

bats own testsuite fails when TERM is set to unknown. The following patch fixes
it.  It also prints the $output for failed tests (taken from an upstream pull
request).

patch attached

  * Set TERM for running the tests when not set or set to unknown.
  * Apply upstream pull requests #101 to print the output of failed tests.
 
diff -Nru bats-0.4.0/debian/patches/fix-101.diff 
bats-0.4.0/debian/patches/fix-101.diff
--- bats-0.4.0/debian/patches/fix-101.diff      1970-01-01 01:00:00.000000000 
+0100
+++ bats-0.4.0/debian/patches/fix-101.diff      2015-09-07 21:11:23.000000000 
+0200
@@ -0,0 +1,14 @@
+Index: b/libexec/bats-exec-test
+===================================================================
+--- a/libexec/bats-exec-test
++++ b/libexec/bats-exec-test
+@@ -161,6 +161,9 @@ bats_print_failed_command() {
+   else
+     echo "failed with status $status"
+   fi
++  if [ -n "$output" ]; then
++      echo "#   $output"
++  fi
+ }
+ 
+ bats_frame_lineno() {
diff -Nru bats-0.4.0/debian/patches/series bats-0.4.0/debian/patches/series
--- bats-0.4.0/debian/patches/series    2014-12-07 06:53:16.000000000 +0100
+++ bats-0.4.0/debian/patches/series    2015-09-07 21:42:36.000000000 +0200
@@ -1 +1,2 @@
 deb_libexec_to_lib
+fix-101.diff
diff -Nru bats-0.4.0/debian/rules bats-0.4.0/debian/rules
--- bats-0.4.0/debian/rules     2014-12-07 06:53:16.000000000 +0100
+++ bats-0.4.0/debian/rules     2015-09-07 21:37:37.000000000 +0200
@@ -11,5 +11,9 @@
        ./install.sh debian/bats/usr
 
 override_dh_auto_test:
+       set -e; \
+       if [ x$$TERM = x ] || [ x$$TERM = xunknown ]; then \
+         export TERM=dumb; \
+       fi; \
        bin/bats --tap test
 

Reply via email to