Skip to content

Commit 92cc874

Browse files
committed
Allow test execution
1 parent 3d248ac commit 92cc874

File tree

5 files changed

+22
-4
lines changed

5 files changed

+22
-4
lines changed

Diff for: tss-esapi-sys/build.rs

+14-4
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,18 @@ pub mod tpm2_tss {
131131
repo_path
132132
}
133133

134-
#[cfg(all(feature = "bundled",not(windows)))]
134+
#[cfg(all(feature = "bundled", not(windows)))]
135135
fn compile_with_autotools(p: PathBuf) -> PathBuf {
136136
let output1 = std::process::Command::new("./bootstrap")
137137
.current_dir(&p)
138138
.output()
139139
.expect("bootstrap script failed");
140140
let status = output1.status;
141141
if !status.success() {
142-
panic!("{:?}/bootstrap script failed with {}:\n{:?}", p, status, output1);
142+
panic!(
143+
"{:?}/bootstrap script failed with {}:\n{:?}",
144+
p, status, output1
145+
);
143146
}
144147

145148
let mut config = autotools::Config::new(p);
@@ -167,12 +170,16 @@ pub mod tpm2_tss {
167170
let source_path = if let Ok(tpm_tss_source) = std::env::var("TPM_TSS_SOURCE_PATH") {
168171
eprintln!("using local tpm2-tss from {}", tpm_tss_source);
169172
let Ok(source_path) = PathBuf::from(tpm_tss_source).canonicalize() else {
170-
panic!("Unable to canonicalize tpm2-tss source path. Does the source path exist?");
173+
panic!(
174+
"Unable to canonicalize tpm2-tss source path. Does the source path exist?"
175+
);
171176
};
172177

173178
source_path
174179
} else {
175-
eprintln!("using remote tpm2-tss from https://github.com/tpm2-software/tpm2-tss.git");
180+
eprintln!(
181+
"using remote tpm2-tss from https://github.com/tpm2-software/tpm2-tss.git"
182+
);
176183
Self::fetch_source(
177184
out_path,
178185
"tpm2-tss",
@@ -328,11 +335,14 @@ pub mod tpm2_tss {
328335
.clang_arg(tss2_tcti_tbs.include_dir_arg())
329336
.header(tss2_tcti_tbs.header_file_arg());
330337
}
338+
339+
#[cfg(feature = "bundled")]
331340
if let Some(clang_args) = Self::platform_args() {
332341
for arg in clang_args {
333342
builder = builder.clang_arg(arg);
334343
}
335344
}
345+
336346
builder
337347
}
338348
}

Diff for: tss-esapi/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ time using the headers identified on the system.
1717

1818
Our end-goal is to achieve a fully Rust-native interface that offers strong safety and security guarantees. Check out our [documentation](https://docs.rs/tss-esapi/*/tss_esapi/#notes-on-code-safety) for an overview of our code safety approach.
1919

20+
## Integration Tests
21+
22+
See the [integration tests](https://github.com/parallaxsecond/rust-tss-esapi/tree/main/tss-esapi/tests)
23+
2024
## Cargo Features
2125

2226
The crate currently offers the following features:

Diff for: tss-esapi/tests/integration_tests/common/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,14 @@ use tss_esapi::{
3434
};
3535

3636
mod marshall;
37+
#[cfg(feature = "serde")]
3738
mod serde;
3839
mod tpm2b_types_equality_checks;
3940
mod tpma_types_equality_checks;
4041
mod tpml_types_equality_checks;
4142
mod tpms_types_equality_checks;
4243
mod tpmt_types_equality_checks;
44+
#[cfg(feature = "serde")]
4345
pub use self::serde::*;
4446
pub use marshall::*;
4547
pub use tpm2b_types_equality_checks::*;

Diff for: tss-esapi/tests/integration_tests/structures_tests/buffers_tests/private.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ fn marshall_unmarshall() {
1212
}
1313

1414
#[test]
15+
#[cfg(feature = "serde")]
1516
fn serialise_deserialise() {
1617
crate::common::check_serialise_deserialise(&Private::default());
1718
let private = Private::try_from([0xff; 100].to_vec()).unwrap();

Diff for: tss-esapi/tests/integration_tests/structures_tests/tagged_tests/public.rs

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ fn marshall_unmarshall() {
1515
}
1616

1717
#[test]
18+
#[cfg(feature = "serde")]
1819
fn serialise_deserialise() {
1920
crate::common::publics()
2021
.iter()

0 commit comments

Comments
 (0)