瀏覽代碼

Fix debug test in Vagrantfile

Ever since env_logger started supporting colours, it doesn’t seem worth it to keep track of what is and isn’t in the log output. So just test that it doesn’t print nothing and call it a day.
Benjamin Sago 7 年之前
父節點
當前提交
94a00fa17c
共有 2 個文件被更改,包括 7 次插入4 次删除
  1. 0 2
      xtests/debug
  2. 7 2
      xtests/run.sh

+ 0 - 2
xtests/debug

@@ -1,2 +0,0 @@
-DEBUG:exa::fs::file: Statting file "/testcases/attributes/dirs/no-xattrs_empty"
-INFO:exa::fs::dir: Reading directory "/testcases/attributes/dirs/no-xattrs_empty"

+ 7 - 2
xtests/run.sh

@@ -276,8 +276,13 @@ $exa -lt  2>&1 | diff -q - $results/error_lt   || exit 1
 
 
 # Debug mode
-# (uses an empty directory so it prints nothing to stdout)
-EXA_DEBUG="1" $exa $testcases/attributes/dirs/no-xattrs_empty -lh 2>&1 | tail -n 2 | diff -q - $results/debug  || exit 1
+# What gets logged keeps changing, so instead of checking for an exact output,
+# list an empty directory and fail if nothing gets printed.
+DEBUG_OUT=$(EXA_DEBUG="1" $exa $testcases/attributes/dirs/no-xattrs_empty -lh 2>&1)
+if [ -z "$DEBUG_OUT" ]; then
+    echo "Debug test produced no output"
+    exit 1
+fi
 
 
 # And finally...