poke-devel
[Top][All Lists]
Advanced

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

[PATCH] testsuite: do not report the absolute path in pktests


From: Mohammad-Reza Nabipoor
Subject: [PATCH] testsuite: do not report the absolute path in pktests
Date: Tue, 29 Nov 2022 01:06:20 +0100

2022-11-29  Mohammad-Reza Nabipoor  <mnabipoor@gnu.org>

        * testsuite/lib/poke-pk.exp (tap_execute): Only keep the filename
        and parent directory name for test files to be consistent with
        the rest.
---
 ChangeLog                 |  6 ++++++
 testsuite/lib/poke-pk.exp | 11 ++++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 59f1eb6e..2fb1909a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-11-29  Mohammad-Reza Nabipoor  <mnabipoor@gnu.org>
+
+       * testsuite/lib/poke-pk.exp (tap_execute): Only keep the filename
+       and parent directory name for test files to be consistent with
+       the rest.
+
 2022-11-27  Arsen Arsenović  <arsen@aarsen.me>
 
        * bootstrap: Sync with Gnulib.
diff --git a/testsuite/lib/poke-pk.exp b/testsuite/lib/poke-pk.exp
index a1994707..8650f0bb 100644
--- a/testsuite/lib/poke-pk.exp
+++ b/testsuite/lib/poke-pk.exp
@@ -21,13 +21,18 @@ load_lib "poke.exp"
 #
 # A TAP consumer that translates TAP to DejaGNU.
 
-proc tap_execute {pkfile} {
+proc tap_execute {pkfile_path} {
     global POKE
     set timeoutmsg "Timed out: Never got started, "
     set timeout 100
     set file all
     set timetol 0
     set executable $POKE
+    # Keep only the last two elements of the path (directory name and
+    # file name).
+    set pkfile_name [file tail "$pkfile_path"]
+    set pkfile_parent_dir [file tail [file dirname "$pkfile_path"]]
+    set pkfile [file join "$pkfile_parent_dir" "$pkfile_name"]
 
     verbose "The executable is $executable" 2
     if {![file exists ${executable}]} {
@@ -35,14 +40,14 @@ proc tap_execute {pkfile} {
         return "Poke interpreter is missing"
     }
     verbose "The pkfile is $pkfile" 2
-    if {![file exists ${pkfile}]} {
+    if {![file exists ${pkfile_path}]} {
         perror "The poke file \"$pkfile\" is missing" 0
         return "No source file found"
     }
 
     # spawn the executable and look for the TAP output messages from the
     # test case.
-    spawn -noecho "${executable}" --no-hserver --color=no -q -L ${pkfile}
+    spawn -noecho "${executable}" --no-hserver --color=no -q -L ${pkfile_path}
     set txt "\[^\r\n\]*"
     set num "\[0-9\]\[0-9\]*"
     expect {
-- 
2.38.1




reply via email to

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