1 // Copyright 2023 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 use cmd_runner::run_cmd_shell;
16 use std::path;
17 
check_platform(root: &path::Path) -> anyhow::Result<()>18 pub(crate) fn check_platform(root: &path::Path) -> anyhow::Result<()> {
19     log::info!("Checking Platform");
20     let mut ffi_dir = root.to_path_buf();
21     ffi_dir.push("platform");
22 
23     run_cmd_shell(&ffi_dir, "cargo build --quiet --release --lib")?;
24     run_cmd_shell(&ffi_dir, "cargo test --quiet -- --color=always")?;
25     run_cmd_shell(&ffi_dir, "cargo doc --quiet --no-deps")?;
26     run_cmd_shell(&ffi_dir, "cargo deny check")?;
27 
28     Ok(())
29 }
30