6 # Created by Wincent Colaiuta on 01 March 2006.
8 # Copyright 2006-2007 Wincent Colaiuta.
9 # This program is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
27 # test bundle path relative to this script
28 TEST_BUNDLE="WOTestSelfTests.bundle"
30 # WOTest.framework path relative to this script
31 TEST_FRAMEWORK="../../../../WOTest.framework"
40 if [ $ERR -ne 0 ]; then
51 STARTING_DIRECTORY=`/bin/pwd`
52 builtin echo "Saved current working directory: ${STARTING_DIRECTORY}"
54 SCRIPT_DIRECTORY=$(/usr/bin/dirname "$0")
55 builtin echo "Changing to script directory: ${SCRIPT_DIRECTORY}"
56 cd "${SCRIPT_DIRECTORY}"
57 SCRIPT_DIRECTORY=$(/bin/pwd)
58 builtin echo "Script directory with symlinks resolved: ${SCRIPT_DIRECTORY}"
60 if [ "${DYLD_FRAMEWORK_PATH}" != "" ]; then
61 SAVE_DLYD_FRAMEWORK_PATH=`declare -p DYLD_FRAMEWORK_PATH`
62 builtin echo "Saved old DYLD_FRAMEWORK_PATH: ${SAVE_DLYD_FRAMEWORK_PATH}"
64 SAVE_DLYD_FRAMEWORK_PATH=""
67 DYLD_FRAMEWORK_PATH=$(/usr/bin/dirname "${SCRIPT_DIRECTORY}/${TEST_FRAMEWORK}")
68 cd "${DYLD_FRAMEWORK_PATH}"
69 export DYLD_FRAMEWORK_PATH=$(/bin/pwd)
71 builtin echo "DYLD_FRAMEWORK_PATH set to ${DYLD_FRAMEWORK_PATH}"
73 builtin echo "Launching test runner for bundle: ${SCRIPT_DIRECTORY}/${TEST_BUNDLE}"
74 "${SCRIPT_DIRECTORY}/${TEST_FRAMEWORK}/Versions/A/Resources/WOTestRunner" --test-bundle="${SCRIPT_DIRECTORY}/${TEST_BUNDLE}"
76 builtin echo "Test run complete"
78 builtin echo "Restoring old DYLD_FRAMEWORK_PATH"
79 eval "${SAVE_DLYD_FRAMEWORK_PATH}"
81 builtin echo "Returning to old working directory"
82 cd "${STARTING_DIRECTORY}"