diff --git a/.travis.yml b/.travis.yml index 0b419a83..7357bb39 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,8 +21,9 @@ before_script: - if [[ "$DB" == "pgsql" ]]; then psql -c "DROP DATABASE IF EXISTS shimmie;" -U postgres; fi - if [[ "$DB" == "pgsql" ]]; then psql -c "create database shimmie;" -U postgres; fi - if [[ "$DB" == "mysql" ]]; then mysql -e "create database shimmie;" -uroot; fi + - php tests/test_install.php -d $DB -script: php tests/all_tests.php -d $DB +script: php tests/all_tests.php # If a failure occured then dump out a bunch of logs for debugging purposes. after_failure: diff --git a/tests/all_tests.php b/tests/all_tests.php index 0159e738..e07890ae 100644 --- a/tests/all_tests.php +++ b/tests/all_tests.php @@ -12,41 +12,17 @@ require_once('lib/simpletest/autorun.php'); require_once('lib/simpletest/unit_tester.php'); require_once('lib/simpletest/web_tester.php'); require_once('lib/simpletest/reporter.php'); -require_once('tests/test_install.php'); -require_once("core/util.inc.php"); // Enable all errors. error_reporting(E_ALL); -// Get the command line option telling us what database to use. -$options = getopt("d:"); -$db = $options["d"]; - -if (empty($db)){ die("Error: need to specifiy a database for the test environment."); } - -define("_TRAVIS_DATABASE", $db); - -// Install Shimmie -$test_suite = new TestSuite('Shimmie tests'); -$test_suite->add(new ShimmieInstallerTest()); - -// Wait for the config file to be written. - -$timeout = 5; - -while ($timeout > 0 && !file_exists("../data/config/shimmie.conf.php")) { - sleep(1); - $timeout--; - clearstatcache(); -} - -require_once("core/sys_config.inc.php"); -include "../data/config/shimmie.conf.php"; - // // The code below is from index.php // +require_once "core/sys_config.inc.php"; +require_once "core/util.inc.php"; + // set up and purify the environment _version_check(); _sanitise_environment(); diff --git a/tests/test_install.php b/tests/test_install.php index fc9b6224..ec43d151 100644 --- a/tests/test_install.php +++ b/tests/test_install.php @@ -8,6 +8,24 @@ * @copyright Copyright (c) 2014, jgen */ +require_once('lib/simpletest/autorun.php'); +require_once('lib/simpletest/unit_tester.php'); +require_once('lib/simpletest/web_tester.php'); +require_once('lib/simpletest/reporter.php'); +require_once('tests/test_install.php'); +require_once("core/util.inc.php"); + +// Enable all errors. +error_reporting(E_ALL); + +// Get the command line option telling us what database to use. +$options = getopt("d:"); +$db = $options["d"]; + +if (empty($db)){ die("Error: need to specifiy a database for the test environment."); } + +define("_TRAVIS_DATABASE", $db); + class ShimmieInstallerTest extends WebTestCase { function testInstallShimmie() {