Skip to content

Commit

Permalink
[docs] Clarify environment variable behavior in testing.md
Browse files Browse the repository at this point in the history
Change-Id: Ibf8d62a347364de32d95509b3e8c7fbe3f444021
  • Loading branch information
Sean Klein committed Mar 16, 2017
1 parent b0e8a72 commit 48b10e5
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@ These classes are the following:

Since runtests doesn't really know what "class" is executing when it launches a
test, it encodes this information in the environment variable
`RUNTESTS_TEST_CLASS`, which is detailed in
"system/ulib/unittest/include/unittest/unittest.h", and lets the executable
itself decide what to run / not run.
`RUNTESTS_TEST_CLASS`, which is detailed in [the unittest
header][unittest-header] , and lets the executable itself decide what to run /
not run. This environment variable is a bitmask indicating which tests to run.

For example, if a a test executable is run with "small" and "medium" tests,
it will be executed ONCE with `RUNTESTS_TEST_CLASS` set to 00000003 (the
hex bitwise OR of "TEST_SMALL" and "TEST_MEDIUM" -- though this information
should be parsed using the [unittest header][unittest-header], as it may be
updated in the future).

## Magenta Tests (ulib/test, and/or using ulib/unittest)

Expand All @@ -44,13 +50,15 @@ The legacy `RUN_TEST(widget_test)` is aliased to mean the same thing as
## Fuchsia Tests (not using ulib/unittest)

The environment variable `RUNTESTS_TEST_CLASS` will still be available to all
executables launched by runtests. The "unittest/unittest.h" header can be used
to parse different categories of tests which the runtests harness attempted to
run.
executables launched by runtests. The [unittest header][unittest-header] can be
used to parse different categories of tests which the runtests harness attempted
to run.

## Runtests CLI

By default, runtests will run both small and medium tests.

To determine how to run a custom set of test categories, run `runtests -h`,
which includes usage information.

[unittest-header]: ../system/ulib/unittest/include/unittest/unittest.h "Unittest Header"

0 comments on commit 48b10e5

Please sign in to comment.