groff-commit
[Top][All Lists]
Advanced

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

[groff] 04/27: [grog]: Use a proper "artifacts" directory.


From: G. Branden Robinson
Subject: [groff] 04/27: [grog]: Use a proper "artifacts" directory.
Date: Thu, 2 Jan 2025 01:22:18 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 35b8746bb6ac43d54207737b3da4083688d7fc6f
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Thu Dec 26 22:51:56 2024 -0600

    [grog]: Use a proper "artifacts" directory.
    
    ...for test scripts.
    
    * src/utils/grog/tests/foo.man: Rename this...
    * src/utils/grog/tests/artifacts/foo.man: ...to this.
    
    * src/utils/grog/grog.am (EXTRA_DIST): Update location of artifact.
    
    * src/utils/grog/tests/recognize-perl-pod.sh: Search for test artifact
      directory, and skip test if we can't find it.  Update expected output.
---
 ChangeLog                                    | 14 ++++++++++++++
 src/utils/grog/grog.am                       |  2 +-
 src/utils/grog/tests/{ => artifacts}/foo.man |  0
 src/utils/grog/tests/recognize-perl-pod.sh   | 23 ++++++++++++++++++++---
 4 files changed, 35 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0e73ffd3b..8fc799545 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2024-12-26  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [grog]: Use a proper "artifacts" directory for test scripts.
+
+       * src/utils/grog/tests/foo.man: Rename this...
+       * src/utils/grog/tests/artifacts/foo.man: ...to this.
+
+       * src/utils/grog/grog.am (EXTRA_DIST): Update location of
+       artifact.
+
+       * src/utils/grog/tests/recognize-perl-pod.sh: Search for test
+       artifact directory, and skip test if we can't find it.  Update
+       expected output.
+
 2024-12-22  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        Revamp build-time check of POSIX-conforming test(1) command.
diff --git a/src/utils/grog/grog.am b/src/utils/grog/grog.am
index 84616c04c..b385def77 100644
--- a/src/utils/grog/grog.am
+++ b/src/utils/grog/grog.am
@@ -21,7 +21,7 @@ man1_MANS += src/utils/grog/grog.1
 EXTRA_DIST += \
   src/utils/grog/grog.1.man \
   src/utils/grog/grog.pl \
-  src/utils/grog/tests/foo.man
+  src/utils/grog/tests/artifacts/foo.man
 
 grog: $(grog_srcdir)/grog.pl $(SH_DEPS_SED_SCRIPT)
        $(AM_V_GEN)$(RM) $@ \
diff --git a/src/utils/grog/tests/foo.man 
b/src/utils/grog/tests/artifacts/foo.man
similarity index 100%
rename from src/utils/grog/tests/foo.man
rename to src/utils/grog/tests/artifacts/foo.man
diff --git a/src/utils/grog/tests/recognize-perl-pod.sh 
b/src/utils/grog/tests/recognize-perl-pod.sh
index bc13ece2a..239852756 100755
--- a/src/utils/grog/tests/recognize-perl-pod.sh
+++ b/src/utils/grog/tests/recognize-perl-pod.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Copyright (C) 2021 Free Software Foundation, Inc.
+# Copyright (C) 2021-2024 Free Software Foundation, Inc.
 #
 # This file is part of groff.
 #
@@ -19,13 +19,30 @@
 #
 
 grog="${abs_top_builddir:-.}/grog"
-doc="${abs_top_srcdir:-..}/src/utils/grog/tests/foo.man"
 
 # Regression test Savannah #59622.
 #
 # Recognize the strongly-accented dialect of man(7) produced by
 # pod2man(1).
 
-"$grog" "$doc" | grep '^groff -man .*/src/utils/grog/tests/foo\.man'
+# Locate directory containing our test artifacts.
+artifact_dir=
+
+for buildroot in . .. ../..
+do
+    d=$buildroot/src/utils/grog/tests/artifacts
+    if [ -d "$d" ]
+    then
+        artifact_dir=$d
+        break
+    fi
+done
+
+# If we can't find it, we can't test.
+test -z "$artifact_dir" && exit 77 # skip
+
+input="$artifact_dir"/foo.man
+"$grog" "$input" \
+    | grep '^groff -man .*/src/utils/grog/tests/artifacts/foo\.man'
 
 # vim:set ai et sw=4 ts=4 tw=72:



reply via email to

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