diff options
author | stuconnolly <stuart02@gmail.com> | 2012-09-08 12:41:19 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2012-09-08 12:41:19 +0000 |
commit | 79a3dbd44f55340d2b6bd5f7e508341adaea1ad3 (patch) | |
tree | 9913f11efa0246513dad0854e53d414c3062a585 /Frameworks/PostgresKit/Scripts | |
parent | 9f9b1599232e2a93ee910b6a2888f911eedead70 (diff) | |
download | sequelpro-79a3dbd44f55340d2b6bd5f7e508341adaea1ad3.tar.gz sequelpro-79a3dbd44f55340d2b6bd5f7e508341adaea1ad3.tar.bz2 sequelpro-79a3dbd44f55340d2b6bd5f7e508341adaea1ad3.zip |
Add tests target and test script.
Diffstat (limited to 'Frameworks/PostgresKit/Scripts')
-rwxr-xr-x | Frameworks/PostgresKit/Scripts/build-libpq.sh | 2 | ||||
-rwxr-xr-x | Frameworks/PostgresKit/Scripts/run-tests.sh | 65 |
2 files changed, 66 insertions, 1 deletions
diff --git a/Frameworks/PostgresKit/Scripts/build-libpq.sh b/Frameworks/PostgresKit/Scripts/build-libpq.sh index a4f07f18..e94308e9 100755 --- a/Frameworks/PostgresKit/Scripts/build-libpq.sh +++ b/Frameworks/PostgresKit/Scripts/build-libpq.sh @@ -3,7 +3,7 @@ # # $Id$ # -# build- +# build-libpq.sh # sequel-pro # # Created by Stuart Connolly (stuconnolly.com) on August 1, 2012. diff --git a/Frameworks/PostgresKit/Scripts/run-tests.sh b/Frameworks/PostgresKit/Scripts/run-tests.sh new file mode 100755 index 00000000..73e8292f --- /dev/null +++ b/Frameworks/PostgresKit/Scripts/run-tests.sh @@ -0,0 +1,65 @@ +#! /bin/ksh + +# +# $Id$ +# +# run-tests.sh +# sequel-pro +# +# Created by Stuart Connolly (stuconnolly.com) on September 9, 2012. +# Copyright (c) 2012 Stuart Connolly. All rights reserved. +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation +# files (the "Software"), to deal in the Software without +# restriction, including without limitation the rights to use, +# copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following +# conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# +# More info at <http://code.google.com/p/sequel-pro/> + +export PGPASSWORD=pgkit + +if [ ! -f /Library/PostgreSQL/bin/psql ] +then + echo "error: can't find Postgres CLI at path '/Library/PostgreSQL/bin/psql'. No tests will be run." + exit 1 +fi + +TEST_DATA_FILE="${SRCROOT}/Resources/TestData.sql" + +if [ ! -f "$TEST_DATA_FILE" ] +then + echo "error: Test data file does not exist at path '${TEST_DATA_FILE}'. No tests will be run." + exit 1 +fi + +echo 'Loading integration data...' + +/Library/PostgreSQL/bin/psql -U pgkit_test -d pgkit_test -q < "$TEST_DATA_FILE" > /dev/null 2>&1 + +if [ $? -eq 0 ] +then + echo 'Integration test data successfully loaded. Running tests..' +else + echo 'error: Failed to load integration data. No tests will be run.' + exit 1 +fi + +"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests" + +exit 0 |