1page.title=Porting the test framework 2@jd:body 3 4<!-- 5 Copyright 2015 The Android Open Source Project 6 7 Licensed under the Apache License, Version 2.0 (the "License"); 8 you may not use this file except in compliance with the License. 9 You may obtain a copy of the License at 10 11 http://www.apache.org/licenses/LICENSE-2.0 12 13 Unless required by applicable law or agreed to in writing, software 14 distributed under the License is distributed on an "AS IS" BASIS, 15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 See the License for the specific language governing permissions and 17 limitations under the License. 18--> 19 20<div id="qv-wrapper"> 21 <div id="qv"> 22 <h2>In this document</h2> 23 <ol id="auto-toc"> 24 </ol> 25 </div> 26</div> 27 28<p>Porting the deqp involves three steps: adapting base portability libraries, 29implementing test-framework platform-integration interfaces, and porting the 30execution service.</p> 31 32<p>The table below lists locations for likely porting changes. Anything beyond 33them is likely to be exotic.</p> 34 35<table> 36 <tr> 37 <th>Location</th> 38 <th>Description</th> 39 </tr> 40 41 <tr> 42 <td><code> 43framework/delibs/debase<br/> 44framework/delibs/dethread<br/> 45framework/delibs/deutil</code></td> 46<td><p>Any necessary implementations of OS-specific code.</p> 47</td> 48 </tr> 49 <tr> 50 <td><code> 51framework/qphelper/qpCrashHandler.c</code></td> 52<td><p>Optional: Implementation for your OS.</p> 53</td> 54 </tr> 55 <tr> 56 <td><code> 57framework/qphelper/qpWatchDog.c</code></td> 58<td><p>Implementation for your OS. Current one is based on <code>dethread</code> and standard C library.</p> 59</td> 60 </tr> 61 <tr> 62 <td><code> 63framework/platform</code></td> 64<td><p>New platform port and application stub can be implemented as described in <a href="#test_framework_platform_port">Test framework platform port</a>.</p> 65</td> 66 </tr> 67</table> 68 69<h2 id=base_portability_libraries>Base portability libraries</h2> 70 71<p>The base portability libraries already support Windows, most Linux variants, Mac OS, 72iOS, and Android. If the test target runs on one of those operating systems, 73most likely there is no need to touch the base portability libraries at all.</p> 74 75<h2 id=test_framework_platform_port>Test framework platform port</h2> 76 77<p>The deqp test framework platform port requires two components: An application 78entry point and a platform interface implementation. </p> 79 80<p>The application entry point is responsible for creating the platform object, 81creating a command line (<code>tcu::CommandLine</code>) object, opening a test log (<code>tcu::TestLog</code>), and iterating the test application (<code>tcu::App</code>). If the target OS supports a standard <code>main()</code> entry point, <code>tcuMain.cpp</code> can be used as the entry point implementation.</p> 82 83<p>The deqp platform API is described in detail in the following files.</p> 84 85<table> 86 <tr> 87 <th>File</th> 88 <th>Description</th> 89 </tr> 90 <tr> 91 <td><code> 92framework/common/tcuPlatform.hpp</code></td> 93<td><p>Base class for all platform ports</p> 94</td> 95 </tr> 96 <tr> 97 <td><code> 98framework/opengl/gluPlatform.hpp</code></td> 99<td><p>OpenGL platform interface</p> 100</td> 101 </tr> 102 <tr> 103 <td><code> 104framework/egl/egluPlatform.hpp</code></td> 105<td><p>EGL platform interface</p> 106</td> 107 </tr> 108 <tr> 109 <td><code> 110framework/platform/tcuMain.cpp</code></td> 111<td><p>Standard application entry point</p> 112</td> 113 </tr> 114</table> 115 116<p>The base class for all platform ports is <code>tcu::Platform</code>. The platform port can optionally support GL- and EGL-specific interfaces. See 117the following table for an overview of what needs to be implemented to 118run the tests.</p> 119 120<table> 121 <tr> 122 <th>Module</th> 123 <th>Interface</th> 124 </tr> 125 <tr> 126 <td><p>OpenGL (ES) test modules</p> 127</td> 128 <td><p>GL platform interface</p> 129</td> 130 </tr> 131 <tr> 132 <td><p>EGL test module</p> 133</td> 134 <td><p>EGL platform interface</p> 135</td> 136 </tr> 137</table> 138 139<p>Detailed instructions for implementing platform ports are in the 140porting layer headers.</p> 141 142<h2 id=test_execution_service>Test execution service</h2> 143 144<p>To use the deqp test execution infrastructure or command line executor, the 145test execution service must be available on the target. A portable C++ 146implementation of the service is provided in the <code>execserver</code> directory. The stand-alone binary is built as a part of the deqp test module 147build for PC targets. You can modify <code>execserver/CMakeLists.txt</code> to enable a build on other targets.</p> 148 149<p>The C++ version of the test execution service accepts two command line 150parameters:</p> 151 152<ul> 153 <li> <code>--port=<port></code> will set the TCP port that the server listens on. The default is 50016. 154 <li> <code>--single</code> will terminate the server process when the client disconnects. By default, the 155server process will stay up to serve further test execution requests. 156</ul> 157