Running unit testsWe run unit tests as part of the build process using cros_run_unit_tests in ~/src/scripts (crostestutils.git). In a nutshell, this script uses the portage method of building and running unit tests using As an example, let's say you just want to run the unit tests for the metrics package. To do so, you can run:
Adding unit testsTo add unit tests to your packages, create a src_test stanza in your ebuild that builds and runs the unit tests (it is fine to have them build in the src_compile stage as well). See http://git.chromium.org/cgi-bin/gitweb.cgi?p=chromiumos-overlay.git;a=blob_plain;f=chromeos-base/metrics/metrics-9999.ebuild;hb=HEAD as a good example of adding your unit test.
How to Blacklist a package from running its unit testsIt's discouraged to have unit tests that need to be blacklisted. However, if you really need to black list a package from running its unit tests as part of the build, use either RESTRCT="test" in your ebuild or add it to the unit tests blacklist in src/scripts/unit_test_black_list.txt. Special Considerations
|
