hsmtool/util/mod.rs
1// Copyright lowRISC contributors (OpenTitan project).
2// Licensed under the Apache License, Version 2.0, see LICENSE for details.
3// SPDX-License-Identifier: Apache-2.0
4
5pub mod attribute;
6pub mod ef;
7pub mod escape;
8pub mod helper;
9pub mod key;
10pub mod signing;
11
12/// The `testdata` function can be used in tests to reference testdata directories.
13#[cfg(test)]
14pub fn testdata(test: &str) -> std::path::PathBuf {
15 let mut path: std::path::PathBuf = std::env::var_os("TESTDATA").unwrap().into();
16 // TESTDATA points an arbitrary test, remove two levels to get the directory.
17 path.pop();
18 path.pop();
19 path.push(test);
20 path
21}