Skip to main content
fyazı.1
Associate
June 11, 2020
Question

Unity Test Framework Usage

  • June 11, 2020
  • 1 reply
  • 1343 views

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

    This topic has been closed for replies.

    1 reply

    fyazı.1
    fyazı.1Author
    Associate
    June 11, 2020

    0693W000001qY1pQAE.png