summaryrefslogtreecommitdiffstats
path: root/non-puppet/qtmetrics2/index.php
diff options
context:
space:
mode:
authorJuha Sippola <juhasippola@outlook.com>2015-09-21 15:15:18 +0300
committerTony Sarajärvi <tony.sarajarvi@theqtcompany.com>2015-09-23 09:38:09 +0000
commit787465ad37eabef9cb83fdb56954025a301422e6 (patch)
treed947c0e63868d0cffd3fda455134d8767811615e /non-puppet/qtmetrics2/index.php
parentcc1bb3968b1aa9795309bf3514595dc286e5bf27 (diff)
Qt Metrics 2 (v0.21): Testset testfunctions page
New page to list failed and skipped testfunctions for a selected testset in selected configuration. Change-Id: I9612ec4cd8b5ff829f0b8faf7f973345797d7daa Reviewed-by: Tony Sarajärvi <tony.sarajarvi@theqtcompany.com>
Diffstat (limited to 'non-puppet/qtmetrics2/index.php')
-rw-r--r--non-puppet/qtmetrics2/index.php57
1 files changed, 56 insertions, 1 deletions
diff --git a/non-puppet/qtmetrics2/index.php b/non-puppet/qtmetrics2/index.php
index a7d0290..10a4856 100644
--- a/non-puppet/qtmetrics2/index.php
+++ b/non-puppet/qtmetrics2/index.php
@@ -34,7 +34,7 @@
/**
* Qt Metrics API
- * @since 10-08-2015
+ * @since 08-09-2015
* @author Juha Sippola
*/
@@ -469,6 +469,61 @@ $app->get('/testset/:testset/:project', function($testset, $project) use($app)
})->name('testset');
/**
+ * UI route: /testset/:testset/:project/:conf (GET)
+ */
+
+$app->get('/testset/:testset/:project/:conf', function($testset, $project, $conf) use($app)
+{
+ $testset = strip_tags($testset);
+ $project = strip_tags($project);
+ $conf = strip_tags($conf);
+ if (Factory::checkTestset($testset)) {
+ $testsetRoute = str_replace('/:testset/:project', '', Slim\Slim::getInstance()->urlFor('testset'));
+ $testsetProjectRoute = str_replace('/:project', '', Slim\Slim::getInstance()->urlFor('testsetproject'));
+ $confProjectRoute = str_replace('/:conf/:testsetproject', '', Slim\Slim::getInstance()->urlFor('conf_testsetproject'));
+ $ini = Factory::conf();
+ $breadcrumb = array(
+ array('name' => 'home', 'link' => Slim\Slim::getInstance()->urlFor('root')),
+ array('name' => 'overview', 'link' => Slim\Slim::getInstance()->urlFor('overview')),
+ array('name' => $project, 'link' => $testsetProjectRoute . '/' . $project),
+ array('name' => $conf, 'link' => $confProjectRoute . '/' . urlencode($conf) . '/' . $project),
+ array('name' => $testset, 'link' => $testsetRoute . '/' . $testset. '/' . $project)
+ );
+ $confProjectRoute = str_replace('/:conf/:testsetproject', '', Slim\Slim::getInstance()->urlFor('conf_testsetproject'));
+ $testfunctionRoute = 'testfunction'; // TODO: Replace later with $testfunctionRoute = str_replace('/:testfunction', '', Slim\Slim::getInstance()->urlFor('testfunction'));
+ $app->render('testset_testfunctions.html', array(
+ 'root' => Slim\Slim::getInstance()->urlFor('root'),
+ 'breadcrumb' => $breadcrumb,
+ 'testfunctionRoute' => $testfunctionRoute,
+ 'refreshed' => Factory::db()->getDbRefreshed() . ' (GMT)',
+ 'masterProject' => $ini['master_build_project'],
+ 'masterState' => $ini['master_build_state'],
+ 'conf' => $conf,
+ 'projectRuns' => Factory::createProjectRuns(
+ $ini['master_build_project'],
+ $ini['master_build_state']), // managed as objects
+ 'testset' => Factory::createTestset(
+ $testset,
+ $project,
+ $ini['master_build_project'],
+ $ini['master_build_state']), // managed as object
+ 'testfunctionRuns' => Factory::createTestfunctionRunsInConf(
+ $testset,
+ $project,
+ $conf,
+ $ini['master_build_project'],
+ $ini['master_build_state']) // managed as objects
+ ));
+ } else {
+ $app->render('empty.html', array(
+ 'root' => Slim\Slim::getInstance()->urlFor('root'),
+ 'message' => '404 Not Found'
+ ));
+ $app->response()->status(404);
+ }
+})->name('testset_testfunctions');
+
+/**
* UI route: /sitemap (GET)
*/