Skip to content
Permalink
Browse files

tests: add --self-update tests

  • Loading branch information...
austin987 committed Aug 27, 2019
1 parent cec8f30 commit 22cb18b010a2af1ea0557bb143a6f47ef1fbc770
Showing with 41 additions and 0 deletions.
  1. +3 −0 .travis.yml
  2. +38 −0 tests/self-update-test
@@ -76,6 +76,9 @@ script:
# Also check for trailing whitespace. Not doing in shell-checks because it depends on a clean tree (uses git diff):
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then time sh ./tests/whitespace-check; fi

# Keep updates working
- time sh ./tests/self-update-test

# OS X doesn't allow writing to /usr/bin, skip non-PREFIX make install test there
install:
- if [[ "$TRAVIS_OS_NAME" != "osx" ]] ; then time sudo make install ; fi
@@ -0,0 +1,38 @@
#!/bin/sh
#
# Tests for --self-update functionality
#
# FIXME: add tests for sudo, rollback, etc.
#
# Copyright (C) 2019 Austin English
#
# This software comes with ABSOLUTELY NO WARRANTY.
#
# This is free software, placed under the terms of the GNU Lesser
# Public License version 2.1 (or later), as published by the Free
# Software Foundation. Please see the file COPYING for details.

set -e
set -x

tmpdir="$(mktemp -d)"
wt="${tmpdir}/winetricks"

git show "HEAD^1":src/winetricks > "${tmpdir}/winetricks"

# Make sure the update does something:
current_wt_version="$(sh "${wt}" --version)"

sh "${wt}" --self-update

new_wt_version="$(sh "${wt}" --version)"

# Did the update work?
if [ "${current_wt_version}" = "${new_wt_version}" ]; then
echo "--self-update failed, version info is the same"
exit 1
else
echo "--self-update returned success!"
echo "before: ${current_wt_version}"
echo "after: ${new_wt_version}"
fi

0 comments on commit 22cb18b

Please sign in to comment.
You can’t perform that action at this time.