diff options
Diffstat (limited to 'en/devices/tech/test_infra/tradefed/fundamentals')
3 files changed, 46 insertions, 24 deletions
diff --git a/en/devices/tech/test_infra/tradefed/fundamentals/machine_setup.html b/en/devices/tech/test_infra/tradefed/fundamentals/machine_setup.html index 71dcf5c9..47b99bde 100644 --- a/en/devices/tech/test_infra/tradefed/fundamentals/machine_setup.html +++ b/en/devices/tech/test_infra/tradefed/fundamentals/machine_setup.html @@ -33,7 +33,7 @@ <p> From the root directory of the Android source tree: </p> -<pre> +<pre class="devsite-click-to-copy"> <code class="devsite-terminal">source ./build/make/envsetup.sh</code> <code class="devsite-terminal">lunch <device-target></code> <code class="devsite-terminal">make tradefed-all -j8</code> @@ -44,7 +44,7 @@ <p> TradeFed requires the <code>adb</code> utility in your <code>$PATH</code>: </p> -<pre class="devsite-terminal"> +<pre class="devsite-terminal devsite-click-to-copy"> export PATH=$PATH:<path/to/adb> </pre> @@ -52,7 +52,7 @@ export PATH=$PATH:<path/to/adb> Once TradeFed is built, the <code>tradefed.sh</code> launcher script is accessible from your path. To launch the Trade Federation console: </p> -<pre class="devsite-terminal"> +<pre class="devsite-terminal devsite-click-to-copy"> tradefed.sh </pre> <p> diff --git a/en/devices/tech/test_infra/tradefed/fundamentals/options.html b/en/devices/tech/test_infra/tradefed/fundamentals/options.html index fc494f34..bb891b79 100644 --- a/en/devices/tech/test_infra/tradefed/fundamentals/options.html +++ b/en/devices/tech/test_infra/tradefed/fundamentals/options.html @@ -46,7 +46,8 @@ the TF console when the command is run with <code>--help</code> or <code>--help- <p>As an example, let's say we want to build a functional phone test which will dial a variety of phone numbers, and will expect to receive a sequence of DTMF tones from each number after it connects.</p> -<code><pre>public class PhoneCallFuncTest extends IRemoteTest { +<pre class="prettyprint"> +public class PhoneCallFuncTest extends IRemoteTest { @Option(name = "timeout", description = "How long to wait for connection, in millis") private long mWaitTime = 30 * 1000; // 30 seconds @@ -56,7 +57,8 @@ connects.</p> public PhoneCallFuncTest() { mCalls.add("123-456-7890", "01134"); // default - }</pre></code> + } +</pre> <p>That's all that's required for the Developer to set up two points of configuration for that test. They could then go off and use <code>mWaitTime</code> and <code>mCalls</code> as normal, @@ -73,21 +75,24 @@ suppose the Integrator wanted to define a lower-latency test that calls the defa as a long-running test that calls a variety of numbers. They could create a pair of configurations that might look like the following:</p> -<code><pre><?xml version="1.0" encoding="utf-8"?> +<pre class="prettyprint"> +<?xml version="1.0" encoding="utf-8"?> <configuration description="low-latency default test; low-latency.xml"> <test class="com.example.PhoneCallFuncTest"> <option name="timeout" value="5000" /> </test> -</configuration></pre></code> +</configuration></pre> -<code><pre><?xml version="1.0" encoding="utf-8"?> +<pre class="prettyprint"> +<?xml version="1.0" encoding="utf-8"?> <configuration description="call a bunch of numbers; many-numbers.xml"> <test class="com.example.PhoneCallFuncTest"> <option name="call" key="111-111-1111" value="#*#*TEST1*#*#" /> <option name="call" key="222-222-2222" value="#*#*TEST2*#*#" /> <!-- ... --> </test> -</configuration></pre></code> +</configuration> +</pre> <h2 id="testrunner">Test Runner</h2> <p>The Test Runner also has access to these configuration points via the Trade Federation console. @@ -98,11 +103,14 @@ append to fields specified by Lifecycle Objects within each config.</p> <p>To run the low-latency test with the <code>many-numbers</code> phone numbers, the Test Runner could execute:</p> -<code><pre>tf >run low-latency.xml --call 111-111-1111 #*#*TEST1*#*# --call 222-222-2222 #*#*TEST2*#*#</pre></code> +<pre class="devsite-click-to-copy"> +tf> run low-latency.xml --call 111-111-1111 #*#*TEST1*#*# --call 222-222-2222 #*#*TEST2*#*# +</pre> <p>Or, to get a similar effect from the opposite direction, the Test Runner could reduce the wait time for the <code>many-numbers</code> test:</p> -<code><pre>tf >run many-numbers.xml --timeout 5000</code></pre> +<pre class="devsite-click-to-copy"> +tf> run many-numbers.xml --timeout 5000</pre> </body> </html> diff --git a/en/devices/tech/test_infra/tradefed/fundamentals/vts.html b/en/devices/tech/test_infra/tradefed/fundamentals/vts.html index 473db22f..8ba912d8 100644 --- a/en/devices/tech/test_infra/tradefed/fundamentals/vts.html +++ b/en/devices/tech/test_infra/tradefed/fundamentals/vts.html @@ -31,27 +31,41 @@ then test a patch using a VTS plan.</p> <p>To set up a testing environment:</p> <ol> <li>Install Python development kit: -<pre><code>$ sudo apt-get install python-dev</code></pre></li> +<pre class="devsite-terminal devsite-click-to-copy"> +sudo apt-get install python-dev +</pre> +</li> <li>Install Protocol Buffer tools (for Python): -<pre><code>$ sudo apt-get install python-protobuf<br> -$ sudo apt-get install protobuf-compiler -</code></pre></li> +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">sudo apt-get install python-protobuf</code> +<code class="devsite-terminal">sudo apt-get install protobuf-compiler</code> +</pre> +</li> <li>Install Python virtual environment-related tools: -<pre><code>$ sudo apt-get install python-virtualenv<br> -$ sudo apt-get install python-pip -</code></pre></li></ol> +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">sudo apt-get install python-virtualenv</code> +<code class="devsite-terminal">sudo apt-get install python-pip</code> +</pre> +</li> +</ol> <h2 id="test">Testing a patch</h2> <p>To test a patch:</p> <ol> <li>Build a VTS host-side package: -<pre><code>$ . build/envsetup.sh -$ lunch aosp_arm64-userdebug -$ make vts -j</code></pre></li> +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">. build/envsetup.sh</code> +<code class="devsite-terminal">lunch aosp_arm64-userdebug</code> +<code class="devsite-terminal">make vts -j</code> +</pre> +</li> <li>Run the default VTS tests: -<pre><code>$ vts-tradefed<br> -> run vts // where vts is the test plan name -</pre></code></li></ol> +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">vts-tradefed</code> +tf> run vts // where vts is the test plan name +</pre> +</li> +</ol> <h2 id="plans">VTS plans</h2> <p>Available VTS test plans include:</p> |