Jetpack/Testing: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 2: Line 2:


This page explains how to run the SDK's unit tests, and how to interpret the results. It's aimed at people who don't have any familiarity with the SDK, but nevertheless have to run the tests to diagnose any test failures, for example because of regressions introduced by the underlying platform.
This page explains how to run the SDK's unit tests, and how to interpret the results. It's aimed at people who don't have any familiarity with the SDK, but nevertheless have to run the tests to diagnose any test failures, for example because of regressions introduced by the underlying platform.
== Quick Start ==
First, get the SDK from git:
  git clone git://github.com/mozilla/addon-sdk.git
Then enter the SDK directory and activate the SDK:
  cd addon-sdk
  source bin/activate
To run all tests:
  cfx testall
To run only the API tests (typically the ones that break when Firefox changes), invoke testpkgs instead of testall:
  cfx testpkgs
To run only certain test suites, specify the --filter flag with a regular expression that matches the filenames of the test suites you want to run:
  cfx testpkgs --filter panel
=== Specifying the Firefox Build ===
To run tests on a specific build of Firefox, specify the build via the --binary flag:
  cfx testall --binary /Applications/Nightly.app/
  cfx testall --binary ~/Mozilla/source/obj-dir/dist/bin/firefox
  cfx testall --binary /c/Program\ Files\Nightly\firefox.exe
=== Attaching a Debugger ===
To attach gdb before running tests, specify the <code>--no-run</code> flag:
  cfx testpkgs --no-run
<code>--no-run</code> doesn't actually run the command, it just prints out the shell command that would be invoked in order to run it. So the above command would produce output like:
To launch the application, enter the following command:
/Applications/Firefox.app/Contents/MacOS/firefox-bin -profile /var/folder
/me/me2B1lFDE0WZCgd33s2OTE+++TU/-Tmp-/tmp72nW_f.mozrunner -foreground -no-remote
You can then run the debugger using that command.
Need more detail? Read the rest of this document to learn all about the SDK's test suites and harness!


First, follow [https://addons.mozilla.org/en-US/developers/docs/sdk/latest/dev-guide/addon-development/installation.html these instructions] to download, install, and activate the SDK.
First, follow [https://addons.mozilla.org/en-US/developers/docs/sdk/latest/dev-guide/addon-development/installation.html these instructions] to download, install, and activate the SDK.
canmove, Confirmed users
737

edits

Navigation menu