Source-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/regress/infra-unittests regress/infra-unittests: inden...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a041f03051d4
branches:  trunk
changeset: 431131:a041f03051d4
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat May 09 17:10:38 2020 +0000

description:
regress/infra-unittests: indent here-documents

diffstat:

 regress/infra-unittests/subst.sh |  363 +++++++++++++++++++-------------------
 1 files changed, 181 insertions(+), 182 deletions(-)

diffs (truncated from 519 to 300 lines):

diff -r d07788724500 -r a041f03051d4 regress/infra-unittests/subst.sh
--- a/regress/infra-unittests/subst.sh  Sat May 09 16:59:49 2020 +0000
+++ b/regress/infra-unittests/subst.sh  Sat May 09 17:10:38 2020 +0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: subst.sh,v 1.32 2020/05/06 06:14:56 rillig Exp $
+# $NetBSD: subst.sh,v 1.33 2020/05/09 17:10:38 rillig Exp $
 #
 # Tests for mk/subst.mk.
 #
@@ -11,36 +11,35 @@
 test_case_set_up() {
        rm -rf "$tmpdir"/.??* "$tmpdir"/*
 
-       create_file "prepare-subst.mk" <<EOF
+       create_file "prepare-subst.mk" <<-EOF
+               # The tools that are used by subst.mk
+               AWK=            awk
+               CHMOD=          chmod
+               CMP=            cmp
+               DIFF=           diff
+               ECHO=           echo
+               MKDIR=          mkdir -p
+               MV=             mv
+               RM=             rm
+               RMDIR=          rmdir
+               SED=            sed
+               TEST=           test
+               TOUCH=          touch
+               TOUCH_FLAGS=    # none
+               TR=             tr
+               TRUE=           true
 
-# The tools that are used by subst.mk
-AWK=           awk
-CHMOD=         chmod
-CMP=           cmp
-DIFF=          diff
-ECHO=          echo
-MKDIR=         mkdir -p
-MV=            mv
-RM=            rm
-RMDIR=         rmdir
-SED=           sed
-TEST=          test
-TOUCH=         touch
-TOUCH_FLAGS=   # none
-TR=            tr
-TRUE=          true
+               # Commands that are specific to pkgsrc
+               RUN=            @set -e;
+               STEP_MSG=       echo "=>"
+               DO_NADA=        : do-nada
+               INFO_MSG=       echo "info:"
+               WARNING_MSG=    echo "warning:"
+               FAIL_MSG=       sh $pkgsrcdir/mk/scripts/fail echo "fail:"
 
-# Commands that are specific to pkgsrc
-RUN=           @set -e;
-STEP_MSG=      echo "=>"
-DO_NADA=       : do-nada
-INFO_MSG=      echo "info:"
-WARNING_MSG=   echo "warning:"
-FAIL_MSG=      sh $pkgsrcdir/mk/scripts/fail echo "fail:"
-
-WRKDIR=                $tmpdir
-WRKSRC=                $tmpdir
-EOF
+               WRKDIR=         $tmpdir
+               WRKSRC=         $tmpdir
+       EOF
 }
 
 
@@ -48,17 +47,17 @@
 
        # A single file is patched successfully.
 
-       create_file "subst-single.mk" <<EOF
-SUBST_CLASSES+=                class
-SUBST_STAGE.class=     pre-configure
-SUBST_FILES.class=     subst-single.txt
-SUBST_SED.class=       -e 's,before,after,'
+       create_file "subst-single.mk" <<-EOF
+               SUBST_CLASSES+=         class
+               SUBST_STAGE.class=      pre-configure
+               SUBST_FILES.class=      subst-single.txt
+               SUBST_SED.class=        -e 's,before,after,'
 
-.include "prepare-subst.mk"
-.include "mk/subst.mk"
+               .include "prepare-subst.mk"
+               .include "mk/subst.mk"
 
-all: subst-class
-EOF
+               all: subst-class
+       EOF
 
        create_file_lines "subst-single.txt" \
                "before"
@@ -76,17 +75,17 @@
 
        # Several individual files are patched successfully.
 
-       create_file "testcase.mk" <<EOF
-SUBST_CLASSES+=                class
-SUBST_STAGE.class=     pre-configure
-SUBST_FILES.class=     first second third
-SUBST_SED.class=       -e 's,file,example,'
+       create_file "testcase.mk" <<-EOF
+               SUBST_CLASSES+=         class
+               SUBST_STAGE.class=      pre-configure
+               SUBST_FILES.class=      first second third
+               SUBST_SED.class=        -e 's,file,example,'
 
-.include "prepare-subst.mk"
-.include "mk/subst.mk"
+               .include "prepare-subst.mk"
+               .include "mk/subst.mk"
 
-all: subst-class
-EOF
+               all: subst-class
+       EOF
 
        create_file_lines "first"       "the first file"
        create_file_lines "second"      "the second file"
@@ -108,17 +107,17 @@
        # Several files are patched successfully.
        # The filenames are given by a pattern.
 
-       create_file "testcase.mk" <<EOF
-SUBST_CLASSES+=                class
-SUBST_STAGE.class=     pre-configure
-SUBST_FILES.class=     pattern-*
-SUBST_SED.class=       -e 's,file,example,'
+       create_file "testcase.mk" <<-EOF
+               SUBST_CLASSES+=         class
+               SUBST_STAGE.class=      pre-configure
+               SUBST_FILES.class=      pattern-*
+               SUBST_SED.class=        -e 's,file,example,'
 
-.include "prepare-subst.mk"
-.include "mk/subst.mk"
+               .include "prepare-subst.mk"
+               .include "mk/subst.mk"
 
-all: subst-class
-EOF
+               all: subst-class
+       EOF
 
        create_file_lines "pattern-first"       "the first file"
        create_file_lines "pattern-second"      "the second file"
@@ -144,17 +143,17 @@
        # only an info is logged.
        # This is not an error.
 
-       create_file "testcase.mk" <<EOF
-SUBST_CLASSES+=                class
-SUBST_STAGE.class=     pre-configure
-SUBST_FILES.class=     pattern-*
-SUBST_SED.class=       -e 's,file,example,'
+       create_file "testcase.mk" <<-EOF
+               SUBST_CLASSES+=         class
+               SUBST_STAGE.class=      pre-configure
+               SUBST_FILES.class=      pattern-*
+               SUBST_SED.class=        -e 's,file,example,'
 
-.include "prepare-subst.mk"
-.include "mk/subst.mk"
+               .include "prepare-subst.mk"
+               .include "mk/subst.mk"
 
-all: subst-class
-EOF
+               all: subst-class
+       EOF
 
        create_file_lines "pattern-first"       "the first file"
        create_file_lines "pattern-second"      "the second is already an example"
@@ -176,18 +175,18 @@
 
 if test_case_begin "single file noop, noop_ok=yes"; then
 
-       create_file "testcase.mk" <<EOF
-SUBST_CLASSES+=                class
-SUBST_STAGE.class=     pre-configure
-SUBST_FILES.class=     single
-SUBST_SED.class=       -e 's,file,example,'
-SUBST_NOOP_OK.class=   yes
+       create_file "testcase.mk" <<-EOF
+               SUBST_CLASSES+=         class
+               SUBST_STAGE.class=      pre-configure
+               SUBST_FILES.class=      single
+               SUBST_SED.class=        -e 's,file,example,'
+               SUBST_NOOP_OK.class=    yes
 
-.include "prepare-subst.mk"
-.include "mk/subst.mk"
+               .include "prepare-subst.mk"
+               .include "mk/subst.mk"
 
-all: subst-class
-EOF
+               all: subst-class
+       EOF
 
        create_file_lines "single"      "already an example"
 
@@ -206,18 +205,18 @@
 
 if test_case_begin "single file noop, noop_ok=no"; then
 
-       create_file "testcase.mk" <<EOF
-SUBST_CLASSES+=                class
-SUBST_STAGE.class=     pre-configure
-SUBST_FILES.class=     single
-SUBST_SED.class=       -e 's,file,example,'
-SUBST_NOOP_OK.class=   no
+       create_file "testcase.mk" <<-EOF
+               SUBST_CLASSES+=         class
+               SUBST_STAGE.class=      pre-configure
+               SUBST_FILES.class=      single
+               SUBST_SED.class=        -e 's,file,example,'
+               SUBST_NOOP_OK.class=    no
 
-.include "prepare-subst.mk"
-.include "mk/subst.mk"
+               .include "prepare-subst.mk"
+               .include "mk/subst.mk"
 
-all: subst-class
-EOF
+               all: subst-class
+       EOF
 
        create_file_lines "single"      "already an example"
 
@@ -241,18 +240,18 @@
 
 if test_case_begin "single file nonexistent"; then
 
-       create_file "testcase.mk" <<EOF
-SUBST_CLASSES+=                class
-SUBST_STAGE.class=     pre-configure
-SUBST_FILES.class=     nonexistent
-SUBST_SED.class=       -e 's,file,example,'
-SUBST_NOOP_OK.class=   no
+       create_file "testcase.mk" <<-EOF
+               SUBST_CLASSES+=         class
+               SUBST_STAGE.class=      pre-configure
+               SUBST_FILES.class=      nonexistent
+               SUBST_SED.class=        -e 's,file,example,'
+               SUBST_NOOP_OK.class=    no
 
-.include "prepare-subst.mk"
-.include "mk/subst.mk"
+               .include "prepare-subst.mk"
+               .include "mk/subst.mk"
 
-all: subst-class
-EOF
+               all: subst-class
+       EOF
 
        run_bmake "testcase.mk" > "$tmpdir/actual-output" && exitcode=0 || exitcode=$?
 
@@ -273,18 +272,18 @@
 
 if test_case_begin "single file nonexistent ok"; then
 
-       create_file "testcase.mk" <<EOF
-SUBST_CLASSES+=                class
-SUBST_STAGE.class=     pre-configure
-SUBST_FILES.class=     nonexistent
-SUBST_SED.class=       -e 's,file,example,'
-SUBST_NOOP_OK.class=   yes
+       create_file "testcase.mk" <<-EOF
+               SUBST_CLASSES+=         class
+               SUBST_STAGE.class=      pre-configure
+               SUBST_FILES.class=      nonexistent
+               SUBST_SED.class=        -e 's,file,example,'
+               SUBST_NOOP_OK.class=    yes
 
-.include "prepare-subst.mk"
-.include "mk/subst.mk"
+               .include "prepare-subst.mk"
+               .include "mk/subst.mk"
 
-all: subst-class
-EOF
+               all: subst-class
+       EOF
 
        run_bmake "testcase.mk" > "$tmpdir/actual-output" && exitcode=0 || exitcode=$?
 
@@ -300,17 +299,17 @@
 



Home | Main Index | Thread Index | Old Index