cancel
Showing results for 
Search instead for 
Did you mean: 

Unity Test Framework Usage

fyazı.1
Associate II

Hi,

I wanna use Unity test framework so i cloned from github Unity files. And added my STM32CubeIDE project. And write a simple code for test but i failed when i try build project.

Is there anyone know how can i implement unity and use this framework?

I get this errors when i trry build project >> undefined reference to 'UnityBegin' , undefined reference to 'UnityEnd' ...

I added screenshot of my project.

/* USER CODE BEGIN Includes */

#include "../../Unity/src/unity.h"

#include "../../Unity/src/unity_internals.h"

/* USER CODE END Includes */

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();

}

Best Regardsi

1 REPLY 1
fyazı.1
Associate II

0693W000001qY1pQAE.png