From 5646e0ba35ce1bcaefc819fd5998e357f175aaff Mon Sep 17 00:00:00 2001
From: Giovanni Bussi <giovanni.bussi@gmail.com>
Date: Wed, 13 Jan 2016 10:07:49 +0100
Subject: [PATCH] Enforce ASCII check in regtest

---
 regtest/scripts/run | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/regtest/scripts/run b/regtest/scripts/run
index 51e363bca..a6747fc65 100755
--- a/regtest/scripts/run
+++ b/regtest/scripts/run
@@ -134,7 +134,14 @@ for file in *.reference ; do
     ../../../scripts/fixzeroes.sh "$file"
     cp "$new" "$new.zfix"
     ../../../scripts/fixzeroes.sh "$new.zfix"
-    out="$(diff "$file" "$new.zfix")"
+    DIFFOPT=""
+# this is to enforce ASCII check
+# I add this option since sometime on travis some of the diff files are not shown
+# (files are thought to be binary for some reason)
+# In this way, at least PLUMED native files (with fields) will be assumed to be
+# ASCII and diff will be shown in the log
+    test "$(cat "$file" | head -c 10)" = "#! FIELDS " && DIFFOPT="-a"
+    out="$(diff $DIFFOPT "$file" "$new.zfix")"
     test -n "$out" && {
       echo FAILURE
       echo "Diff for ${file%.reference}:"
-- 
GitLab