apache / apache/teaclave-sgx-sdk

support cargo test

Open
#232 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.2k
Forks
268
PR merge metrics
No merged PRs in 30d

Description

Is there any chance we can make `cargo test` work with [our enclave code](https://github.com/scs/substraTEE-worker/tree/master/enclave)?

it would be great if we could use standard `cargo test`. Right now we can only do [handmade testing](https://github.com/scs/substraTEE-worker/blob/master/worker/src/tests/mod.rs) which is a lot less convenient to track

right now we get a clash between `std` and `sgx_tstd`:

```
Compiling substratee-worker-enclave v0.6.0 (/home/abrenzikofer/substraTEE-worker/enclave)
error: duplicate lang item in crate `std` (which `test` depends on): `f32_runtime`.
|
= note: the lang item is first defined in crate `sgx_tstd` (which `substratee_worker_enclave` depends on)

error: duplicate lang item in crate `std` (which `test` depends on): `f64_runtime`.
|
= note: the lang item is first defined in crate `sgx_tstd` (which `substratee_worker_enclave` depends on)

error: duplicate lang item in crate `std` (which `test` depends on): `panic_impl`.
|
= note: the lang item is first defined in crate `sgx_tstd` (which `substratee_worker_enclave` depends on)

error: duplicate lang item in crate `std` (which `test` depends on): `begin_panic`.
|
= note: the lang item is first defined in crate `sgx_tstd` (which `substratee_worker_enclave` depends on)

error: duplicate lang item in crate `std` (which `test` depends on): `oom`.
|
= note: the lang item is first defined in crate `sgx_tstd` (which `substratee_worker_enclave` depends on)

error: aborting due to 5 previous errors

error: could not compile `substratee-worker-enclave`.

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the enclave directory linked in the issue and compare its current setup with worker/src/tests/mod.rs, which contains the handmade tests. Run cargo test in the enclave and investigate the reported std and sgx_tstd duplicate lang-item errors. Done means the enclave tests run through standard cargo test without those conflicts.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.