Browse Source

Test for debug mode

Benjamin Sago 8 năm trước cách đây
mục cha
commit
80e3d6fcaf
2 tập tin đã thay đổi với 11 bổ sung1 xóa
  1. 2 0
      xtests/debug
  2. 9 1
      xtests/run.sh

+ 2 - 0
xtests/debug

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

+ 9 - 1
xtests/run.sh

@@ -17,7 +17,10 @@ results="/vagrant/xtests"
 
 
 # We want to use strict mode here. It’s important that no combination of
 # We want to use strict mode here. It’s important that no combination of
 # testing flags happens to work by accident!
 # testing flags happens to work by accident!
-export EXA_STRICT=1
+export EXA_STRICT="1"
+
+# We also don’t want to see reams and reams of debug output.
+export EXA_DEBUG=""
 
 
 
 
 # Check that no files were created more than a year ago.
 # Check that no files were created more than a year ago.
@@ -188,6 +191,11 @@ $exa --time       2>&1 | diff -q - $results/error_value      || exit 1
 $exa --long=time  2>&1 | diff -q - $results/error_overvalued || exit 1
 $exa --long=time  2>&1 | diff -q - $results/error_overvalued || 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 | diff -q - $results/debug  || exit 1
+
+
 # And finally...
 # And finally...
 $exa --help        | diff -q - $results/help      || exit 1
 $exa --help        | diff -q - $results/help      || exit 1
 $exa --help --long | diff -q - $results/help_long || exit 1
 $exa --help --long | diff -q - $results/help_long || exit 1