Tasty/include/sta/tasty/utils.hpp
2024-01-07 00:41:32 +01:00

34 lines
814 B
C++

#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