These are chat archives for Snaipe/Criterion

2nd
Oct 2015
Kyle Manna
@kylemanna
Oct 02 2015 22:52
Anyone every built criterion as a static library?
There's a strange noop test that throws off all the compare tests:
[====] Running 1 test from :
[RUN ] ::
[PASS] ::: (0.00s)
All of the test comparisons are off on the last line since an extra test ran
Franklin Mathieu
@Snaipe
Oct 02 2015 22:57
Oh, it seems that the dummy test no longer gets ignored
There needs to be a dummy test to make sure that the test section is non-empty
currently, the test has no name and should be ignored, let me fix this
Kyle Manna
@kylemanna
Oct 02 2015 23:00
Oh cool
Franklin Mathieu
@Snaipe
Oct 02 2015 23:03
@kylemanna there, Snaipe/Criterion@1fbcecc should fix it
Kyle Manna
@kylemanna
Oct 02 2015 23:09
@Snaipe Fixed it. Now it runs statically compiled: 100% tests passed, 0 tests failed out of 83
Thanks!
Franklin Mathieu
@Snaipe
Oct 02 2015 23:10
np :)
Kyle Manna
@kylemanna
Oct 02 2015 23:10
I'm wondering if I can get criterion to run on a microcontroller?
Looks like I'll need to hack together some malloc stuff
Franklin Mathieu
@Snaipe
Oct 02 2015 23:11
There's nothing that should be stopping you, but if you have issues, let me know
Kyle Manna
@kylemanna
Oct 02 2015 23:11
Know of anyone doing such things?
it is reliant on POSIX stuff?
is it*
Franklin Mathieu
@Snaipe
Oct 02 2015 23:11
Well, you'd need at least fork()
and pipe()
Kyle Manna
@kylemanna
Oct 02 2015 23:12
have neither on bare metal
small RTOSes like chibios have threads and streams
that's good to know
Franklin Mathieu
@Snaipe
Oct 02 2015 23:13
well, the tests need to be contained in their own address space for proper testing, to guarantee that the runner can properly finish in anything happens inside the test
Kyle Manna
@kylemanna
Oct 02 2015 23:14
There is no MMU on these little chips
I would stream the results in/out the chip via UART and perhaps compare expected output like your internal test suite does
so if it crashes... well reprogram it externally
I'm unaware of a unit test framework that runs on Linux and in a restricted manner on small embedded devices
Franklin Mathieu
@Snaipe
Oct 02 2015 23:17
Unit testing framework that focus embedded testing sacrifice usability for portability
So yes, for very specific hardware tests, you'd be better of making a bridge from the test runner to the chip, or use a separate test suite for hardware tests
Kyle Manna
@kylemanna
Oct 02 2015 23:19
Yeah
Franklin Mathieu
@Snaipe
Oct 02 2015 23:19
Oh, maybe
I'm thinking, maybe I could implement some kind of client mode
Kyle Manna
@kylemanna
Oct 02 2015 23:20
cmocka.org is kind of interesting
Criterion has been on my list of toys to try out and looks awesome for C
Franklin Mathieu
@Snaipe
Oct 02 2015 23:20
make the test executable run one very specific test, and stream the results on some kind of server runner
Kyle Manna
@kylemanna
Oct 02 2015 23:20
just my latest project involves uCs
hmm
A subset of the full tests could double as POST as well
Franklin Mathieu
@Snaipe
Oct 02 2015 23:25
I'll open an issue to see what can be done about that. Feel free to tell any suggestions you have! It's users like you that makes the project even more awesome day after day :)
Kyle Manna
@kylemanna
Oct 02 2015 23:26
Will keep it in mind for sure!
Appreciate the quick help and thoughts
Franklin Mathieu
@Snaipe
Oct 02 2015 23:44
Issue opened: #69