ThrowTheSwitch / Ceedling

Ruby-based unit testing and build system for C projects

Home Page:http://throwtheswitch.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to read/catch stdout (shell)

kafkaaaa opened this issue Β· comments

Good Morning ! 😊
I'm enjoying Ceedling and appreciate it. I am also looking forward to the new version.

My question is ...
Is there any specific method or hack supported to utilize stdout or shell results during testing?

Let me give you one example..

Suppose a tester wants to determine the endianness of the system.

You can use the following shell command:

perl -e 'print pack("L", 1) eq pack("N", 1) ? "Big endian\n" : "Little endian\n";'

How can this result be utilized?

I would greatly appreciate your response.


$ ceedling version
   Ceedling:: 0.31.1
      Unity:: 2.5.4
      CMock:: 2.5.4
 CException:: 1.3.3

I use system( ) and redirect to file and read it.

Strangely, when I post a question, an idea comes to mind.