summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2020-05-05 06:11:29 +0000
committerrillig <rillig@pkgsrc.org>2020-05-05 06:11:29 +0000
commitd2e198ab9d34da85dcd7ffcad67a79dc57db38d1 (patch)
treeb41254ce1174bcd2ed6c55b9cbae840fa3630bda /regress
parent24ec66139c392a3f5ce81b69a9cb7c5c618d66b6 (diff)
downloadpkgsrc-d2e198ab9d34da85dcd7ffcad67a79dc57db38d1.tar.gz
regress/infra-unittests: add tests for portability checks
Files like Makefile.am and configure.ac are usually not used during a build, therefore there's no point in checking these for shell portability issues.
Diffstat (limited to 'regress')
-rw-r--r--regress/infra-unittests/check-portability.sh45
1 files changed, 44 insertions, 1 deletions
diff --git a/regress/infra-unittests/check-portability.sh b/regress/infra-unittests/check-portability.sh
index 617cacde80a..37eb301876e 100644
--- a/regress/infra-unittests/check-portability.sh
+++ b/regress/infra-unittests/check-portability.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# $NetBSD: check-portability.sh,v 1.3 2020/05/05 05:55:25 rillig Exp $
+# $NetBSD: check-portability.sh,v 1.4 2020/05/05 06:11:29 rillig Exp $
#
# Test cases for mk/check/check-portability.*.
#
@@ -120,6 +120,49 @@ if test_case_begin 'configure patched, configure.in bad'; then
fi
+if test_case_begin 'Makefile.in patched, Makefile.am bad'; then
+
+ # As of 2020-05-05, Makefile.am is not checked at all since only
+ # very few packages actually use that file during the build.
+
+ create_file_lines 'work/patches/patch-aa' \
+ '+++ Makefile.in 2020-05-05'
+ create_file_lines 'work/Makefile.in' \
+ 'test a = b'
+ create_file_lines 'work/Makefile.am' \
+ 'test a == b'
+
+ check_portability_sh \
+ 'CHECK_PORTABILITY_EXPERIMENTAL=yes'
+
+ assert_that "out" --file-is-empty
+ assert_that $exitcode --equals 0
+
+ test_case_end
+fi
+
+
+if test_case_begin 'files that are usually not used for building'; then
+
+ # The following files are mostly interesting to the upstream
+ # developers and are not used during the actual build, except
+ # if the package rebuilds everything using the GNU autotools.
+
+ create_file_lines 'work/configure.ac' \
+ 'test a == b'
+ create_file_lines 'work/Makefile.am' \
+ 'test a == b'
+
+ check_portability_sh \
+ 'CHECK_PORTABILITY_EXPERIMENTAL=yes'
+
+ assert_that "out" --file-is-empty
+ assert_that $exitcode --equals 0
+
+ test_case_end
+fi
+
+
if test_case_begin 'configure patched and still bad'; then
create_file_lines 'work/patches/patch-aa' \