diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-10-12 21:57:40 -0400 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-10-12 21:57:40 -0400 |
commit | 54e76e856edbfd6ec3ffed263120bac4640525cd (patch) | |
tree | 6b773bb98444853865afcceab3bba264649d5b19 /documentation | |
parent | f3b2bdf68cb5161e6bf809a6e4b49291040ad1fe (diff) | |
download | phoronix-test-suite-upstream-54e76e856edbfd6ec3ffed263120bac4640525cd.tar.gz phoronix-test-suite-upstream-54e76e856edbfd6ec3ffed263120bac4640525cd.tar.xz phoronix-test-suite-upstream-54e76e856edbfd6ec3ffed263120bac4640525cd.zip |
documentation: Update profile writing how-to with latest pts-core features
Diffstat (limited to 'documentation')
-rw-r--r-- | documentation/writing_your_first_test.html | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/documentation/writing_your_first_test.html b/documentation/writing_your_first_test.html index 0550929..5e0eeaf 100644 --- a/documentation/writing_your_first_test.html +++ b/documentation/writing_your_first_test.html @@ -42,7 +42,7 @@ and the file-name would be <em>sample-program.xml</em>. Our (very basic) profile below.</p> <blockquote><PhoronixTestSuite><br> <TestProfile><br> - <Version>1.0</Version><br> + <Version>1.1.0</Version><br> <TestType>Processor</TestType><br> <SoftwareType>Utility</SoftwareType><br> <License>FREE</License><br> @@ -54,8 +54,7 @@ below.</p> <TimesToRun>3</TimesToRun><br> <ResultScale>Seconds</ResultScale><br> <Proportion>LIB</Proportion><br> - <Description>A simple C++ program that calculates Pi to 8,765,4321 digits -using the Leibniz formula.</Description><br> + <Description>A simple C++ program that calculates Pi to 8,765,4321 digits using the Leibniz formula. This test can be used for showcasing how to write a basic test profile.</Description><br> <ExternalDependencies>build-utilities</ExternalDependencies><br> </TestInformation><br> </PhoronixTestSuite></blockquote> @@ -83,9 +82,12 @@ Below is the <em>install.sh</em> for the <em>sample-program</em>.</p> tar -xjf sample-pi-program-1.tar.bz2<br /> g++ sample-pi-program.cpp -o sample-pi-program<br /> echo "#!/bin/sh<br /> -time -f \"Pi Calculation Time: %e Seconds\" ./sample-pi-program 2>&1 -| grep Seconds" > sample-program<br> +\$TIMER_START<br /> +./sample-pi-program 2>&1<br /> +\$TIMER_STOP<br /> +" > sample-program<br> chmod +x sample-program</blockquote> +<p>Phoronix Test Suite 1.4 and later provides an integrated multi-platform micro-timer framework that provides the <em>$TIMER_START</em> and <em>$TIMER_STOP</em> functionality.</p> <p>This install file builds the code with GCC, and then creates a small script that is run by the Phoronix Test Suite, which times how long it takes to run the software. Where does the source-code come into play? Well, it needs to be downloaded @@ -104,13 +106,8 @@ is done, and verification of MD5 check-sums. Below is the <em>downloads.xml</em> <p>The final step in the profile writing process is to write a parser to strip all information but the reported result from the standard output. The standard output is submitted to <em>parse-results.sh</em> or <em>parse-results.php</em> as the first argument -in quotes. In the case of <em>sample-program</em>, all that's done inside parse-results.php -is:</p> -<blockquote><?php<br> -$BENCHMARK_RESULTS = substr($argv[1], strrpos($argv[1], "Pi Calculation Time:") -+ 20);<br> -echo trim(substr($BENCHMARK_RESULTS, 0, strpos($BENCHMARK_RESULTS, "Seconds")));<br> -?></blockquote> +in quotes or using <em>$LOG_FILE</em> if the test profile writes to that variable's location.</p> +<p>If the test profile uses the integrated micro-timer framework with <em>$TIMER_START</em> and <em>$TIMER_STOP</em> but no parse-results file is provided, the Phoronix Test Suite will automatically use the difference between <em>$TIMER_START</em> and <em>$TIMER_STOP</em> and use that as the test result. This is the time (in seconds) that elapsed between starting and stopping the timer.</p> <p>After that, with all the files in their correct locations, just run: <em>phoronix-test-suite benchmark sample-program</em>. The Phoronix Test Suite should now handle the rest by installing the test, running the test, and recording the results (if you so choose). |