From 26a66d0feaab7626c4053071d5557394931fe14b Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Date: Sat, 16 Jan 2021 22:30:33 -0500
Subject: [PATCH] build: test-driver.scm: Allow running as a standalone script.

* build-aux/test-driver.scm: Add an exec-based shebang and set the script
executable bit.
(main): Insert a newline after the version string is printed with --version.
---
 build-aux/test-driver.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
 mode change 100644 => 100755 build-aux/test-driver.scm

diff --git a/build-aux/test-driver.scm b/build-aux/test-driver.scm
old mode 100644
new mode 100755
index 763ba457d8b..ac21783d411
--- a/build-aux/test-driver.scm
+++ b/build-aux/test-driver.scm
@@ -1,3 +1,6 @@
+#!/bin/sh
+exec guile --no-auto-compile -e main -s "$0" "$@"
+!#
 ;;;; test-driver.scm - Guile test driver for Automake testsuite harness
 
 (define script-version "2021-01-26.20") ;UTC
@@ -211,7 +214,7 @@ (define (main . args)
          (option (cut option-ref opts <> <>)))
     (cond
      ((option 'help #f)    (show-help))
-     ((option 'version #f) (format #t "test-driver.scm ~A" script-version))
+     ((option 'version #f) (format #t "test-driver.scm ~A~%" script-version))
      (else
       (let* ((log (and=> (option 'log-file #f) (cut open-file <> "w0")))
              (trs (and=> (option 'trs-file #f) (cut open-file <> "wl")))
-- 
GitLab