tree: c1607a604f6126d65c655fa921fdf711f0183613 [path history] [tgz]
  1. cpp/
  2. rust/
  3. BUILD.gn
  4. README.md
examples/hello_world/README.md

Hello World Components

This directory contains simple components to show how components are built run, and tested in the system.

Building

If these components are not present in your build, they can be added by appending --with //examples to your fx set command. Eg:

$ fx set core.x64 --with //examples:tests
$ fx build

(Disclaimer: if these build rules become out of date please check the Build documentation and update this readme!)

Running

To find the fuchsia-pkg URLs of these components the locate tool can be used:

$ fx shell locate hello_world

Pick the URL of a component, and provide it to run:

$ fx shell run 'fuchsia-pkg://fuchsia.com/rust_hello_world#meta/rust_hello_world.cmx'

Make sure you have fx serve running in another terminal so your component can be installed!

Testing

To run one of the test components defined here, use fx run-test with the package name:

$ fx run-test rust_hello_world_tests

Or use the locate tool again and provide a URL to run_test_component on the Fuchsia shell:

$ fx shell locate hello_world_tests
$ fx shell run 'fuchsia-pkg://fuchsia.com/rust_hello_world_tests#meta/rust_hello_world_tests.cmx'