xref: /third_party/unity/extras/bdd/src/unity_bdd.h (revision 35375f98)
135375f98Sopenharmony_ci/* Copyright (c) 2023 Michael Gene Brockus (Dreamer) and Contributed to Unity Project
235375f98Sopenharmony_ci * ==========================================
335375f98Sopenharmony_ci *  Unity Project - A Test Framework for C
435375f98Sopenharmony_ci *  Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
535375f98Sopenharmony_ci *  [Released under MIT License. Please refer to license.txt for details]
635375f98Sopenharmony_ci * ========================================== */
735375f98Sopenharmony_ci
835375f98Sopenharmony_ci#ifndef UNITY_BDD_TEST_H_
935375f98Sopenharmony_ci#define UNITY_BDD_TEST_H_
1035375f98Sopenharmony_ci
1135375f98Sopenharmony_ci#ifdef __cplusplus
1235375f98Sopenharmony_ciextern "C"
1335375f98Sopenharmony_ci{
1435375f98Sopenharmony_ci#endif
1535375f98Sopenharmony_ci
1635375f98Sopenharmony_ci#include <stdio.h>
1735375f98Sopenharmony_ci
1835375f98Sopenharmony_ci/**
1935375f98Sopenharmony_ci * @brief Macros for defining a Behavior-Driven Development (BDD) structure with descriptions.
2035375f98Sopenharmony_ci *
2135375f98Sopenharmony_ci * These macros provide a way to structure and describe different phases (Given, When, Then) of a
2235375f98Sopenharmony_ci * test scenario in a BDD-style format. However, they don't have functional behavior by themselves
2335375f98Sopenharmony_ci * and are used for descriptive purposes.
2435375f98Sopenharmony_ci */
2535375f98Sopenharmony_ci#define GIVEN(description) \
2635375f98Sopenharmony_ci    if (0) { \
2735375f98Sopenharmony_ci        printf("Given %s\n", description); \
2835375f98Sopenharmony_ci    } else
2935375f98Sopenharmony_ci
3035375f98Sopenharmony_ci#define WHEN(description) \
3135375f98Sopenharmony_ci    if (0) { \
3235375f98Sopenharmony_ci        printf("When %s\n", description); \
3335375f98Sopenharmony_ci    } else
3435375f98Sopenharmony_ci
3535375f98Sopenharmony_ci#define THEN(description) \
3635375f98Sopenharmony_ci    if (0) { \
3735375f98Sopenharmony_ci        printf("Then %s\n", description); \
3835375f98Sopenharmony_ci    } else
3935375f98Sopenharmony_ci
4035375f98Sopenharmony_ci#ifdef __cplusplus
4135375f98Sopenharmony_ci}
4235375f98Sopenharmony_ci#endif
4335375f98Sopenharmony_ci
4435375f98Sopenharmony_ci#endif
45