Auto-tools/Projects/Robocop: Difference between revisions

Jump to navigation Jump to search
Line 4: Line 4:


= Setup  =
= Setup  =
=== Step one: Build Native Fennec ===
* First [https://developer.mozilla.org/en/Mozilla_Source_Code_%28Mercurial%29| grab the source]
* Then [https://wiki.mozilla.org/Mobile/Fennec/Android_OtherBuildEnvs| setup your build environment]
* Finally, build with the command <pre>make -f client.mk</pre> in the source directory


Build and install native Fennec, then execute the mochitest-robotium make target. MOZ_HOST_BIN must point to a desktop build or other location that provides xpcshell for desktop: $MOZ_HOST_BIN/xpcshell must be executable on your build machine (not the device!).
=== Step two: Build Firefox (Necessary for XPCShell) ===
* Follow [https://developer.mozilla.org/En/Simple_Firefox_build| these instructions]; the source used here, although the same as Fennec's, should live in a separate folder
<pre>
 
make -f client.mk
=== Step three: Install Native Fennec ===
cd objdir
Run the following commands in sequence, from the Fennec source directory:
<pre>cd {objdir}
make package
make package
adb install dist/fennec-*.apk
adb install dist/fennec-*.apk</pre>
export MOZ_HOST_BIN=~/objdir-x86/dist/bin
 
make mochitest-robotium
* NOTE *: {objdir} is a placeholder; the name of your object directory should not matter.
</pre>
 
= Running tests =


If you want to run just a single test, for example "testLoad", you can set it as your TEST_PATH while running like so:
=== Set up the MOZ_HOST_BIN environment variable ===
The MOZ_HOST_BIN variable will need to be set to the directory with XPCShell on your machine.
You can execute the following command in the terminal, or it can be saved into .bashrc / .bash_profile for convinence:
<pre>export MOZ_HOST_BIN=/ABSOLUTE/PATH/TO/FIREFOX/SOURCE/{objdir}/dist/bin</pre>
If you're having difficulty finding the absolute path of XPCShell's directory, simply locate XPCShell in your {objdir}/dist/bin and execute the command pwd .


<pre>
Again, {objdir} is a placeholder.
TEST_PATH=testLoad make mochitest-robotium
 
</pre>
=== Running all the tests ===
From the Fennec's objdir:
<pre>make mochitest-robotium</pre>


For an incremental build, you can replace the make commands above with:
=== Running a single test ===
From the Fennec's objdir (using testLoad as an example):
<pre>TEST_PATH=testLoad make mochitest-robotium</pre>


= Writing tests =
W.I.P.
<pre>
<pre>
cd objdir
make -C build/mobile/robocop/
make -C build/mobile/robocop/
make package
make package
76

edits

Navigation menu