automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[automake-commit] branch master updated: test: Improve output of system


From: Karl Berry
Subject: [automake-commit] branch master updated: test: Improve output of system information in test-suite.log.
Date: Mon, 17 Jun 2024 17:44:40 -0400

This is an automated email from the git hooks/post-receive script.

karl pushed a commit to branch master
in repository automake.

View the commit online:
https://git.savannah.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=6cb69ad8c3e7717876c5c8b43f6ef137b58ccfc3

The following commit(s) were added to refs/heads/master by this push:
     new 6cb69ad8c test: Improve output of system information in test-suite.log.
6cb69ad8c is described below

commit 6cb69ad8c3e7717876c5c8b43f6ef137b58ccfc3
Author: Collin Funk <collin.funk1@gmail.com>
AuthorDate: Mon Jun 17 14:44:28 2024 -0700

    test: Improve output of system information in test-suite.log.
    
    Fixes https://bugs.gnu.org/71421.
    
    * lib/am/check.am ($(TEST_SUITE_LOG): Use $(AWK) instead of 'awk'.
    Remove an extra space in uname output.  Start the line with
    "System information", and other sections with "Distribution
    information".
    * NEWS: add reference to #71421.
---
 NEWS            |  2 +-
 lib/am/check.am | 28 ++++++++++++++++++++--------
 2 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/NEWS b/NEWS
index e4699a569..b0268d268 100644
--- a/NEWS
+++ b/NEWS
@@ -46,7 +46,7 @@ New in 1.17:
 
   - test-suite.log now contains basic system information, and the
     console message about bug reporting on failure has a bit more detail.
-    (bug#68746)
+    (bug#68746, bug#71421)
 
   - When using the (default) "parallel" test driver, you can now omit the
     output of skipped tests from test-suite.log by defining the
diff --git a/lib/am/check.am b/lib/am/check.am
index 526b445d5..ab1411ac5 100644
--- a/lib/am/check.am
+++ b/lib/am/check.am
@@ -370,14 +370,26 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
 ## Function to write some basic system info in the log.
        output_system_information () \
        { \
-## Omit the hostname for privacy.  In practice it's a single word?
-          echo;                                    \
-         (uname -a | awk '{$$2=""; print}') 2>&1; \
-         if test -r /etc/os-release; then         \
-           sed 8q /etc/os-release;                \
-         elif test -r /etc/issue; then            \
-           cat /etc/issue;                        \
-         fi;                                      \
+## Omit the hostname for privacy.  Always a single word.
+## Start the line with a label for clarity, and so commands like
+## grep ^Linux don't get a false hit.
+          echo;                                     \
+         { uname -a | $(AWK) '{                    \
+  printf "System information (uname -a):";          \
+  for (i = 1; i < NF; ++i)                          \
+    {                                               \
+      if (i != 2)                                   \
+        printf " %s", $$i;                          \
+    }                                               \
+  printf "\n";                                      \
+}'; } 2>&1;                                         \
+         if test -r /etc/os-release; then          \
+           echo "Distribution information (/etc/os-release):"; \
+           sed 8q /etc/os-release;                 \
+         elif test -r /etc/issue; then             \
+           echo "Distribution information (/etc/issue):";      \
+           cat /etc/issue;                         \
+         fi;                                       \
        }; \
 ##
 ## Function to output the "please report bugs" message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]