summaryrefslogtreecommitdiff
path: root/regress/tools
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2020-05-02 07:24:31 +0000
committerrillig <rillig@pkgsrc.org>2020-05-02 07:24:31 +0000
commita334398ffb7c8dbb9a7ce8c7338d7c65e752b0ee (patch)
tree06a347d9b9a0bed1f952799cfdcac5c6c6839f15 /regress/tools
parentffd84284783cc47100cd8b2b9ac638c5f8876e9b (diff)
downloadpkgsrc-a334398ffb7c8dbb9a7ce8c7338d7c65e752b0ee.tar.gz
regress: move tests for platform tools to tools-platform
Diffstat (limited to 'regress/tools')
-rw-r--r--regress/tools/Makefile4
-rw-r--r--regress/tools/files/awk-test.sh65
-rw-r--r--regress/tools/files/sed-test.sh39
-rw-r--r--regress/tools/files/sh-test.sh44
-rw-r--r--regress/tools/files/sort-test.sh38
-rw-r--r--regress/tools/files/tar-test.sh24
-rw-r--r--regress/tools/files/tr-test.sh56
7 files changed, 1 insertions, 269 deletions
diff --git a/regress/tools/Makefile b/regress/tools/Makefile
index 14751360895..0d60b0c057b 100644
--- a/regress/tools/Makefile
+++ b/regress/tools/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2019/03/24 11:29:19 rillig Exp $
+# $NetBSD: Makefile,v 1.16 2020/05/02 07:24:31 rillig Exp $
#
DISTNAME= # not applicable
@@ -15,8 +15,6 @@ WRKSRC= ${WRKDIR}
NO_CHECKSUM= yes
PLIST_SRC= # none
REGRESS_TESTS+= logging shquote
-REGRESS_TESTS+= awk sed sh sort tar tr
-USE_TOOLS+= awk sed sh sort tar tr
TOOLS_CREATE+= script-dquot
TOOLS_SCRIPT.script-dquot= \
diff --git a/regress/tools/files/awk-test.sh b/regress/tools/files/awk-test.sh
deleted file mode 100644
index 9249316804e..00000000000
--- a/regress/tools/files/awk-test.sh
+++ /dev/null
@@ -1,65 +0,0 @@
-#! /bin/sh
-# $NetBSD: awk-test.sh,v 1.8 2006/05/31 13:10:49 rillig Exp $
-#
-
-set -e
-
-mydir=`dirname "$0"`
-. "${mydir}/tests.subr"
-
-#
-# Functions specific for the awk testsuite.
-#
-
-# usage: test_assignment <testname> <input> <expected-output>
-test_assignment() {
- testcase_start "$1"
- o=`echo "" | awk '{print var}' var="$2"`
- assert_equal "$1" "$3" "${o}"
-}
-
-# usage: test_passline <testname> <input>
-test_passline() {
- testcase_start "$1"
- o=`awk '{print}' <<EOF
-$2
-EOF
-`
- assert_equal "$1" "$2" "${o}"
-}
-
-#
-# The actual test.
-#
-
-#
-# Assignment of variables from the command line. The Solaris
-# /usr/bin/awk does not conform to the POSIX specification, but passes
-# the right hand side of the assignment uninterpreted. It fails the
-# cmd.3 test case. The "for" loop makes sure that awk can handle strings
-# of 4096 bytes length.
-#
-test_assignment "cmd.1" \
- "foo" "foo"
-test_assignment "cmd.2" \
- "foo bar baz" "foo bar baz"
-test_assignment "cmd.3" \
- "CPPFLAGS=\\\"-Dfoo=bar\\\"" "CPPFLAGS=\"-Dfoo=bar\""
-line="a"
-for i in 0 1 2 3 4 5 6 7 8 9 10 11 12; do
- test_assignment "cmd.2^${i}" "${line}" "${line}"
- line="${line}${line}"
-done
-
-#
-# Passing strings from stdin to stdout. awk should be able to handle at
-# least 2^12 characters per line.
-#
-# Solaris 9 /usr/bin/awk: 2559 bytes
-# Solaris 9 /usr/bin/nawk: 6144 bytes
-#
-line="a"
-for i in 0 1 2 3 4 5 6 7 8 9 10 11 12; do
- test_passline "line.2^${i}" "${line}"
- line="${line}${line}"
-done
diff --git a/regress/tools/files/sed-test.sh b/regress/tools/files/sed-test.sh
deleted file mode 100644
index 26f10bd43e6..00000000000
--- a/regress/tools/files/sed-test.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#! /bin/sh
-# $NetBSD: sed-test.sh,v 1.1 2006/09/20 07:39:55 rillig Exp $
-#
-
-set -e
-
-mydir=`dirname "$0"`
-. "${mydir}/tests.subr"
-
-#
-# Functions specific for the "sed" testsuite.
-#
-
-# usage: sed_test <testname> <input> <expected-output> <args...>
-sed_test() {
- testname=$1; input=$2; expected=$3; shift 3;
-
- testcase_start "${testname}"
- output=`sed "$@" <<EOF
-$input
-EOF
-`
- assert_equal "${testname}" "${expected}" "${output}"
-}
-
-#
-# The actual test.
-#
-
-nl="
-"
-
-#
-# Make sure that sed(1) can handle character classes.
-#
-sed_test "[[:character classes:]]" \
- "hello${nl}foo bar" \
- "hello" \
- -e "/[[:space:]]/d"
diff --git a/regress/tools/files/sh-test.sh b/regress/tools/files/sh-test.sh
deleted file mode 100644
index 93cd2211d35..00000000000
--- a/regress/tools/files/sh-test.sh
+++ /dev/null
@@ -1,44 +0,0 @@
-#! /bin/sh
-# $NetBSD: sh-test.sh,v 1.3 2018/12/05 19:01:40 rillig Exp $
-#
-
-set -e
-
-mydir=`dirname "$0"`
-. "${mydir}/tests.subr"
-
-#
-# Functions specific for the sh testsuite.
-#
-
-# usage: sh_test <testname> <input> <expected-output> <args...>
-sh_test() {
- testname=$1; input=$2; expected=$3; shift 3;
-
- testcase_start "${testname}"
- output=`sh ${1+"$@"} <<EOF
-$input
-EOF
-`
- assert_equal "${testname}" "${expected}" "${output}"
-}
-
-# usage: sh_assert_equals "testname" "expected" "got"
-sh_assert_equals() {
-
- testcase_start "$1"
- assert_equal "$1" "$2" "$3"
-}
-
-#
-# The actual test.
-#
-
-nl="
-"
-
-# If this test fails because the result is "#define bindir \"", the
-# tested shell may be from NetBSD 7.0, which is known to have this bug.
-# Since NetBSD 8, this bug is fixed. See https://gnats.netbsd.org/43469.
-line="#define bindir \"/usr/bin\" /* bar */"
-sh_assert_equals "removing C comments" "#define bindir \"/usr/bin\" " "${line%%/\**}"
diff --git a/regress/tools/files/sort-test.sh b/regress/tools/files/sort-test.sh
deleted file mode 100644
index f1bae3a5181..00000000000
--- a/regress/tools/files/sort-test.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#! /bin/sh
-# $NetBSD: sort-test.sh,v 1.1 2006/06/25 21:47:28 rillig Exp $
-#
-
-set -e
-
-mydir=`dirname "$0"`
-. "${mydir}/tests.subr"
-
-#
-# Functions specific for the "sort" testsuite.
-#
-
-# usage: sort_test <testname> <input> <expected-output> <args...>
-sort_test() {
- testname=$1; input=$2; expected=$3; shift 3;
-
- testcase_start "${testname}"
- output=`sort "$@" <<EOF
-$input
-EOF
-`
- assert_equal "${testname}" "${expected}" "${output}"
-}
-
-#
-# The actual test.
-#
-
-nl="
-"
-
-sort_test "one line" \
- "text line 1" "text line 1"
-sort_test "uppercase letters" \
- "A${nl}B${nl}C" "A${nl}B${nl}C"
-sort_test "A < C < b" \
- "A${nl}b${nl}C" "A${nl}C${nl}b"
diff --git a/regress/tools/files/tar-test.sh b/regress/tools/files/tar-test.sh
deleted file mode 100644
index 02573d62509..00000000000
--- a/regress/tools/files/tar-test.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#! /bin/sh
-# $NetBSD: tar-test.sh,v 1.1 2007/09/09 08:01:45 rillig Exp $
-#
-
-set -e
-
-mydir=`dirname "$0"`
-. "${mydir}/tests.subr"
-
-#
-# Functions specific for the tar testsuite.
-#
-
-# none.
-
-#
-# The actual test.
-#
-
-# tar must support the -z option.
-#
-testcase_start "-z"
-echo "data" > file
-tar cfz archive.tar.gz file
diff --git a/regress/tools/files/tr-test.sh b/regress/tools/files/tr-test.sh
deleted file mode 100644
index 32366311a55..00000000000
--- a/regress/tools/files/tr-test.sh
+++ /dev/null
@@ -1,56 +0,0 @@
-#! /bin/sh
-# $NetBSD: tr-test.sh,v 1.2 2005/11/24 19:46:45 rillig Exp $
-#
-
-set -e
-
-mydir=`dirname "$0"`
-. "${mydir}/tests.subr"
-
-#
-# Functions specific for the tr testsuite.
-#
-
-# usage: tr_test <testname> <input> <expected-output> <args...>
-tr_test() {
- testname=$1; input=$2; expected=$3; shift 3;
-
- testcase_start "${testname}"
- output=`tr "$@" <<EOF
-$input
-EOF
-`
- assert_equal "${testname}" "${expected}" "${output}"
-}
-
-#
-# The actual test.
-#
-
-nl="
-"
-
-tr_test "simple" \
- "foo" "baa" "fo" "ba"
-tr_test "tolower" \
- "The Great Green Fox" "the great green fox" "A-Z" "a-z"
-tr_test "eat-newlines" \
- "foo${nl}bar${nl}" "foobar" -d "\\n"
-tr_test "eat-minus" \
- "describe-function" "describefunction" -d "-"
-# The following test does not work on NetBSD 1.6.2.
-#tr_test "eat-minus-d" \
-# "describe-function" "escribefunction" -d "-d"
-tr_test "eat-d-minus" \
- "describe-function" "escribefunction" -d "d-"
-
-s="0123456789abcdef"
-s="$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s"
-s="$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s"
-s="$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s"
-f="ffffffffffffffff"
-f="$f$f$f$f$f$f$f$f$f$f$f$f$f$f$f$f"
-f="$f$f$f$f$f$f$f$f$f$f$f$f$f$f$f$f"
-
-tr_test "65536" \
- "$s" "$f" -d "0-9a-e"