Nobuaki Sukegawa | bd16530 | 2016-01-19 11:10:07 +0900 | [diff] [blame] | 1 | /* |
Roger Meier | 41ad434 | 2015-03-24 22:30:40 +0100 | [diff] [blame] | 2 | Licensed to the Apache Software Foundation (ASF) under one |
| 3 | or more contributor license agreements. See the NOTICE file |
| 4 | distributed with this work for additional information |
| 5 | regarding copyright ownership. The ASF licenses this file |
| 6 | to you under the Apache License, Version 2.0 (the |
| 7 | "License"); you may not use this file except in compliance |
| 8 | with the License. You may obtain a copy of the License at |
| 9 | |
| 10 | http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | |
| 12 | Unless required by applicable law or agreed to in writing, |
| 13 | software distributed under the License is distributed on an |
| 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | KIND, either express or implied. See the License for the |
| 16 | specific language governing permissions and limitations |
| 17 | under the License. |
| 18 | |
Nobuaki Sukegawa | bd16530 | 2016-01-19 11:10:07 +0900 | [diff] [blame] | 19 | */ |
| 20 | |
Roger Meier | 41ad434 | 2015-03-24 22:30:40 +0100 | [diff] [blame] | 21 | $.getJSON('results.json', function(results) { |
| 22 | $(document).ready(function() { |
| 23 | var transport = 3; |
| 24 | var socket = 4; |
| 25 | var success = 5; |
| 26 | var expected = 6; |
| 27 | var returnCode = 7; |
| 28 | var logFile = 8; |
| 29 | testTable = $('#test_results').DataTable({ |
| 30 | data: results['results'], |
| 31 | columnDefs: [ |
| 32 | { |
| 33 | targets: 3, |
| 34 | render: function(data, type, row) { |
| 35 | return row[transport] + '-' + row[socket]; |
| 36 | }, |
Roger Meier | e8bafb6 | 2014-08-01 23:39:32 +0200 | [diff] [blame] | 37 | }, |
Roger Meier | 41ad434 | 2015-03-24 22:30:40 +0100 | [diff] [blame] | 38 | { |
| 39 | targets: 4, |
| 40 | render: function(data, type, row) { |
| 41 | return (row[success] ? 'success' : 'failure') |
| 42 | + '(' + (row[returnCode] == 128 ? 'timeout' : row[returnCode]) + ')' |
| 43 | + '(<a href="' + row[logFile].server + '">Server</a>, ' |
| 44 | + '<a href="' + row[logFile].client + '">Client</a>)'; |
| 45 | }, |
| 46 | }, |
| 47 | { |
| 48 | targets: 5, |
| 49 | render: function(data, type, row) { |
| 50 | // 'yes' rather than 'expected' to ease search |
| 51 | return row[expected] ? 'yes' : 'unexpected'; |
| 52 | }, |
| 53 | } |
| 54 | ], |
cdwijayarathna | 3f67978 | 2014-07-09 14:00:33 +0530 | [diff] [blame] | 55 | }); |
Roger Meier | 41ad434 | 2015-03-24 22:30:40 +0100 | [diff] [blame] | 56 | $('#test_results_filter label input').focus().val('unexpected failure'); |
| 57 | $('#test_info').text( |
| 58 | "Test Date: " + results['date'] + "\n" + |
| 59 | "Revision: " + results['revision'] + "\n" + |
| 60 | "Platform: " + results['platform'] + "\n" + |
| 61 | "Test duration: " + results['duration']) + " seconds"; |
| 62 | }); |
| 63 | }); |
Nobuaki Sukegawa | bd16530 | 2016-01-19 11:10:07 +0900 | [diff] [blame] | 64 | |