Questions tagged [cunit]

Anything related to CUnit, a unit testing framework for C programs.

Anything related to CUnit, a unit testing framework for C programs.

80 questions
3
votes
1 answer

How to run cunit test in Eclipse?

i want to run cunit test in my project and develop it use Eclipse, how to integrate the cunit to Eclipse, write and run the case. I have no idea about it, who can help me?
David
  • 899
  • 2
  • 10
  • 13
3
votes
3 answers

How to pop / clean Lua call stack from C

I want to pop / clean the Lua call stack while within a C function called from Lua. Is this possible? Background: I want my C library and its extension scripts to use the same test framework. (I am aware various unit testing tools exist for Lua. I…
gibbss
  • 2,013
  • 1
  • 15
  • 22
3
votes
2 answers

Setting Up Google Test to Run through C/C++ Test Runner Plug-In in Eclipse on Ubuntu 12.04

Here's what I've tried: In project properties I have included libgtest_main.a and libgtest.a under the libaries tab. In run configurations under the C++ Unit tab, I have set C/C++ testing to Google Tests Runner. In run configs, under the main tab,…
Kevin Lee
  • 1,370
  • 14
  • 22
3
votes
2 answers

Autogeneration of tests and stubs with CUnit

Does anybody know of a free/commercial tool that would automatically generate tests and stubs for C code to work with CUnit framework?
Srinath
  • 1,215
  • 2
  • 9
  • 9
2
votes
1 answer

How to configure Gitlab CI to parse test output?

I am working on Gitlab and I would like to set up a CI (it is the first time I configure something like that, please assume that I am a beginner) I wrote a code in C with a simple test in Cunit, I configured CI with a "build" job and a "test" job.…
2
votes
2 answers

Should I unit test expected assertions?

I'm doing some unit testing for C in CUnit. I have some pre-conditions for an insert function that states that some buffert parameters shouldn't exceed a certain buffer size. In the insert function I have made some asserts to defend against this.…
Joel Wiklund
  • 1,697
  • 2
  • 18
  • 24
2
votes
1 answer

CUnit : undefined reference to `CU_assertImplementation'

compiled it using : cc -o test testtest.c -lcunit , but still cant run the tests properly. they crash for some reason :) I'm working on a project and i have recently convinced myself that i should continue in an testdriven approach. Mainly because…
macbug
  • 121
  • 1
  • 7
2
votes
1 answer

Integrate Cunit ino team city

How could I integrate cunit to team city? I want to see result on team city correctly? I found this Can I use that for my purpose?
Aryan
  • 2,675
  • 5
  • 24
  • 33
2
votes
3 answers

CUnit Tests getting Build Error

Its my first time testing C programs. I have this header file which I would like to test: #ifndef CALCULATOR_HELPER_H #define CALCULATOR_HELPER_H #endif int add(int num1, int num2) { return num1 + num2; } I am using the framework…
Goaler444
  • 2,591
  • 6
  • 35
  • 53
2
votes
1 answer

cUnit tests running on hudson

i'm looking for some plugin in hudson that runs unit tests, i get two names post build task, and CMake build, but by description anyone was created to run unit tests, them i want some indication about tools that help me to achieve this, or some…
guisantogui
  • 4,017
  • 9
  • 49
  • 93
2
votes
1 answer

Memory allocation test in C - How to write a CUnit-Test for malloc and free?

since a few days I am stuck with a Test for one of my applications that i can't fix. So i decide to write a test for my test... I want to allocate memeory, watch the grown of the memory in use and than free the memory again. I excpect that the…
Peter Shaw
  • 1,867
  • 1
  • 19
  • 32
1
vote
1 answer

Installing CUnit on RHEL CUnit/CUnit.h: No such file or directory

I'm trying to set up CUnit for use on Red Hat Enterprise Linux. This is my test file in c: #include int main() { return 0; } At first, I was getting an error when using gcc cunit-test.c -lcunit: /usr/bin/ld: cannot find…
grevans
  • 11
  • 2
1
vote
0 answers

CUnit testing void functions

Hi Im new to Cunit tests and testing in general. I cant find a way to test this void functon. Wondering how to properly do it or how to refactor it. Any tips on how to properly test void functions? Thanks. void validate_arg(int argc, char *argv[],…
LIsa
  • 133
  • 8
1
vote
1 answer

Homebrew Mac M1 can't find installs

I just switched to a M1 MacBook Air and I'm having trouble with Homebrew. The installation went fine I think, and then I added it to my path with the given commands: Run these two commands in your terminal to add Homebrew to your PATH: echo…
nattap
  • 11
  • 1
  • 2
1
vote
1 answer

How do I test custom error messages with the help of CUnit?

Hello everyone I am new to Cunit.My question is below the code so you may skip it if you want to. I made a small function that adds two positive integers and returns the result and if any of the integers is less than or equal to zero then it writes…
Prithvi singh
  • 75
  • 1
  • 6