diff options
author | Juha Sippola <juhasippola@outlook.com> | 2015-09-21 15:39:07 +0300 |
---|---|---|
committer | Tony Sarajärvi <tony.sarajarvi@theqtcompany.com> | 2015-09-23 09:38:28 +0000 |
commit | 096b99cdfc4f6ee17a09aa09c77a650be4877e06 (patch) | |
tree | 46d9859c2bcbc532f284390056d5b7addc58a9e6 /non-puppet/qtmetrics2/index.php | |
parent | 76dc840d91d4e51cf7cbf447147af1fc2eff753e (diff) |
Qt Metrics 2 (v0.23): Testfunction page
New page to list failed or skipped testrows for
selected testfunction in selected testset and
configuration.
Change-Id: I64e7b7acf1a6001c08d0f11460f063bef279d607
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@theqtcompany.com>
Diffstat (limited to 'non-puppet/qtmetrics2/index.php')
-rw-r--r-- | non-puppet/qtmetrics2/index.php | 57 |
1 files changed, 54 insertions, 3 deletions
diff --git a/non-puppet/qtmetrics2/index.php b/non-puppet/qtmetrics2/index.php index 545d0e6..8cef994 100644 --- a/non-puppet/qtmetrics2/index.php +++ b/non-puppet/qtmetrics2/index.php @@ -34,7 +34,7 @@ /** * Qt Metrics API - * @since 08-09-2015 + * @since 09-09-2015 * @author Juha Sippola */ @@ -488,8 +488,7 @@ $app->get('/testset/:testset/:project/:conf', function($testset, $project, $conf array('name' => $project, 'link' => $testsetProjectRoute . '/' . $project), array('name' => $conf, 'link' => $confProjectRoute . '/' . urlencode($conf) . '/' . $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')); + $testfunctionRoute = str_replace('/:testfunction/:testset/:project/:conf', '', Slim\Slim::getInstance()->urlFor('testfunction')); $app->render('testset_testfunctions.html', array( 'root' => Slim\Slim::getInstance()->urlFor('root'), 'breadcrumb' => $breadcrumb, @@ -523,6 +522,58 @@ $app->get('/testset/:testset/:project/:conf', function($testset, $project, $conf })->name('testset_testfunctions'); /** + * UI route: /testfunction/:testfunction/:testset/:project/:conf (GET) + */ + +$app->get('/testfunction/:testfunction/:testset/:project/:conf', function($testfunction, $testset, $project, $conf) use($app) +{ + $testfunction = strip_tags($testfunction); + $testset = strip_tags($testset); + $project = strip_tags($project); + $conf = strip_tags($conf); + if (Factory::checkTestset($testset)) { + $testsetTestfunctionRoute = str_replace('/:testset/:project/:conf', '', Slim\Slim::getInstance()->urlFor('testset_testfunctions')); + $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' => $testsetTestfunctionRoute . '/' . $testset . '/' . $project . '/' . urlencode($conf)) + ); + $app->render('testfunction.html', array( + 'root' => Slim\Slim::getInstance()->urlFor('root'), + 'breadcrumb' => $breadcrumb, + 'refreshed' => Factory::db()->getDbRefreshed() . ' (GMT)', + 'masterProject' => $ini['master_build_project'], + 'masterState' => $ini['master_build_state'], + 'conf' => $conf, + 'testset' => $testset, + 'testfunction' => $testfunction, + 'projectRuns' => Factory::createProjectRuns( + $ini['master_build_project'], + $ini['master_build_state']), // managed as objects + 'testrowRuns' => Factory::createTestrowRunsInConf( + $testfunction, + $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('testfunction'); + +/** * UI route: /sitemap (GET) */ |