add a testsuite to wine-app-packager
authorJoachim Breitner <joachim.breitner@itomig.de>
Fri, 12 Jun 2009 09:59:39 +0000 (09:59 +0000)
committerJoachim Breitner <joachim.breitner@itomig.de>
Fri, 12 Jun 2009 09:59:39 +0000 (09:59 +0000)
testsuite.sh [new file with mode: 0755]
wine-app-packager

diff --git a/testsuite.sh b/testsuite.sh
new file mode 100755 (executable)
index 0000000..35a40a6
--- /dev/null
@@ -0,0 +1,71 @@
+#!/bin/bash
+
+echo <<''
+wine-app-packager test suite. This will create a package from 7z and check if
+everything is ok.
+
+if [ -d ~/.wine-7z-master ]
+then
+       echo "~/.wine-7z-master already exists, can not run testsuite"
+       exit 1
+fi
+
+set -e
+set -x
+
+sourcedir="$(dirname "$PWD/$0")"
+tmpdir=$(mktemp -t -d wine-app-packager-test.XXXXXXXX)
+trap "rm -rf \"$tmpdir\"" EXIT
+cd $tmpdir
+
+WAP="$sourcedir/wine-app-packager"
+
+if [ ! -x $WAP ]
+then
+       echo "$WAP is not executable"
+       exit 1
+fi
+
+$WAP init 7z <<''
+7z
+1.2.3
+
+
+if [ ! -d 7z-1.2.3 ]
+then
+       echo "init did not create the 7z-1.2.3 directory"
+       exit 1
+fi
+
+cd 7z-1.2.3
+
+$WAP prepare
+
+if [ ! -d ~/.wine-7z-master ]
+then
+       echo "init did not create the ~/.wine-7z-master directory"
+       exit 1
+fi
+
+$WAP run $sourcedir/testdata/7z465.exe /S
+
+$WAP commit
+
+echo This should fail:
+! dpkg-buildpackage -uc -us 
+
+echo Setting .exe name in script
+sed -i -e 's/EXE=.*/EXE='\''c:\\Programme\\7-Zip\\7zFM.exe'\''/' 7z
+
+echo And now this should work:
+dpkg-buildpackage -uc -us 
+
+if ! debc | grep -q ./opt/wineapps/wine-7z/drive_c/Programme/7-Zip/7zFM.exe
+then
+       echo "debc does not contain ./opt/wineapps/wine-7z/drive_c/Programme/7-Zip/7zFM.exe"
+       debc
+       exit 1
+fi
+
+echo "Test suite successfully finished"
+
index d13d994..7f5a96a 100755 (executable)
@@ -165,7 +165,12 @@ install: build
        dh_testroot
        dh_clean -k
        dh_installdirs
-
+       
+       if grep -q "^EXE='c:.Programme.Please Adjust.start.exe'" $APPNAME ; \
+       then echo "Please update the EXE variable in the script $APPNAME"; \
+            exit 1; \
+       fi;
+       
        # Add here commands to install the package into debian/<packagename>
        #\$(MAKE) prefix=\`pwd\`/debian/\`dh_listpackages\`/usr install
 
@@ -227,7 +232,7 @@ __END__
        chmod +x "$DEBDIR/$APPNAME" 
        echo "Generating \"$DEBDIR/debian/changelog\""
        pushd "$DEBDIR"
-       debchange --create --package "$APPNAME" --newversion "$DEBVER-1" --distribution UNRELEASED "First release of $APPNAME"
+       debchange --create --package "$APPNAME" --newversion "$DEBVER" --distribution UNRELEASED "First release of $APPNAME"
        popd
        cat <<__END__
 Done preparing the source package. You can review the contents of these files