Add a basic compositing Animometer test
[WebKit-https.git] / Websites / test-results / public / api / failing-tests.php
1 <?php
2
3 require_once('../include/json-shared.php');
4 require_once('../include/test-results.php');
5
6 function main() {
7     require_existence_of($_GET, array('builder' => '/^[A-Za-z0-9 \(\)\-_]+$/'));
8     $builder_param = $_GET['builder'];
9
10     $db = connect();
11     $builder_row = $db->select_first_row('builders', NULL, array('name' => $builder_param));
12     if (!$builder_row) {
13         $builder_row = $db->select_first_row('builders', NULL, array('id' => $builder_param));
14         if (!$builder_row)
15             exit_with_error('BuilderNotFound');
16     }
17     $builder_id = $builder_row['id'];
18
19     $generator = new ResultsJSONGenerator($db, $builder_id);
20
21     if (!$generator->generate('wrongexpectations'))
22         exit_with_error('ResultsWithWrongExpectationsNotFound', array('builderId' => $builder_id));
23     else if (!$generator->generate('flaky'))
24         exit_with_error('FlakyResultsNotFound', array('builderId' => $builder_id));
25     else
26         exit_with_success();
27 }
28
29 main();
30
31 ?>