libdts: Support non-static DTC
Fall back to 'dtc' when 'dtc_static' is not available e.g. when running
tests on the (ADB) host.
Test: - # ToT doesn't currently support host-side tests using libdts
Flag: EXEMPT tests
Change-Id: I648e91e363156093ab802b9b11b59de8d94a5b61
diff --git a/tests/libs/libdts/src/lib.rs b/tests/libs/libdts/src/lib.rs
index d6b90f7..273cae5 100644
--- a/tests/libs/libdts/src/lib.rs
+++ b/tests/libs/libdts/src/lib.rs
@@ -76,9 +76,12 @@
fn get_dtc() -> Option<Command> {
const DTC_STATIC: &str = "./dtc_static";
+ const DTC: &str = "./dtc";
if Path::new(DTC_STATIC).exists() {
Some(Command::new(DTC_STATIC))
+ } else if Path::new(DTC).exists() {
+ Some(Command::new(DTC))
} else {
None
}