diff options
author | Chih-Hung Hsieh <chh@google.com> | 2019-11-02 16:35:14 -0700 |
---|---|---|
committer | Chih-Hung Hsieh <chh@google.com> | 2019-11-13 10:06:04 -0800 |
commit | 7a8a8536f66e2a14e4619df25f07946a0b12ca3d (patch) | |
tree | 2d59cd45cb16dfffdd63f21fb9050ac2b77d4d2e | |
parent | de06c35609ab44e1d3073061cc06f4f8ea3aac4f (diff) | |
download | adhd-7a8a8536f66e2a14e4619df25f07946a0b12ca3d.tar.gz |
Add rust_test modules.
* The Cargo.toml files need to be fixed first,
then the Android.bp files were generated by
cargo2android.py --tests --run
* Fixes to Cargo.toml files are:
* correcting file path to crosvm
* appending an empty '[workspace]' section
* Comment out auto_gen_config and test_suites properties
because their support in build/soong is not merged yet.
Bug: 140938178
Test: mm in rust projects, check output test file names
Change-Id: I833ce59aafdd2b5cc2506385640ef16c918db596
-rw-r--r-- | audio_streams/Android.bp | 16 | ||||
-rw-r--r-- | cras/client/cras-sys/Android.bp | 23 | ||||
-rw-r--r-- | cras/client/libcras/Android.bp | 25 |
3 files changed, 57 insertions, 7 deletions
diff --git a/audio_streams/Android.bp b/audio_streams/Android.bp index 3e78e566..53143245 100644 --- a/audio_streams/Android.bp +++ b/audio_streams/Android.bp @@ -1,7 +1,19 @@ +// This file is generated by cargo2android.py. + +rust_test_host { + name: "audio_streams_tests_audio_streams", + crate_name: "audio_streams", + srcs: ["src/audio_streams.rs"], + relative_install_path: "audio_streams_tests", + // auto_gen_config is waiting for build/soong changes. + // test_suites: ["general-tests"], + // auto_gen_config: true, + edition: "2018", +} + rust_library_host_rlib { name: "libaudio_streams", - deny_warnings: false, crate_name: "audio_streams", - edition: "2018", srcs: ["src/audio_streams.rs"], + edition: "2018", } diff --git a/cras/client/cras-sys/Android.bp b/cras/client/cras-sys/Android.bp index 0e061b1b..666311c7 100644 --- a/cras/client/cras-sys/Android.bp +++ b/cras/client/cras-sys/Android.bp @@ -1,8 +1,25 @@ +// This file is generated by cargo2android.py. + +rust_test_host { + name: "cras-sys_tests_cras_sys", + crate_name: "cras_sys", + srcs: ["src/lib.rs"], + relative_install_path: "cras-sys_tests", + // auto_gen_config is waiting for build/soong changes. + // test_suites: ["general-tests"], + // auto_gen_config: true, + edition: "2015", + rlibs: [ + "libdata_model", + ], +} + rust_library_host_rlib { name: "libcras_sys", - deny_warnings: false, crate_name: "cras_sys", - edition: "2015", - rlibs: ["libdata_model"], srcs: ["src/lib.rs"], + edition: "2015", + rlibs: [ + "libdata_model", + ], } diff --git a/cras/client/libcras/Android.bp b/cras/client/libcras/Android.bp index 3c0b3ede..ba0f37bc 100644 --- a/cras/client/libcras/Android.bp +++ b/cras/client/libcras/Android.bp @@ -1,14 +1,35 @@ +// This file is generated by cargo2android.py. + +rust_test_host { + name: "libcras_tests_libcras", + deny_warnings: false, + crate_name: "libcras", + srcs: ["src/libcras.rs"], + relative_install_path: "libcras_tests", + // auto_gen_config is waiting for build/soong changes. + // test_suites: ["general-tests"], + // auto_gen_config: true, + edition: "2018", + rlibs: [ + "libaudio_streams", + "libcras_sys", + "libdata_model", + "liblibc", + "libsys_util", + ], +} + rust_library_host_rlib { name: "liblibcras", deny_warnings: false, crate_name: "libcras", - edition: "2018", srcs: ["src/libcras.rs"], + edition: "2018", rlibs: [ - "liblibc", "libaudio_streams", "libcras_sys", "libdata_model", + "liblibc", "libsys_util", ], } |