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