# HG changeset patch
# User Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr>
# Date 1660652868 -7200
#      Tue Aug 16 14:27:48 2022 +0200
# Node ID 0a13a4032a9cf6d617c4c113155e395824fcfe4e
# Parent  c0b3edd1cb7b142d36a5defa4826dbfdb14fda81
🚑 run_tests: fix cat and avoid using another external tool

diff --git a/run_tests b/run_tests
--- a/run_tests
+++ b/run_tests
@@ -74,7 +74,7 @@
       tests_errors=0
   fi
   import_errors=$(grep -P 'o(penerp|doo).(modules.module|[^ ]+): Can not `import [a-z0-9_]+`.' $logfile)
-  import_errors_number=$(cat $import_errors|wc -l)
+  import_errors_number=$(grep -P 'o(penerp|doo).(modules.module|[^ ]+): Can not `import [a-z0-9_]+`.' $logfile -c)
   if [[ "$import_errors_number" -ne 0 ]];
   then
       test_errors=$((test_errors+import_errors_number))
@@ -133,7 +133,7 @@
     GREP_COLOR='0;31' grep --color=always "ERROR \([[:alnum:]]\|_\)* .\+\.test_.\+ ERROR:" $logfile
     if [[ -n "$import_errors" ]];
     then
-        echo $import_errors
+        echo "$import_errors"
     fi
 fi