summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChih-Yu Huang <akahuang@google.com>2022-07-26 18:23:04 +0900
committerChih-Yu Huang <akahuang@google.com>2022-07-26 18:28:50 +0900
commit0b73f72a91e9b84627e11edf7682c8bd13fa2f67 (patch)
tree826e7bb923f76a74cb8a55b3ca9218dacc54d784
parent2a0524b31c7ceb308c7b853bd56864727b0ba11a (diff)
downloaduwb-0b73f72a91e9b84627e11edf7682c8bd13fa2f67.tar.gz
uwb_core: add a debugging section at README.md
This CL adds a section at README.md that describes how to enable the logging when debugging a certain test case. Bug: 233319010 Test: none Change-Id: I88911c9eaaaa010d6294a925dc8f64bfaccbd617
-rw-r--r--src/rust/uwb_core/README.md20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/rust/uwb_core/README.md b/src/rust/uwb_core/README.md
index c0f3b09..ea22064 100644
--- a/src/rust/uwb_core/README.md
+++ b/src/rust/uwb_core/README.md
@@ -3,9 +3,23 @@
Although this library are built by Android build system officially, we can also
build and test the library by cargo.
-## Building `packets` package
-This package depends on `bluetooth_packetgen` and thus simply using
-`cargo build` will fail. Follow the steps below before using cargo.
+## Building `uwb_uci_packets` package
+
+The `uwb_uci_packets` package depends on `bluetooth_packetgen` and thus simply
+using `cargo build` will fail. Follow the steps below before using cargo.
1. Enter Android environment by `source build/make/rbesetup.sh; lunch <target>`
2. Run `m -j32 bluetooth_packetgen` to compile `bluetooth_packetgen` c++ binary.
+
+After that, we could build or test the package by cargo.
+
+## Enable logging for a certain test case of uwb\_core library
+
+When debugging a certain test case, we could enable the logging and run the
+single test case.
+
+1. Add `crate::utils::init_test_logging();` at the beginning of the test case
+2. Run the single test case by:
+```
+RUST_LOG=debug cargo test -p uwb_core <test_case_name> -- --nocapture
+```