summaryrefslogtreecommitdiff
path: root/fw/midi-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_group.h
diff options
context:
space:
mode:
authorjaseg <git@jaseg.net>2020-10-14 12:49:08 +0200
committerjaseg <git@jaseg.net>2020-10-14 12:49:08 +0200
commit3559d845d29272050d4d44e18e0bb84e676e48ff (patch)
treed8d6ce99e40b1a3745d76f0c9aac2f10e7286481 /fw/midi-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_group.h
parent491b2acaaa9db1798445f3e174e68ada7424fc33 (diff)
parent6ab94e0b318884bbcb95e2ea3835f951502e1d99 (diff)
downloadminikbd-3559d845d29272050d4d44e18e0bb84e676e48ff.tar.gz
minikbd-3559d845d29272050d4d44e18e0bb84e676e48ff.tar.bz2
minikbd-3559d845d29272050d4d44e18e0bb84e676e48ff.zip
Merge firmware and pcb repos
Diffstat (limited to 'fw/midi-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_group.h')
-rw-r--r--fw/midi-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_group.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/fw/midi-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_group.h b/fw/midi-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_group.h
new file mode 100644
index 0000000..3b37ae4
--- /dev/null
+++ b/fw/midi-dials/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_group.h
@@ -0,0 +1,66 @@
+#ifndef _JTEST_GROUP_H_
+#define _JTEST_GROUP_H_
+
+/*--------------------------------------------------------------------------------*/
+/* Includes */
+/*--------------------------------------------------------------------------------*/
+
+#include "jtest_pf.h"
+#include "jtest_util.h"
+
+/*--------------------------------------------------------------------------------*/
+/* Type Definitions */
+/*--------------------------------------------------------------------------------*/
+
+/**
+ * A struct which represents a group of #JTEST_TEST_t structs. This struct is
+ * used to run the group of tests, and report on their outcomes.
+ */
+typedef struct JTEST_GROUP_struct
+{
+ void (* group_fn_ptr) (void); /**< Pointer to the test group */
+ char * name_str; /**< Name of the group */
+
+ /* Extend the #JTEST_GROUP_t with Pass/Fail information.*/
+ JTEST_PF_MEMBERS;
+} JTEST_GROUP_t;
+
+/*--------------------------------------------------------------------------------*/
+/* Macros and Defines */
+/*--------------------------------------------------------------------------------*/
+
+/**
+ * Set the name of JTEST_GROUP_t.
+ */
+#define JTEST_GROUP_SET_NAME(group_ptr, name) \
+ JTEST_SET_STRUCT_ATTRIBUTE(group_ptr, name_str, name)
+
+#define JTEST_GROUP_SET_FN(group_ptr, fn_ptr) \
+ JTEST_SET_STRUCT_ATTRIBUTE(group_ptr, group_fn_ptr, fn_ptr)
+
+/**
+ * Increment the number of tests passed in the JTEST_GROUP_t pointed to by
+ * group_ptr.
+ */
+#define JTEST_GROUP_INC_PASSED(group_ptr, amount) \
+ JTEST_PF_INC_PASSED(group_ptr, amount)
+
+/**
+ * Increment the number of tests failed in the JTEST_GROUP_t pointed to by
+ * group_ptr.
+ */
+#define JTEST_GROUP_INC_FAILED(group_ptr, amount) \
+ JTEST_PF_INC_FAILED(group_ptr, amount)
+
+/**
+ * Reset the pass/fail information of the #JTEST_GROUP_t pointed to by
+ * group_ptr.
+ */
+#define JTEST_GROUP_RESET_PF(group_ptr) \
+ do \
+ { \
+ JTEST_PF_RESET_PASSED(group_ptr); \
+ JTEST_PF_RESET_FAILED(group_ptr); \
+ } while (0)
+
+#endif /* _JTEST_GROUP_H_ */