commit 4c72a54cb0b2745713595adaecfc1bad548c03e0
Author: Thomas Schöpping <tschoepp@cit-ec.uni-bielefeld.de>
Date:   Mon Jul 15 13:21:06 2019 +0200

    Massive overhaul:
    - updated to a new version of AMiRo-LLD
    - tests (formerly unit tests) are now split onto multiple parts:
      - there are "global" tests for each driver etc.
      - there is an individual part for each module, e.g. if there are multiple instances of the same periphery
    - a lot of minor enhancements

diff --git a/modules/LightRing_1-0/module.c b/modules/LightRing_1-0/module.c
index 553c8ea..867d225 100644
--- a/modules/LightRing_1-0/module.c
+++ b/modules/LightRing_1-0/module.c
@@ -78,6 +78,8 @@ SPIConfig moduleHalSpiWlConfig = {
   /* CR2                         */ SPI_CR2_RXDMAEN | SPI_CR2_TXDMAEN,
 };
 
+/** @} */
+
 /*===========================================================================*/
 /**
  * @name GPIO definitions
@@ -271,81 +273,74 @@ TPS20xxBDriver moduleLldPowerSwitchLaser = {
 
 /*===========================================================================*/
 /**
- * @name Unit tests (UT)
+ * @name Tests
  * @{
  */
 /*===========================================================================*/
 #if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
 
 /*
- * EEPROM (AT24C01B)
+ * AT24C01BN-SH-B (EEPROM)
  */
-static int _utShellCmdCb_AlldAt24c01b(BaseSequentialStream* stream, int argc, char* argv[])
+#include <module_test_AT24C01B.h>
+static int _testAt24co1bShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
 {
-  (void)argc;
-  (void)argv;
-  aosUtRun(stream, &moduleUtAlldAt24c01b, NULL);
-  return AOS_OK;
+  return moduleTestAt24c01bShellCb(stream, argc, argv, NULL);
 }
-static ut_at24c01bdata_t _utAlldAt24c01bData = {
-  /* driver   */ &moduleLldEeprom,
-  /* timeout  */ MICROSECONDS_PER_SECOND,
-};
-aos_unittest_t moduleUtAlldAt24c01b = {
-  /* name           */ "AT24C01B",
-  /* info           */ "1kbit EEPROM",
-  /* test function  */ utAlldAt24c01bFunc,
-  /* shell command  */ {
-    /* name     */ "unittest:EEPROM",
-    /* callback */ _utShellCmdCb_AlldAt24c01b,
-    /* next     */ NULL,
-  },
-  /* data           */ &_utAlldAt24c01bData,
-};
+AOS_SHELL_COMMAND(moduleTestAt24c01bShellCmd, "test:EEPROM", _testAt24co1bShellCmdCb);
 
 /*
- * LED PWM driver (TLC5947)
+ * TLC5947 (24 channel PWM LED driver)
  */
-static int _utShellCmdCb_Tlc5947(BaseSequentialStream* stream, int argc, char* argv[])
+#include <module_test_TLC5947.h>
+static int _testTlc5947ShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
 {
-  (void)argc;
-  (void)argv;
-  aosUtRun(stream, &moduleUtAlldTlc5947, NULL);
-  return AOS_OK;
+  return moduleTestTlc5947ShellCb(stream, argc, argv, NULL);
 }
-aos_unittest_t moduleUtAlldTlc5947 = {
-  /* info           */ "TLC5947",
-  /* name           */ "LED PWM driver",
-  /* test function  */ utAlldTlc5947Func,
-  /* shell command  */ {
-    /* name     */ "unittest:Lights",
-    /* callback */ _utShellCmdCb_Tlc5947,
-    /* next     */ NULL,
-  },
-  /* data           */ &moduleLldLedPwm,
-};
+AOS_SHELL_COMMAND(moduleTestTlc5947ShellCmd, "test:Lights", _testTlc5947ShellCmdCb);
+
+/*
+ * TPS2051BDBV (Current-limited power switch)
+ */
+#include <module_test_TPS20xxB.h>
+static int _testTps2051bdbvShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
+{
+  return moduleTestTps20xxbShellCb(stream, argc, argv, NULL);
+}
+AOS_SHELL_COMMAND(moduleTestTps2051bdbvShellCmd, "test:PowerSwitch", _testTps2051bdbvShellCmdCb);
 
 /*
- * power switch (TPS2051BDBV)
+ * entire module
  */
-static int _utShellCmdCb_Tps2051bdbv(BaseSequentialStream* stream, int argc, char* argv[])
+static int _testAllShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
 {
   (void)argc;
   (void)argv;
-  aosUtRun(stream,&moduleUtAlldTps2051bdbv, NULL);
-  return AOS_OK;
+
+  int status = AOS_OK;
+  char* targv[AMIROOS_CFG_SHELL_MAXARGS] = {NULL};
+  aos_testresult_t result_test = {0, 0};
+  aos_testresult_t result_total = {0, 0};
+
+  /* AT24C01B (EEPROM) */
+  status |= moduleTestAt24c01bShellCb(stream, 0, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+
+  /* TLC5947 (24 channel LED PWM driver) */
+  status |= moduleTestTlc5947ShellCb(stream, 0, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+
+  /* TPS2051BDBV (Current-limited power switch) */
+  status |= moduleTestTps20xxbShellCb(stream, 0, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+
+  // print total result
+  chprintf(stream, "\n");
+  aosTestResultPrintSummary(stream, &result_total, "entire module");
+
+  return status;
 }
-aos_unittest_t moduleUtAlldTps2051bdbv = {
-  /* info           */ "TPS2051BDBV",
-  /* name           */ "current-limited power switch",
-  /* test function  */ utAlldTps20xxbFunc,
-  /* shell command  */ {
-    /* name     */ "unittest:PowerSwitch",
-    /* callback */ _utShellCmdCb_Tps2051bdbv,
-    /* next     */ NULL,
-  },
-  /* data           */ &moduleLldPowerSwitchLaser,
-};
+AOS_SHELL_COMMAND(moduleTestAllShellCmd, "test:all", _testAllShellCmdCb);
 
 #endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 
