sgx_tunittest 1.1.1

Rust SGX SDK provides the ability to write Intel SGX applications in Rust Programming Language. failed to build sgx_tunittest-1.1.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure builds.
If you believe this is' fault, open an issue.
Visit the last successful build: sgx_tunittest-1.0.8

sgx_tunittest is for performing unit tests in enclaves.

To use this crate, import the assertion macros defined in sgx_tstd and this crate like this at first:

extern crate sgx_tstd as std;
extern crate sgx_tunittest;

Similar to #[test] in Rust, unit test functions are required to take zero arguments and return nothing. One test is success only when the test function returns without panic.

Different from Rust, we don't use features like #[test], #[should_panic] for unit test function declaration. Instead, to declare a unit test function, one just need implement it as normal.

Here is a sample unit test function:

fn foo() {

To launch the unit test, one should use the macro rsgx_unit_test!. For example, assuming that we have three unit test functions: foo, bar and zoo. To start the test, just write as the following:

rsgx_unit_tests!(foo, bar, zoo);

sgx_tunittest supports fail test (something must panic). But it does not provide it in Rust style (#[should_panic]). One should use macro should_panic! to assert the statement that would panic. For example:

fn foo_panic() {
let v = vec![]
should_panic!(vec[0]); // vec[0] would panic

In this way, vec[0] would panic. But should_panic! catches it. Thus foo_panic would pass the unit test.