You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

65 lines
1.6 KiB

  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. buildsimplenativepackage 'baz' 'all' '1'
  7. buildsimplenativepackage 'foo' 'all' '1'
  8. buildsimplenativepackage 'bar' 'all' '2'
  9. buildsimplenativepackage 'bar' 'all' '1'
  10. EXPECT_PKG='Package: bar
  11. Version: 1
  12. Package: bar
  13. Version: 2
  14. Package: baz
  15. Version: 1
  16. Package: foo
  17. Version: 1'
  18. EXPECT_SRC="$EXPECT_PKG"
  19. linkfiles() {
  20. ln -s "../incoming/${2}.dsc" "${1}/${2}.dsc"
  21. ln -s "../incoming/${2}.tar.xz" "${1}/${2}.tar.xz"
  22. ln -s "../incoming/${2}_all.deb" "${1}/${2}_all.deb"
  23. }
  24. genoptions() {
  25. echo 'baz_1'
  26. echo 'foo_1'
  27. echo 'bar_2'
  28. echo 'bar_1'
  29. }
  30. gencombos() {
  31. for a in $(genoptions); do
  32. for b in $(genoptions); do
  33. if [ "$a" = "$b" ]; then continue; fi
  34. for c in $(genoptions); do
  35. if [ "$a" = "$c" -o "$b" = "$c" ]; then continue; fi
  36. for d in $(genoptions); do
  37. if [ "$a" = "$d" -o "$b" = "$d" -o "$c" = "$d" ]; then continue; fi
  38. echo "${a};${b};${c};${d}"
  39. done
  40. done
  41. done
  42. done
  43. }
  44. for combo in $(gencombos); do
  45. msgmsg 'Running apt-ftparchive in configuration' "$combo"
  46. incomedir="incoming${combo}"
  47. mkdir "$incomedir"
  48. for i in $(echo "$combo" | tr ';' '\n'); do
  49. linkfiles "$incomedir" "$i"
  50. done
  51. testsuccess aptftparchive packages "$incomedir"
  52. cp rootdir/tmp/testsuccess.output aptarchive/Packages
  53. testsuccessequal "$EXPECT_PKG" grep -e '^Package: ' -e '^Version: ' aptarchive/Packages
  54. testsuccess aptftparchive -qq sources "$incomedir"
  55. cp rootdir/tmp/testsuccess.output aptarchive/Sources
  56. testsuccessequal "$EXPECT_SRC" grep -e '^Package: ' -e '^Version: ' aptarchive/Sources
  57. done