build: include/version.inc.php
test:
- make -C ut test
+ phpunit pltestsuite classes/pltestsuite.php
clean:
-rm include/version.inc.php
--- /dev/null
+<?php
+/***************************************************************************
+ * Copyright (C) 2003-2010 Polytechnique.org *
+ * http://opensource.polytechnique.org/ *
+ * *
+ * This program 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 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program 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 this program; if not, write to the Free Software *
+ * Foundation, Inc., *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
+ ***************************************************************************/
+
+require_once 'PHPUnit/Framework.php';
+
+abstract class PlTestCase extends PHPUnit_Framework_TestCase
+{
+}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
--- /dev/null
+<?php
+/***************************************************************************
+ * Copyright (C) 2003-2010 Polytechnique.org *
+ * http://opensource.polytechnique.org/ *
+ * *
+ * This program 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 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program 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 this program; if not, write to the Free Software *
+ * Foundation, Inc., *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
+ ***************************************************************************/
+
+require_once dirname(__FILE__) . '/../include/test.inc.php';
+require_once 'PHPUnit/Framework.php';
+
+class PlTestSuite
+{
+ public static function suite()
+ {
+ $suite = new PHPUnit_Framework_TestSuite('Plat/al');
+ $base = dirname(dirname(dirname(__FILE__)));
+ $pathes = glob($base . '/**/ut/', GLOB_ONLYDIR);
+ if (file_exists($base . '/ut')) {
+ array_push($pathes, $base . '/ut');
+ }
+ foreach ($pathes as $path) {
+ $subsuite = new PHPUnit_Framework_TestSuite('Plat/al: ' . $path);
+ foreach (glob($path . '/*.php') as $f) {
+ $class = basename($f);
+ $class = substr($class, 0, strlen($class) - 4);
+ require_once $f;
+ $subsuite->addTestSuite($class);
+ }
+ $suite->addTest($subsuite);
+ }
+ return $suite;
+ }
+}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-require_once dirname(__FILE__) . '/platal.inc.php';
-require_once 'PHPUnit/Framework.php';
+if (!@include_once dirname(__FILE__) . '/../../include/test.inc.php') {
+ require_once dirname(__FILE__) . '/platal.inc.php';
+ require_once 'PHPUnit/Framework.php';
-function __autoload($class)
-{
- pl_autoload($class);
-}
-
-abstract class PlTestCase extends PHPUnit_Framework_TestCase
-{
+ function __autoload($class)
+ {
+ pl_autoload($class);
+ }
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+++ /dev/null
-files=$(addprefix test-,$(wildcard *.php))
-
-test: $(files)
- echo "$(files)"
-
-test-%:
- phpunit $*
-
-.PHONY: test test-%
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-include_once dirname(__FILE__) . '/../include/test.inc.php';
+require_once dirname(__FILE__) . '/../include/test.inc.php';
class ArrayIteratorTest extends PlTestCase
{
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-include_once dirname(__FILE__) . '/../include/test.inc.php';
+require_once dirname(__FILE__) . '/../include/test.inc.php';
class XDBTest extends PlTestCase
{