summary refs log tree commit diff
path: root/Cargo.toml
diff options
context:
space:
mode:
authorZach Reizner <zachr@google.com>2019-07-31 17:07:27 -0700
committerCommit Bot <commit-bot@chromium.org>2019-08-06 19:23:06 +0000
commit267f2c80d1144e2eb7da1aca51c9c75eac186c77 (patch)
tree25e6584d8fe36a7e928892e1dc5f9796916a0714 /Cargo.toml
parent1e26230f3a490a7955d2ea9fe7855af5498ced70 (diff)
downloadcrosvm-267f2c80d1144e2eb7da1aca51c9c75eac186c77.tar
crosvm-267f2c80d1144e2eb7da1aca51c9c75eac186c77.tar.gz
crosvm-267f2c80d1144e2eb7da1aca51c9c75eac186c77.tar.bz2
crosvm-267f2c80d1144e2eb7da1aca51c9c75eac186c77.tar.lz
crosvm-267f2c80d1144e2eb7da1aca51c9c75eac186c77.tar.xz
crosvm-267f2c80d1144e2eb7da1aca51c9c75eac186c77.tar.zst
crosvm-267f2c80d1144e2eb7da1aca51c9c75eac186c77.zip
split crosvm into a library and a main "crosvm" binary
This change has 3 parts:
- Modify the Cargo.toml to point at the bin and the lib source.
- Move modules and Config struct into the lib source
- Fix the argument/plugins module's doc comments which had never been
  tested.

The motivation for this change is to make testing crosvm's major
functionality (booting guest kernels, emulating hardware, etc) easier to
do from a cargo test. Being able to launce a crosvm config via the API
instead of the binary's command line will be possible with this change.

A side benefit is that this also enables doc tests in the lib side of
crosvm. The doc tests in binaries are not run due to a limitation in how
they get tested by cargo.

TEST=cargo test
     ./build_test
     kokoro/kokoro_simulator.sh
     emerge crosvm
BUG=None

Change-Id: I9d4b3a24231b895e8dfaf9e7b0f2b33350772041
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1730333
Reviewed-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Zach Reizner <zachr@chromium.org>
Diffstat (limited to 'Cargo.toml')
-rw-r--r--Cargo.toml7
1 files changed, 7 insertions, 0 deletions
diff --git a/Cargo.toml b/Cargo.toml
index eda21cf..d899031 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,6 +4,13 @@ version = "0.1.0"
 authors = ["The Chromium OS Authors"]
 edition = "2018"
 
+[lib]
+path = "src/crosvm.rs"
+
+[[bin]]
+name = "crosvm"
+path = "src/main.rs"
+
 [profile.release]
 panic = 'abort'
 overflow-checks = true