#!/bin/bash . ./testlib.sh . ./pbuilder-satisfydepends-funcs # testsuite to test pbuilder-satisfydepends-funcs. DEBIAN_CONTROL="" cleanup() { if [ -n "$DEBIAN_CONTROL" ]; then rm -f "$DEBIAN_CONTROL" fi } test_get_build_deps() { local BINARY_ARCH BINARY_ARCH="$1" cat <"$DEBIAN_CONTROL" Source: amule XXXX: Build-Depends: autotools-dev ( >= 1.2 ) , debhelper , quilt(<<12:0), ## libwxgtk2.8-dev Build-Depends-Indep: test [ amd64 i386 ], test1, test2[!i386 ! amd64], test3 | test4, test5 Misc: test Build-Depends: wrong build depends, line Description: test other things wow EOF get_build_deps } trap cleanup sigpipe sighup exit # TODO move to build dir DEBIAN_CONTROL="$(tempfile)" expect_output "autotools-dev (>= 1.2), debhelper, quilt (<< 12:0), libwxgtk2.8-dev, test [amd64 i386], test1, test2 [!i386 !amd64], test3 | test4, test5" \ test_get_build_deps "no" expect_output "autotools-dev (>= 1.2), debhelper, quilt (<< 12:0), libwxgtk2.8-dev" \ test_get_build_deps "yes" testlib_summary