[tools] Add cargo-gnaw to CI

Made a series of testability improvements for `cargo-gnaw` that allow
its integration tests to run in continuous integration.  This ensures
the longevity of test support.

- Testability changes that sanitize the behavior of cargo-gnaw on errors

  Removed the file existence check for the `gn` binary: you should be
  able to use `gn` on your path.  And in case of an error, the default
  error behavior is already informative enough.

  Added a nice error message when the `gn` binary is not found.

  Instead of doing an `exit` on arg parsing error, return a Result.
  Otherwise, testing stdout and stderr behavior becomes *very*
  confusing.

  Factored the `gnaw_lib` crate and the `run` function which makes it
  possible to do an end-to-end test pass with all the functionality.

- Links cargo-gnaw to CI.

  Without having cargo-gnaw in CI, it is far too easy to break it.
  Furthermore, without formatting it's not sustainable to keep raw
  BUILD.gn files in the tests.

- Supplied the necessary env variables as external configuration.

  This should enable the formatting tests to run hermetically.

- Moved integration tests into a separate directory.

  They are somewhat different.

- Tests now format the output at the end.

  This prevents inadvertent test breaks due to golden test changes.

Bug: 55504
Change-Id: I34d3d3b59d56c6647b96cfab4c0f27e7b3b1ce22
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/404600
Reviewed-by: George Kulakowski <kulakowski@google.com>
Reviewed-by: Marc-Antoine Ruel <maruel@google.com>
Commit-Queue: Filip Filmar <fmil@google.com>
Testability-Review: Filip Filmar <fmil@google.com>
89 files changed
tree: e25d2530e56ba8e5453f30a06cb648e06eb2185b
  1. boards/
  2. build/
  3. bundles/
  4. cts/
  5. docs/
  6. examples/
  7. garnet/
  8. products/
  9. scripts/
  10. sdk/
  11. src/
  12. third_party/
  13. tools/
  14. zircon/
  15. .clang-format
  16. .clang-tidy
  17. .gitattributes
  18. .gitignore
  19. .gn
  20. .style.yapf
  21. AUTHORS
  22. BUILD.gn
  23. CODE_OF_CONDUCT.md
  24. CONTRIBUTING.md
  25. LICENSE
  26. OWNERS
  27. PATENTS
  28. README.md
  29. rustfmt.toml
README.md

Fuchsia

Pink + Purple == Fuchsia (a new operating system)

What is Fuchsia?

Fuchsia is a modular, capability-based operating system. Fuchsia runs on modern 64-bit Intel and ARM processors.

Fuchsia is an open source project with a code of conduct that we expect everyone who interacts with the project to respect.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See fuchsia.dev.