summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/aux/common.sh4
-rw-r--r--tests/data/pkg/bar.pkg/control3
-rw-r--r--tests/data/pkg/baz+qux.pkg/control8
-rwxr-xr-xtests/data/pkg/build1
-rw-r--r--tests/data/pkg/control3
-rw-r--r--tests/data/pkg/foo.pkg/control1
-rwxr-xr-xtests/exe/ob-buildenv.sh4
-rwxr-xr-xtests/exe/ob-buildopk.sh11
-rwxr-xr-xtests/exe/ob-genchanges.sh13
-rwxr-xr-xtests/exe/ob-gencontrol.sh51
-rwxr-xr-xtests/exe/ob-installdocs.sh10
-rwxr-xr-xtests/exe/opkbuild.sh28
-rwxr-xr-xtests/lib/ob_get_binary_parameter.sh8
-rwxr-xr-xtests/lib/ob_iso8601_gmtime.sh7
-rwxr-xr-xtests/lib/ob_reduce_deps.sh20
-rwxr-xr-xtests/lib/ob_rfc822_mktime.sh7
-rwxr-xr-xtests/lib/ob_touch_t_gmtime.sh46
-rw-r--r--tests/local.mk2
18 files changed, 178 insertions, 49 deletions
diff --git a/tests/aux/common.sh b/tests/aux/common.sh
index 3ea3740..effc208 100644
--- a/tests/aux/common.sh
+++ b/tests/aux/common.sh
@@ -86,8 +86,8 @@ export OPK_SOURCE='foo'
export OPK_SOURCE_VERSION='1.0-1'
export OPK_SOURCE_VERSION_UPSTREAM='1.0'
export OPK_BINARY_VERSION='1.0-1'
-export OPK_PACKAGES='foo baz-qux bar'
-export OPK_PACKAGES_REDUCED='foo baz-qux bar'
+export OPK_PACKAGES='foo baz+qux baz-qux bar'
+export OPK_PACKAGES_REDUCED='foo baz+qux baz-qux bar'
# Section 7.3.2 Build and Host System Variables
# OPK_BUILD_ARCH_GNU and OPK_HOST_ARCH_GNU aren't set or used by opkbuild
# utilities. These should be removed from the SPF.
diff --git a/tests/data/pkg/bar.pkg/control b/tests/data/pkg/bar.pkg/control
index b0c05fa..93c1198 100644
--- a/tests/data/pkg/bar.pkg/control
+++ b/tests/data/pkg/bar.pkg/control
@@ -1,5 +1,6 @@
-Architecture: all
+Architecture: any
Platform: all
+Section: util
Description: Bit-bang All Registers
${Common-Description}
.
diff --git a/tests/data/pkg/baz+qux.pkg/control b/tests/data/pkg/baz+qux.pkg/control
new file mode 100644
index 0000000..1ecae47
--- /dev/null
+++ b/tests/data/pkg/baz+qux.pkg/control
@@ -0,0 +1,8 @@
+Architecture: all
+Platform: all
+Depends: ${Generated-Depends}
+Description: Add all the things
+ ${Common-Description}
+ .
+ This package's name contains a plus sign, not to be confused with the one that
+ instead contains a hyphen.
diff --git a/tests/data/pkg/build b/tests/data/pkg/build
index dbc550a..abbfe8f 100755
--- a/tests/data/pkg/build
+++ b/tests/data/pkg/build
@@ -5,4 +5,5 @@ build:
install: build
install -p -m 755 -D src/src/foo.sh foo.data/usr/bin/foo.sh
printf 'Generated-Depends: bar\n' >foo.substvars
+ printf 'Generated-Depends: bar\n' >baz+qux.substvars
printf 'Generated-Depends: bar\n' >baz-qux.substvars
diff --git a/tests/data/pkg/control b/tests/data/pkg/control
index 3165de1..f8717ef 100644
--- a/tests/data/pkg/control
+++ b/tests/data/pkg/control
@@ -1,2 +1,3 @@
Maintainer: "J. Random Hacker" <jrandom@example.com>
-Build-Depends: build-all-runes
+Build-Depends: build-all-runes, quiet-untuned-xylophone,
+ something-completely-different,
diff --git a/tests/data/pkg/foo.pkg/control b/tests/data/pkg/foo.pkg/control
index b383ff9..a0320b7 100644
--- a/tests/data/pkg/foo.pkg/control
+++ b/tests/data/pkg/foo.pkg/control
@@ -1,5 +1,6 @@
Architecture: any-linux-any
Platform: all
+Section: lib
Depends: ${Generated-Depends}
Description: Frobnicator of Objects
${Common-Description}
diff --git a/tests/exe/ob-buildenv.sh b/tests/exe/ob-buildenv.sh
index 3720207..29235c0 100755
--- a/tests/exe/ob-buildenv.sh
+++ b/tests/exe/ob-buildenv.sh
@@ -41,4 +41,8 @@ cmd_is 'ob-buildenv' ob-buildenv <<-EOF
STRINGS='i686-linux-glibc-strings'
STRIP='i686-linux-glibc-strip'
OPK_TOOL_PREFIX='i686-linux-glibc-'
+ CFLAGS=' -ffile-prefix-map=${PWD}=.'
+ CXXFLAGS=' -ffile-prefix-map=${PWD}=.'
+ TZ='UTC0'
+ LC_ALL='C'
EOF
diff --git a/tests/exe/ob-buildopk.sh b/tests/exe/ob-buildopk.sh
index 020824a..ca0c7ee 100755
--- a/tests/exe/ob-buildopk.sh
+++ b/tests/exe/ob-buildopk.sh
@@ -43,14 +43,14 @@ plan_ 9
rm -Rf *'.data/' *'.control/'
mkdir -p 'foo.data/usr/bin/' 'bar.data/' 'foo.control/' 'bar.control/' \
- 'baz-qux.data/' 'baz-qux.control/'
+ 'baz+qux.data/' 'baz+qux.control/' 'baz-qux.data/' 'baz-qux.control/'
cp -p '../../src/src/foo.sh' 'foo.data/usr/bin/'
touch 'foo.control/control' 'foo.control/md5sums' \
'bar.control/control' 'bar.control/md5sums'
command_ok_ 'ob-buildopk exit status' -- "${FAKEROOT}" ob-buildopk
-for opk in '../../foo_1.0-1_i686-linux-glibc_all.opk' \
- '../../bar_1.0-1_all_all.opk'; do
+for opk in '../../foo:i686-linux-glibc_1.0-1_i686-linux-glibc_all.opk' \
+ '../../bar_1.0-1_i686-linux-glibc_all.opk'; do
command_ok_ 'opk exists' -- [ -f "${opk}" ]
cmd_is 'outer archive contents' ls_outer "${opk}" <<-EOF
debian-binary
@@ -64,13 +64,14 @@ for opk in '../../foo_1.0-1_i686-linux-glibc_all.opk' \
EOF
done
cmd_is 'data.tar.gz contents' \
- ls_inner '../../foo_1.0-1_i686-linux-glibc_all.opk' data.tar.gz <<-EOF
+ ls_inner '../../foo:i686-linux-glibc_1.0-1_i686-linux-glibc_all.opk' \
+ data.tar.gz <<-EOF
./
./usr/
./usr/bin/
./usr/bin/foo.sh
EOF
cmd_is 'data.tar.gz contents' \
- ls_inner '../../bar_1.0-1_all_all.opk' data.tar.gz <<-EOF
+ ls_inner '../../bar_1.0-1_i686-linux-glibc_all.opk' data.tar.gz <<-EOF
./
EOF
diff --git a/tests/exe/ob-genchanges.sh b/tests/exe/ob-genchanges.sh
index c0e38fc..7fc8ec8 100755
--- a/tests/exe/ob-genchanges.sh
+++ b/tests/exe/ob-genchanges.sh
@@ -24,15 +24,16 @@ set -eu
plan_ 2
->'../../foo_1.0-1_i686-linux-glibc_all.opk'
->'../../bar_1.0-1_all_all.opk'
+>'../../foo:i686-linux-glibc_1.0-1_i686-linux-glibc_all.opk'
+>'../../bar_1.0-1_i686-linux-glibc_all.opk'
+>'../../baz+qux_1.0-1_all_all.opk'
>'../../baz-qux_1.0-1_all_all.opk'
command_ok_ 'ob-genchanges exit status' -- ob-genchanges
cmd_is 'changes file' cat '../../foo_1.0-1_i686-linux-glibc_x60.changes' <<-EOF
Format: 1.0
Source: foo
- Binary: bar baz-qux foo
+ Binary: bar baz+qux baz-qux foo
Version: 1.0-1
Architecture: i686-linux-glibc
Platform: x60
@@ -42,13 +43,15 @@ cmd_is 'changes file' cat '../../foo_1.0-1_i686-linux-glibc_x60.changes' <<-EOF
Date: Thu, 01 Jan 1970 01:00:00 +0000
Description:
bar - Bit-bang All Registers
+ baz+qux - Add all the things
baz-qux - Hyphenate all the things
foo - Frobnicator of Objects
Changes:
foo (1.0-1) trunk
* Initial release.
Files:
- 0 base foo_1.0-1_i686-linux-glibc_all.opk
+ 0 lib foo:i686-linux-glibc_1.0-1_i686-linux-glibc_all.opk
+ 0 base baz+qux_1.0-1_all_all.opk
0 base baz-qux_1.0-1_all_all.opk
- 0 base bar_1.0-1_all_all.opk
+ 0 util bar_1.0-1_i686-linux-glibc_all.opk
EOF
diff --git a/tests/exe/ob-gencontrol.sh b/tests/exe/ob-gencontrol.sh
index a619856..309e28a 100755
--- a/tests/exe/ob-gencontrol.sh
+++ b/tests/exe/ob-gencontrol.sh
@@ -22,20 +22,22 @@ set -eu
. "${TOP_SRCDIR}/tests/aux/tap-functions.sh"
. "${TOP_SRCDIR}/tests/aux/common.sh"
-plan_ 12
+plan_ 14
OB_DO_SOURCE='true' command_ok_ 'ob-gencontrol source package exit status' -- \
ob-gencontrol
-cmd_is 'source package control file' cat 'src-foo.control/control' <<-EOF
- Package: src-foo
+cmd_is 'source package control file' cat 'src:foo.control/control' <<-EOF
+ Package: src:foo
Source: foo
- Binary: bar baz-qux foo
+ Binary: bar baz+qux baz-qux foo
Version: 1.0-1
Architecture: src
Platform: all
Maintainer: "J. Random Hacker" <jrandom@example.com>
- Build-Depends: build-all-runes
+ Build-Depends: build-all-runes, quiet-untuned-xylophone, $(: \
+ )something-completely-different
Installed-Size: 0
+ Format: 2.0
Description: foo source package
EOF
@@ -45,12 +47,13 @@ cp -Rp '../../src/' 'src/'
for run in 'first' 'second'; do
command_ok_ "ob-gencontrol ${run} run exit status" -- ob-gencontrol
- cmd_is 'control file' cat 'foo.control/control' <<-EOF
- Package: foo
+ cmd_is "${run} run foo control file" cat 'foo.control/control' <<-EOF
+ Package: foo:i686-linux-glibc
Source: foo
Version: 1.0-1
Architecture: i686-linux-glibc
Platform: all
+ Section: lib
Maintainer: "J. Random Hacker" <jrandom@example.com>
Depends: bar
Installed-Size: 1
@@ -61,16 +64,18 @@ for run in 'first' 'second'; do
.
This package provides a frobnicator of objects.
EOF
- cmd_is 'md5sums file' cat 'foo.control/md5sums' <<-EOF
+ cmd_is "${run} run foo md5sums file" cat 'foo.control/md5sums' <<-EOF
582b7bd410b9e196dfb0a706ac95bf23 /usr/bin/foo.sh
EOF
- cmd_is 'control file' cat 'bar.control/control' <<-EOF
+ cmd_is "${run} run bar control file" cat 'bar.control/control' <<-EOF
Package: bar
Source: foo
Version: 1.0-1
- Architecture: all
+ Architecture: i686-linux-glibc
Platform: all
+ Section: util
Maintainer: "J. Random Hacker" <jrandom@example.com>
+ Depends: foo:i686-linux-glibc (= 1.0-1)
Installed-Size: 0
Description: Bit-bang All Registers
This is a frobnicator of objects. Conveniently, it also $(: \
@@ -79,14 +84,36 @@ for run in 'first' 'second'; do
.
This package assists in bit-banging all yer registers.
EOF
- cmd_is 'control file' cat 'baz-qux.control/control' <<-EOF
+ cmd_is "${run} run baz+qux control file" cat 'baz+qux.control/control' \
+ <<-EOF
+ Package: baz+qux
+ Source: foo
+ Version: 1.0-1
+ Architecture: all
+ Platform: all
+ Maintainer: "J. Random Hacker" <jrandom@example.com>
+ Depends: foo:i686-linux-glibc (>= 1.0-1), $(: \
+ )foo:i686-linux-glibc (<< 1.0-1.~), bar
+ Installed-Size: 0
+ Description: Add all the things
+ This is a frobnicator of objects. Conveniently, it also $(: \
+ )bit-bangs all
+ registers.
+ .
+ This package's name contains a plus sign, not to be $(: \
+ )confused with the one that
+ instead contains a hyphen.
+ EOF
+ cmd_is "${run} baz-qux foo control file" cat 'baz-qux.control/control' \
+ <<-EOF
Package: baz-qux
Source: foo
Version: 1.0-1
Architecture: all
Platform: all
Maintainer: "J. Random Hacker" <jrandom@example.com>
- Depends: bar
+ Depends: foo:i686-linux-glibc (>= 1.0-1), $(: \
+ )foo:i686-linux-glibc (<< 1.0-1.~), bar
Installed-Size: 0
Description: Hyphenate all the things
This is a frobnicator of objects. Conveniently, it also $(: \
diff --git a/tests/exe/ob-installdocs.sh b/tests/exe/ob-installdocs.sh
index 96c3244..d55f116 100755
--- a/tests/exe/ob-installdocs.sh
+++ b/tests/exe/ob-installdocs.sh
@@ -22,20 +22,24 @@ set -eu
. "${TOP_SRCDIR}/tests/aux/tap-functions.sh"
. "${TOP_SRCDIR}/tests/aux/common.sh"
-plan_ 10
+plan_ 11
rm -Rf *'.data/'
command_ok_ 'ob-installdocs first run exit status' -- ob-installdocs
for f in 'copyright' 'changelog.dist' 'README.upstream'; do
command_ok_ "${f} file installed" -- \
- [ -f "foo.data/usr/share/doc/foo/${f}" ]
+ [ -f "foo.data/usr/share/doc/foo:i686-linux-glibc/${f}" ]
done
command_ok_ 'link created' -- [ -L 'bar.data/usr/share/doc/bar' ]
command_ok_ 'ob-installdocs second run exit status' -- ob-installdocs
for f in 'copyright' 'changelog.dist' 'README.upstream'; do
command_ok_ "${f} file installed" -- \
- [ -f "foo.data/usr/share/doc/foo/${f}" ]
+ [ -f "foo.data/usr/share/doc/foo:i686-linux-glibc/${f}" ]
done
command_ok_ 'link created' -- [ -L 'bar.data/usr/share/doc/bar' ]
+
+command_ok_ 'link destination' -- \
+ [ "x$(ls -l 'bar.data/usr/share/doc/bar' | sed 's/^.* -> //')" = \
+ "x/usr/share/doc/foo:i686-linux-glibc" ]
diff --git a/tests/exe/opkbuild.sh b/tests/exe/opkbuild.sh
index b569986..d113e5b 100755
--- a/tests/exe/opkbuild.sh
+++ b/tests/exe/opkbuild.sh
@@ -49,9 +49,9 @@ rm -Rf 'src/' 'tmp/'
cp -Rp '../src/' 'src/'
command_ok_ 'opkbuild exit status' -- opkbuild -a i686-linux-glibc -p x60 -dc
-for opk in '../src-foo_1.0-1_src_all.opk' \
- '../foo_1.0-1_i686-linux-glibc_all.opk' \
- '../bar_1.0-1_all_all.opk'; do
+for opk in '../src:foo_1.0-1_src_all.opk' \
+ '../foo:i686-linux-glibc_1.0-1_i686-linux-glibc_all.opk' \
+ '../bar_1.0-1_i686-linux-glibc_all.opk'; do
command_ok_ 'opk exists' -- [ -f "${opk}" ]
cmd_is 'outer archive contents' ls_outer "${opk}" <<-EOF
debian-binary
@@ -60,38 +60,40 @@ for opk in '../src-foo_1.0-1_src_all.opk' \
EOF
done
cmd_is 'control.tar.gz contents' \
- ls_inner '../src-foo_1.0-1_src_all.opk' control.tar.gz <<-EOF
+ ls_inner '../src:foo_1.0-1_src_all.opk' control.tar.gz <<-EOF
./
./control
./md5sums
EOF
cmd_is 'control.tar.gz contents' \
- ls_inner '../foo_1.0-1_i686-linux-glibc_all.opk' control.tar.gz <<-EOF
+ ls_inner '../foo:i686-linux-glibc_1.0-1_i686-linux-glibc_all.opk' \
+ control.tar.gz <<-EOF
./
./control
./md5sums
EOF
cmd_is 'control.tar.gz contents' \
- ls_inner '../bar_1.0-1_all_all.opk' control.tar.gz <<-EOF
+ ls_inner '../bar_1.0-1_i686-linux-glibc_all.opk' control.tar.gz <<-EOF
./
./control
EOF
cmd_is 'data.tar.gz contents' \
- ls_inner '../foo_1.0-1_i686-linux-glibc_all.opk' data.tar.gz <<-EOF
+ ls_inner '../foo:i686-linux-glibc_1.0-1_i686-linux-glibc_all.opk' \
+ data.tar.gz <<-EOF
./
./usr/
./usr/bin/
./usr/bin/foo.sh
./usr/share/
./usr/share/doc/
- ./usr/share/doc/foo/
- ./usr/share/doc/foo/README.dist
- ./usr/share/doc/foo/README.upstream
- ./usr/share/doc/foo/changelog.dist
- ./usr/share/doc/foo/copyright
+ ./usr/share/doc/foo:i686-linux-glibc/
+ ./usr/share/doc/foo:i686-linux-glibc/README.dist
+ ./usr/share/doc/foo:i686-linux-glibc/README.upstream
+ ./usr/share/doc/foo:i686-linux-glibc/changelog.dist
+ ./usr/share/doc/foo:i686-linux-glibc/copyright
EOF
cmd_is 'data.tar.gz contents' \
- ls_inner '../bar_1.0-1_all_all.opk' data.tar.gz <<-EOF
+ ls_inner '../bar_1.0-1_i686-linux-glibc_all.opk' data.tar.gz <<-EOF
./
./usr/
./usr/share/
diff --git a/tests/lib/ob_get_binary_parameter.sh b/tests/lib/ob_get_binary_parameter.sh
index 1ad8a32..c85c3ec 100755
--- a/tests/lib/ob_get_binary_parameter.sh
+++ b/tests/lib/ob_get_binary_parameter.sh
@@ -23,7 +23,7 @@ set -eu
. "${TOP_SRCDIR}/tests/aux/common.sh"
. "${TOP_BUILDDIR}/lib/libopkbuild.${SHSOEXT}.${LIBOPKBUILD_SHSOVERSION}"
-plan_ 5
+plan_ 7
command_ok_ 'ob_init_package()' -- ob_init_package '..'
@@ -32,6 +32,10 @@ is 'foo Architecture' \
is 'foo Platform' \
"$(ob_get_binary_parameter 'foo' 'Platform')" 'all'
is 'bar Architecture' \
- "$(ob_get_binary_parameter 'bar' 'Architecture')" 'all'
+ "$(ob_get_binary_parameter 'bar' 'Architecture')" 'any'
is 'bar Platform' \
"$(ob_get_binary_parameter 'bar' 'Platform')" 'all'
+is 'baz-qux Architecture' \
+ "$(ob_get_binary_parameter 'baz-qux' 'Architecture')" 'all'
+is 'baz-qux Platform' \
+ "$(ob_get_binary_parameter 'baz-qux' 'Platform')" 'all'
diff --git a/tests/lib/ob_iso8601_gmtime.sh b/tests/lib/ob_iso8601_gmtime.sh
index 840b378..f9d0deb 100755
--- a/tests/lib/ob_iso8601_gmtime.sh
+++ b/tests/lib/ob_iso8601_gmtime.sh
@@ -1,4 +1,4 @@
-# Tests for ob_arch_is_concerned()
+# Tests for ob_iso8601_gmtime()
#
# Copyright (C) 2019 Patrick McDermott
#
@@ -23,7 +23,7 @@ set -eu
. "${TOP_SRCDIR}/tests/aux/common.sh"
. "${TOP_BUILDDIR}/lib/libopkbuild.${SHSOEXT}.${LIBOPKBUILD_SHSOVERSION}"
-plan_ 7
+plan_ 10
tst()
{
@@ -40,4 +40,7 @@ tst 108123 '1970-01-02T06:02:03Z'
tst 41877296 '1971-04-30T16:34:56Z'
tst 762480000 '1994-03-01T00:00:00Z'
tst 962443230 '2000-07-01T09:20:30Z'
+tst 1607419408 '2020-12-08T09:23:28Z'
+tst 1609459199 '2020-12-31T23:59:59Z'
+tst 1609510819 '2021-01-01T14:20:19Z'
tst 2147483648 '2038-01-19T03:14:08Z'
diff --git a/tests/lib/ob_reduce_deps.sh b/tests/lib/ob_reduce_deps.sh
index b1e8609..72f32dd 100755
--- a/tests/lib/ob_reduce_deps.sh
+++ b/tests/lib/ob_reduce_deps.sh
@@ -22,7 +22,7 @@ set -eu
. "${TOP_SRCDIR}/tests/aux/tap-functions.sh"
. "${TOP_BUILDDIR}/lib/libopkbuild.${SHSOEXT}.${LIBOPKBUILD_SHSOVERSION}"
-plan_ 11
+plan_ 13
# Normal and union AND-lists.
@@ -83,6 +83,15 @@ command_ok_ \
x'foo, bar' \
]
+command_ok_ \
+ 'NORMAL LIST "foo, bar,"' -- \
+ [ x"$(ob_reduce_deps \
+ -a 'amd64-linux-glibc' \
+ 'foo, bar,' \
+ )" = \
+ x'foo, bar' \
+ ]
+
# Normal OR-lists.
command_ok_ \
@@ -112,6 +121,15 @@ command_ok_ \
x'foo | bar' \
]
+command_ok_ \
+ 'NORMAL LIST "foo | bar |"' -- \
+ [ x"$(ob_reduce_deps \
+ -a 'amd64-linux-glibc' \
+ 'foo | bar |' \
+ )" = \
+ x'foo | bar' \
+ ]
+
# Normal and union AND-lists with arch specs.
command_ok_ \
diff --git a/tests/lib/ob_rfc822_mktime.sh b/tests/lib/ob_rfc822_mktime.sh
index f0ddcbc..e62e5a6 100755
--- a/tests/lib/ob_rfc822_mktime.sh
+++ b/tests/lib/ob_rfc822_mktime.sh
@@ -1,4 +1,4 @@
-# Tests for ob_arch_is_concerned()
+# Tests for ob_rfc822_mktime()
#
# Copyright (C) 2019 Patrick McDermott
#
@@ -23,7 +23,7 @@ set -eu
. "${TOP_SRCDIR}/tests/aux/common.sh"
. "${TOP_BUILDDIR}/lib/libopkbuild.${SHSOEXT}.${LIBOPKBUILD_SHSOVERSION}"
-plan_ 7
+plan_ 10
tst()
{
@@ -40,4 +40,7 @@ tst 'Fri, 02 Jan 1970 01:02:03 -0500' 108123
tst 'Fri, 30 Apr 1971 12:34:56 -0400' 41877296
tst 'Mon, 28 Feb 1994 19:00:00 -0500' 762480000
tst 'Sat, 01 Jul 2000 10:20:30 +0100' 962443230
+tst 'Tue, 08 Dec 2020 04:23:28 -0500' 1607419408
+tst 'Thu, 31 Dec 2020 23:59:59 +0000' 1609459199
+tst 'Fri, 01 Jan 2021 09:20:19 -0500' 1609510819
tst 'Tue, 19 Jan 2038 03:14:08 +0000' 2147483648
diff --git a/tests/lib/ob_touch_t_gmtime.sh b/tests/lib/ob_touch_t_gmtime.sh
new file mode 100755
index 0000000..f7c481c
--- /dev/null
+++ b/tests/lib/ob_touch_t_gmtime.sh
@@ -0,0 +1,46 @@
+# Tests for ob_touch_t_gmtime()
+#
+# Copyright (C) 2019, 2021 Patrick McDermott
+#
+# This file is part of opkbuild.
+#
+# opkbuild is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# opkbuild is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with opkbuild. If not, see <http://www.gnu.org/licenses/>.
+
+set -eu
+
+. "${TOP_SRCDIR}/tests/aux/tap-functions.sh"
+. "${TOP_SRCDIR}/tests/aux/common.sh"
+. "${TOP_BUILDDIR}/lib/libopkbuild.${SHSOEXT}.${LIBOPKBUILD_SHSOVERSION}"
+
+plan_ 10
+
+tst()
+{
+ local in="${1}"
+ local out="${2}"
+ shift 2
+
+ is "${in} = ${out}" "$(ob_touch_t_gmtime "${in}")" "${out}"
+}
+
+tst 0 '197001010000.00'
+tst 1 '197001010000.01'
+tst 108123 '197001020602.03'
+tst 41877296 '197104301634.56'
+tst 762480000 '199403010000.00'
+tst 962443230 '200007010920.30'
+tst 1607419408 '202012080923.28'
+tst 1609459199 '202012312359.59'
+tst 1609510819 '202101011420.19'
+tst 2147483648 '203801190314.08'
diff --git a/tests/local.mk b/tests/local.mk
index 7eca563..b986d2d 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -9,6 +9,7 @@ TESTS = \
%reldir%/lib/ob_get_binary_parameter.sh \
%reldir%/lib/ob_rfc822_mktime.sh \
%reldir%/lib/ob_iso8601_gmtime.sh \
+ %reldir%/lib/ob_touch_t_gmtime.sh \
%reldir%/exe/opkbuild_version.sh \
%reldir%/exe/ob-buildenv.sh \
%reldir%/exe/ob-unpacksource.sh \
@@ -41,6 +42,7 @@ EXTRA_DIST += \
tests/aux/common.sh \
tests/data/pkg/README \
tests/data/pkg/bar.pkg/control \
+ tests/data/pkg/baz+qux.pkg/control \
tests/data/pkg/baz-qux.pkg/control \
tests/data/pkg/build \
tests/data/pkg/changelog \