From 267f2c80d1144e2eb7da1aca51c9c75eac186c77 Mon Sep 17 00:00:00 2001 From: Zach Reizner Date: Wed, 31 Jul 2019 17:07:27 -0700 Subject: 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 Reviewed-by: Daniel Verkamp Tested-by: Zach Reizner Tested-by: kokoro Commit-Queue: Zach Reizner --- Cargo.toml | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Cargo.toml') 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 -- cgit 1.4.1