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/control2
-rw-r--r--tests/data/pkg/baz+qux.pkg/control8
-rwxr-xr-xtests/data/pkg/build1
-rwxr-xr-xtests/exe/ob-buildopk.sh6
-rwxr-xr-xtests/exe/ob-genchanges.sh9
-rwxr-xr-xtests/exe/ob-gencontrol.sh39
-rwxr-xr-xtests/exe/opkbuild.sh6
-rwxr-xr-xtests/lib/ob_get_binary_parameter.sh8
-rwxr-xr-xtests/lib/ob_reduce_deps.sh20
-rw-r--r--tests/local.mk1
11 files changed, 81 insertions, 23 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 fff5663..93c1198 100644
--- a/tests/data/pkg/bar.pkg/control
+++ b/tests/data/pkg/bar.pkg/control
@@ -1,4 +1,4 @@
-Architecture: all
+Architecture: any
Platform: all
Section: util
Description: Bit-bang All Registers
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/exe/ob-buildopk.sh b/tests/exe/ob-buildopk.sh
index 1f59124..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:i686-linux-glibc_1.0-1_i686-linux-glibc_all.opk' \
- '../../bar_1.0-1_all_all.opk'; do
+ '../../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
@@ -72,6 +72,6 @@ cmd_is 'data.tar.gz contents' \
./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 d0bc6a0..7fc8ec8 100755
--- a/tests/exe/ob-genchanges.sh
+++ b/tests/exe/ob-genchanges.sh
@@ -25,14 +25,15 @@ set -eu
plan_ 2
>'../../foo:i686-linux-glibc_1.0-1_i686-linux-glibc_all.opk'
->'../../bar_1.0-1_all_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,6 +43,7 @@ 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:
@@ -49,6 +51,7 @@ cmd_is 'changes file' cat '../../foo_1.0-1_i686-linux-glibc_x60.changes' <<-EOF
* Initial release.
Files:
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 util 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 fd58dc9..309e28a 100755
--- a/tests/exe/ob-gencontrol.sh
+++ b/tests/exe/ob-gencontrol.sh
@@ -22,14 +22,14 @@ 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
Source: foo
- Binary: bar baz-qux foo
+ Binary: bar baz+qux baz-qux foo
Version: 1.0-1
Architecture: src
Platform: all
@@ -47,7 +47,7 @@ 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
+ cmd_is "${run} run foo control file" cat 'foo.control/control' <<-EOF
Package: foo:i686-linux-glibc
Source: foo
Version: 1.0-1
@@ -64,17 +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 $(: \
@@ -83,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/opkbuild.sh b/tests/exe/opkbuild.sh
index e9f0808..d113e5b 100755
--- a/tests/exe/opkbuild.sh
+++ b/tests/exe/opkbuild.sh
@@ -51,7 +51,7 @@ 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:i686-linux-glibc_1.0-1_i686-linux-glibc_all.opk' \
- '../bar_1.0-1_all_all.opk'; do
+ '../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
@@ -73,7 +73,7 @@ cmd_is 'control.tar.gz contents' \
./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
@@ -93,7 +93,7 @@ cmd_is 'data.tar.gz contents' \
./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_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/local.mk b/tests/local.mk
index d2770f4..b986d2d 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -42,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 \