Merge #199
199: Add the QEMU test invocation to `make test` r=jrvanwhy a=jrvanwhy
Prior to this PR, there was no easy way to run `libtock_test` in QEMU. It was run as part of the Travis CI checks, but not `make test`. This PR moves that functionality into the Makefile, so that `make test` runs the QEMU tests.
Main changes in this PR:
1. Added a tock submodule pointing to the kernel version the tests are run against. This submodule is used to build Tock kernels for testing.
1. Tweaked the README to clarify that the Tock submodule has its own license (although it matches libtock-rs' license).
1. Added `make setup-qemu`, automatically run as part of `make qemu`, which compiles QEMU in a new `build` directory. This shouldn't touch the host system, although you need QEMU's dependencies for it to succeed.
1. Tweaked `test-runner` to use the QEMU and Tock kernel built by `make setup-qemu` and `make kernel-hifive`.
1. Added `test-qemu-hifive` to run `libtock_test` on an emulated hifive.
1. Added `test-qemu-hifive` as a dependency of `test` so that `make test` runs both sets of tests
1. Replaced `make examples` with a dependency on the examples, so that running parallel make jobs works correctly.
Co-authored-by: Johnathan Van Why <jrvanwhy@google.com>
diff --git a/doc/Dependencies.md b/doc/Dependencies.md
new file mode 100644
index 0000000..f157049
--- /dev/null
+++ b/doc/Dependencies.md
@@ -0,0 +1,29 @@
+Third Party Dependencies
+========================
+
+This document is about dependencies that are required to build applications
+using `libtock-rs`. These dependencies are not contained in the libtock-rs
+repository, but are used by libtock-rs when libtock-rs is used as a dependency
+of an application. Dependencies required to run `libtock-rs`' tests (such as
+`make`) are outside the scope of this document.
+
+## Unaudited Required Dependencies
+
+`libtock-rs` has the following required build dependencies, none of which are
+currently audited:
+
+* The Rust toolchain, including
+ [`cargo`](https://github.com/rust-lang/cargo),
+ [`rustc`](https://github.com/rust-lang/rust/tree/master/src/rustc), and
+ [`libcore`](https://github.com/rust-lang/rust/tree/master/src/libcore). The
+ specific toolchain version used is specified by the `rust-toolchain` file at
+ the root of the repository.
+* [`syn`](https://crates.io/crates/syn), pulled in by `libtock_codegen`.
+* [`quote`](https://crates.io/crates/quote), pulled in by `libtock_codegen`.
+* [`proc-macro2`](https://crates.io/crates/proc-macro2), pulled in by
+ `libtock_codegen`.
+
+## Avoiding Optional Dependencies
+
+To avoid pulling in optional dependencies, users should use `libtock-core`
+instead of `libtock`. `libtock-core` is in the `core/` directory.
diff --git a/tools/flash.sh b/tools/flash.sh
index f24127e..ea75dee 100755
--- a/tools/flash.sh
+++ b/tools/flash.sh
@@ -3,7 +3,7 @@
set -eux
artifact="$(basename $1)"
-rust_target_folder="$(readlink -f $(dirname $1)/../..)"
+rust_target_folder="$(cd $(dirname $1)/../.. && pwd -P)"
if [ -z $APP_HEAP_SIZE ]; then
echo "Set APP_HEAP_SIZE to a value"
exit 1