diff options
Diffstat (limited to 'tests/exe')
-rwxr-xr-x | tests/exe/ob-buildenv.sh | 4 | ||||
-rwxr-xr-x | tests/exe/ob-buildopk.sh | 11 | ||||
-rwxr-xr-x | tests/exe/ob-genchanges.sh | 13 | ||||
-rwxr-xr-x | tests/exe/ob-gencontrol.sh | 51 | ||||
-rwxr-xr-x | tests/exe/ob-installdocs.sh | 10 | ||||
-rwxr-xr-x | tests/exe/opkbuild.sh | 28 |
6 files changed, 79 insertions, 38 deletions
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/ |