Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22233

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

$
0
0

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 ); //this one will pass    TEST_ASSERT( a == 2 ); //this one will fail    return UNITY_END();}

What I typed into terminal:

gcc TestDumbExample.c ./unity/src/unity.c -o Test

I am getting this error message in Terminal:

/tmp/ccqgFGn8.o: In function `UnityDefaultTestRun':unity.c:(.text+0x26af): undefined reference to `setUp'unity.c:(.text+0x26ca): undefined reference to `tearDown' collect2:error: ld returned 1 exit statusUnsure why this error is occurring and it has undefined references.

Viewing all articles
Browse latest Browse all 22233

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>