tast: Add testing.Test.SoftwareDeps.

Add a SoftwareDeps field to the testing package's Test
struct. Also add a MissingSoftwareDeps method that can be
used to check a test's dependencies against the software
features supported by the DUT's system image.

BUG=chromium:835991
TEST=added unit tests and manually verified in conjunction
     with followup changes

Change-Id: I5f108bf1a2f664aae6a3b6f97127d61d95eb1fbc
Reviewed-on: https://chromium-review.googlesource.com/1038890
Commit-Ready: Dan Erat <[email protected]>
Tested-by: Dan Erat <[email protected]>
Reviewed-by: Jason Clinton <[email protected]>
diff --git a/docs/test_dependencies.md b/docs/test_dependencies.md
new file mode 100644
index 0000000..2a22222
--- /dev/null
+++ b/docs/test_dependencies.md
@@ -0,0 +1,27 @@
+# Tast Test Dependencies
+
+A test may specify software features that must be supported by the DUT's system
+image in order for the test to run successfully. If one or more features aren't
+supported by the DUT, the test will (usually) be skipped. See the `tast`
+command's `-checktestdeps` flag to control this behavior.
+
+Tests specify dependencies through the `SoftwareDeps` field in [testing.Test].
+The following software features are defined:
+
+*   `android` - The ability to run Android apps.
+*   `chrome` - A Chrome process.
+*   `chrome_login` - Implies `chrome` with the further requirement that user
+    login (i.e. using `session_manager` and `cryptohome`) is supported.
+
+Software features are composed from USE flags. [local_test_runner] lists boolean
+expressions that are used to generate features; for example, an imaginary
+feature named `hd_audio` with expression `cras && (audio_chipset_a ||
+audio_chipset_b) && !broken_headphone_jack` will be reported as available on
+systems where the `cras` USE flag is set, either `audio_chipset_a` or
+`audio_chipset_b` is set, and `broken_headphone_jack` is explicitly *not* set.
+Before a new USE flag can be used in an expression, it must be added to `IUSE`
+in the [tast-use-flags] package.
+
+[testing.Test]: https://godoc.org/chromium.googlesource.com/chromiumos/platform/tast.git/src/chromiumos/tast/testing#Test
+[local_test_runner]: https://chromium.googlesource.com/chromiumos/platform/tast/+/master/src/chromiumos/cmd/local_test_runner/main.go
+[tast-use-flags]: https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/master/chromeos-base/tast-use-flags/