mirrored from git://git.moodle.org/moodle.git
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/moodle/moodle
- Loading branch information
Showing
192 changed files
with
35,392 additions
and
621 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,22 @@ | |||
@ECHO OFF | |||
ECHO Initialising Moodle PHPUnit test environment... | |||
|
|||
CALL php %~dp0\util.php --diag > NUL 2>&1 | |||
|
|||
IF ERRORLEVEL 133 GOTO drop | |||
IF ERRORLEVEL 132 GOTO install | |||
IF ERRORLEVEL 1 GOTO unknown | |||
GOTO done | |||
|
|||
:drop | |||
CALL php %~dp0\util.php --drop | |||
IF ERRORLEVEL 1 GOTO done | |||
|
|||
:install | |||
CALL php %~dp0\util.php --install | |||
GOTO done | |||
|
|||
:unknown | |||
CALL php %~dp0\util.php --diag | |||
|
|||
:done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,66 @@ | |||
<?php | |||
// This file is part of Moodle - http://moodle.org/ | |||
// | |||
// Moodle is free software: you can redistribute it and/or modify | |||
// it under the terms of the GNU General Public License as published by | |||
// the Free Software Foundation, either version 3 of the License, or | |||
// (at your option) any later version. | |||
// | |||
// Moodle is distributed in the hope that it will be useful, | |||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
// GNU General Public License for more details. | |||
// | |||
// You should have received a copy of the GNU General Public License | |||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | |||
|
|||
/** | |||
* All in one init script - PHP version. | |||
* | |||
* @package tool_phpunit | |||
* @copyright 2012 Petr Skoda {@link http://skodak.org} | |||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | |||
*/ | |||
|
|||
if (isset($_SERVER['REMOTE_ADDR'])) { | |||
die; // no access from web! | |||
} | |||
|
|||
require_once(__DIR__.'/../../../../lib/clilib.php'); | |||
require_once(__DIR__.'/../../../../lib/phpunit/bootstraplib.php'); | |||
|
|||
echo "Initialising Moodle PHPUnit test environment...\n"; | |||
|
|||
$output = null; | |||
exec('php --version', $output, $code); | |||
if ($code != 0) { | |||
phpunit_bootstrap_error(1, 'Can not execute \'php\' binary.'); | |||
} | |||
|
|||
chdir(__DIR__); | |||
$output = null; | |||
exec("php util.php --diag", $output, $code); | |||
if ($code == 0) { | |||
// everything is ready | |||
|
|||
} else if ($code == 132) { | |||
passthru("php util.php --install", $code); | |||
if ($code != 0) { | |||
exit($code); | |||
} | |||
|
|||
} else if ($code == 133) { | |||
passthru("php util.php --drop", $code); | |||
passthru("php util.php --install", $code); | |||
if ($code != 0) { | |||
exit($code); | |||
} | |||
|
|||
} else { | |||
echo implode("\n", $output)."\n"; | |||
exit($code); | |||
} | |||
|
|||
passthru("php util.php --buildconfig", $code); | |||
|
|||
exit(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,31 @@ | |||
#!/bin/bash | |||
|
|||
SOURCE="${BASH_SOURCE[0]}" | |||
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done | |||
CLIDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | |||
|
|||
UTIL="$CLIDIR/util.php" | |||
|
|||
echo "Initialising Moodle PHPUnit test environment..." | |||
|
|||
DIGERROR=`php $UTIL --diag` | |||
DIAG=$? | |||
if [ $DIAG -eq 132 ] ; then | |||
php $UTIL --install | |||
else | |||
if [ $DIAG -eq 133 ] ; then | |||
php $UTIL --drop | |||
RESULT=$? | |||
if [ $RESULT -gt 0 ] ; then | |||
exit $RESULT | |||
fi | |||
php $UTIL --install | |||
else | |||
if [ $DIAG -gt 0 ] ; then | |||
echo $DIGERROR | |||
exit $DIAG | |||
fi | |||
fi | |||
fi | |||
|
|||
php $UTIL --buildconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.