Questions tagged [unity-test-framework]

Unity is a unit test framework written entirely in the C language. It is lightweight and possesses special features for embedded systems.

40 questions
8
votes
3 answers

Unity Framework Unit Testing undefined reference to "setUp" and "tearDown"

I copied the simplest code from the Unity for C Unit Testing library and set up a very basic test, which I copied and pasted from the site: #include "unity/src/unity.h" int main(void) { UNITY_BEGIN(); int a = 1; TEST_ASSERT( a == 1 );…
Sam Hall
  • 315
  • 2
  • 8
8
votes
3 answers

How to run bundle install as normal user

I am attempting to use bundle install. I am not a Ruby user - this is my first real foray into even running rake. I'm simply trying to user some packages from ThrowtheSwitch.org that use Rake and so on. I initially installed ruby several days ago…
Toby
  • 9,696
  • 16
  • 68
  • 132
5
votes
2 answers

How can I configure Ceedling for an IAR Embedded Workbench project?

I'm trying to develop a new feature for an embedded application and I'd like to do so using a test-driven approach. The project is written in pure C and is being developed using IAR Embedded Workbench 6.60.1.5104. I'm targeting an LPC1788, which is…
Tagc
  • 8,736
  • 7
  • 61
  • 114
4
votes
2 answers

How can I manually specify source files that Ceedling fails to pick up?

I'm developing a feature for an embedded application and I'm using Ceedling (which builds on top of the Unity test framework) to test it. An issue that I'm having is that I need to use functionality in C source files that Ceedling isn't…
Tagc
  • 8,736
  • 7
  • 61
  • 114
3
votes
0 answers

Can unity C unittest framework be used to unittest C++ code?

I'm using the unity framework to unittest my C code on an AtMega32A. This works great. now I wonder if I can somehow trick unity to also test my C++ code. I've made a small proof of concept program that exposes all the members of the C++ class via a…
Cedric
  • 89
  • 4
3
votes
2 answers

"make: *** No rule to make target" Using Unity Unit Testing

I ended up installing ceedling which uses ruby code to auto-generate test runs. Much better tool set for learning imo. I'm going to leave the question open in case anybody else has the same issue and someone else has the answer. Hi StackOverflow…
3
votes
1 answer

C Testing - undefined reference with Unity and CMake

I am currently trying to get a project setup with code coverage and testing that is in C. My current stack is CLion for an IDE, Clang for the compiler, gcov and lcov for coverage, Unity for a testing framework, and CMock for mocking/stubbing during…
isuPatches
  • 6,384
  • 2
  • 22
  • 30
2
votes
2 answers

How to use ThrowTheSwitch's Unity C unit testing library?

How to use ThrowTheSwitch's Unity C unit testing library? I'm trying to use ThrowTheSwitch's Unity library to create my unit test in C, but I got some strange errors, but I'm newbie, so this is maybe something basic. Here is My code: this is…
2
votes
0 answers

Syncing C state machine code with unit tests and doxygen/graphwiz diagrams

I'm writing medical software. In that end, I've come up with a workflow that allows me to show people with limited programming knowledge that the program I've made is the same as the program I was supposed to make. The workflow is the…
2
votes
1 answer

Linker error with Unity (C unit testing framework)

I've littered through Stackoverflow trying to get Unity unit test framework (https://www.throwtheswitch.org/unity) linked and built on CMAKE so that I can write unit tests but I keep hitting this same error: Undefined symbols for architecture…
Andre Marin
  • 540
  • 1
  • 6
  • 16
2
votes
0 answers

Debug C unit test with Unity

I am writing some unit test on unity (http://www.throwtheswitch.org/unity/), however I am not getting the expected results and the test is failing when asserting. Is there a way I can do printfs to do some debuggin on the mock callback…
maverick
  • 31
  • 4
2
votes
0 answers

No rule to make target but the rule exists

I wanted to write some Makefile for testing C code via Unity test framework. However when I want to test it I get the message make: *** No rule to make target 'unity_build/results/test_unity_dumb_example.unity_res', needed by 'unity_test'. Stop. .…
Al Bundy
  • 653
  • 1
  • 6
  • 22
2
votes
1 answer

Unity test on embedded systems to web output

I'm currently working on an embedded device which is able to run unit tests, thanks to the Unity framework. I send the output of these tests into my computer with a JLINK and SEGGER_RTT. Question is, how can i make a web report from unity output?…
thomas_exotic
  • 211
  • 1
  • 7
2
votes
1 answer

Unit test C with compiler specific keywords

I am writing unit tests for some embedded C, that run on a host machine (not testing on target yet) and compile with GCC. I have been using the Ceedling build system with the Unity testing framework to test. One of the files I would like to test…
Toby
  • 9,696
  • 16
  • 68
  • 132
2
votes
1 answer

How to test a function with internal state?

I am unit testing the following function, using Ceedling. bool PRM_inputVoltageIsGood(ParameterHandle_t p, float voltage) { static bool voltageGoodHyst = false; /* Check if voltage has risen above ON point. */ if ((!voltageGoodHyst) &&…
Toby
  • 9,696
  • 16
  • 68
  • 132
1
2 3