Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

munit on an embedded system without files or filesystem #69

Open
9a3eedi opened this issue Jan 26, 2021 · 1 comment
Open

munit on an embedded system without files or filesystem #69

9a3eedi opened this issue Jan 26, 2021 · 1 comment

Comments

@9a3eedi
Copy link

9a3eedi commented Jan 26, 2021

Hi.

I've been looking for a unit test framework that I could use on my embedded ARM Cortex-M3 board, which runs FreeRTOS without a filesystem. munit looked like a good choice so I went ahead and wrote a bunch of tests. Unfortunately I wasn't able to run anything, because it wants to create a temporary file to redirect stderr with, but my platform is unable to work with files at all.

This is mainly my mistake, perhaps I should've evaluated munit better before choosing it for my testing needs, but before I rewrite my tests to use another test framework, is there any straightfoward way I can get munit to work on an embedded target that does not run a memory-protected OS like Linux and does not have a filesystem?

@9a3eedi
Copy link
Author

9a3eedi commented Jan 26, 2021

Upon closer inspection, I figured that I can simply redirect stderr_buf to my actual stderr (which is the behaviour I wanted). This fixed the issue I'm having. However, it's a quick hack, and I'm not really sure if this is considered acceptable to do. Ideally I would put some kind of define somewhere that allows me to not buffer stderr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant