# Using #\[test\] on #!\[no\_std\] target without #!\[feature(start)\] - RTL8195

**URL:** <https://users.rust-lang.org/t/using-test-on-no-std-target-without-feature-start-rtl8195/25401>\
**Category:** embedded\
**Created:** [February 18, 2019, 4:53pm UTC](https://users.rust-lang.org/t/using-test-on-no-std-target-without-feature-start-rtl8195/25401 "2019-02-18T16:53:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![andyi](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@andyi](https://users.rust-lang.org/u/andyi)\
**Post date:** [February 18, 2019, 4:53pm UTC](https://users.rust-lang.org/t/using-test-on-no-std-target-without-feature-start-rtl8195/25401/1 "2019-02-18T16:53:12Z")

</div>

Hey guys,

i'm currently trying to get the built-in test framework running on my no\_std target (Realtek RTL8195AM - Cortex-M3). The whole thing is based on a slightly modified version of [https://github.com/lupyuen/rustl8710](https://github.com/lupyuen/rustl8710).

My setup usually looks like this: I compile the whole rust code to a static library and provide a `#[no_mangle] pub extern "C" fn main_entry()` function there, which serves as an "entry point", that is called from my C code, which contains main() and where all the startup magic happens.

When trying out the `cargo test` build (with utest from japaric), I just tried to remove main() from the C code, but the main() provided by the test framework seems to not be found by the linker and a main() provided by SDK, which is shipped with the board, is being used.

I am a bit sceptical if this will work at all. As far as I understood, the main function is overwritten by the test framework, `#[no_mangle]` is NOT applied, so the function cannot be called from the C side.

Is there any way to get the test framework running on my target with this setup?

PS: I am aware that the simpler option would be to simply run the tests on the host. This is just a proof of concept.

Many greetings  
Andy

---

<div class="post-metadata">

**Author:** ![steffahn](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/steffahn/32/47569_2.png) [@steffahn](https://users.rust-lang.org/u/steffahn)\
**Post date:** [January 12, 2023, 8:56am UTC](https://users.rust-lang.org/t/using-test-on-no-std-target-without-feature-start-rtl8195/25401/2 "2023-01-12T08:56:00Z")

</div>

Closed on January 12, 2023, 8:56am UTC


