From 955809048c3a7fbe04481abbfd9d0deeee2b7784 Mon Sep 17 00:00:00 2001 From: "Michael Gene Brockus (Dreamer)" <55331536+dreamer-coding-555@users.noreply.github.com> Date: Fri, 15 Sep 2023 09:53:34 -0600 Subject: [PATCH] Create bdd.h --- extras/bdd/src/bdd.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 extras/bdd/src/bdd.h diff --git a/extras/bdd/src/bdd.h b/extras/bdd/src/bdd.h new file mode 100644 index 0000000..35f177d --- /dev/null +++ b/extras/bdd/src/bdd.h @@ -0,0 +1,42 @@ +/* Copyright (c) 2023 Michael Gene Brockus (Dreamer) and Contributed to Unity Project + * ========================================== + * Unity Project - A Test Framework for C + * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams + * [Released under MIT License. Please refer to license.txt for details] + * ========================================== */ + +#ifndef UNITY_BDD_TEST_H_ +#define UNITY_BDD_TEST_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @brief Macros for defining a Behavior-Driven Development (BDD) structure with descriptions. + * + * These macros provide a way to structure and describe different phases (Given, When, Then) of a + * test scenario in a BDD-style format. However, they don't have functional behavior by themselves + * and are used for descriptive purposes. + */ +#define GIVEN(description) \ + if (0) { \ + printf("Given %s\n", description); \ + } else + +#define WHEN(description) \ + if (0) { \ + printf("When %s\n", description); \ + } else + +#define THEN(description) \ + if (0) { \ + printf("Then %s\n", description); \ + } else + +#ifdef __cplusplus +} +#endif + +#endif