Added first implementation

This commit is contained in:
dario
2024-01-07 00:41:32 +01:00
parent b41426feaf
commit 5681411c65
13 changed files with 418 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
#ifndef STA_TASTY_UTILS_HPP
#define STA_TASTY_UTILS_HPP
#include <sta/config.hpp>
#ifdef STA_DEBUGGING_ENABLED
#include <cstdint>
namespace sta
{
namespace tasty
{
/**
* @brief Print a test result via serial.
*
* @param file The file the test case was in.
* @param line The line of the test case.
* @param rslt The result of the test case.
*/
void test_case(const char * file, uint32_t line, bool rslt);
} // namespace tasty
} // namespace sta
/**
* @brief Assert statement for automatic testing using tasty. Sends the test result to the host via serial.
*
*/
#define STA_TASTY_ASSERT(expr) ( (void)( sta::tasty::test_case(__FILE__, __LINE__, expr) ) )
#endif // STA_DEBUGGING_ENABLED
#endif // STA_TASTY_UTILS_HPP