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/NUCLEO-L476RG/module.c b/modules/NUCLEO-L476RG/module.c
index ab805f1..5500b4d 100644
--- a/modules/NUCLEO-L476RG/module.c
+++ b/modules/NUCLEO-L476RG/module.c
@@ -49,15 +49,15 @@ SerialConfig moduleHalProgIfConfig = {
   /* CR1      */ 0,
 };
 
-#if defined(AMIROLLD_CFG_MPU6050)
+#if (BOARD_MPU6050_CONNECTED == true)
 
 I2CConfig moduleHalI2c3Config = {
-  /* timing reg */ 0, // configured later in MODULE_INIT_PERIPHERY_COMM_MPU6050() hook
+  /* timing reg */ 0, // configured later in MODULE_INIT_PERIPHERY_IF_MPU6050() hook
   /* CR1        */ 0,
   /* CR2        */ 0,
 };
 
-#endif /* defined(AMIROLLD_CFG_MPU6050) */
+#endif /* (BOARD_MPU6050_CONNECTED == true) */
 
 /** @} */
 
@@ -129,52 +129,101 @@ ROMCONST char* moduleShellPrompt = "NUCLEO-L476RG";
  */
 /*===========================================================================*/
 
-#if defined(AMIROLLD_CFG_MPU6050)
+LEDDriver moduleLldLed = {
+  /* LED enable Gpio */ &moduleGpioLed,
+};
+
+ButtonDriver moduleLldUserButton = {
+  /* Button Gpio  */ &moduleGpioUserButton,
+};
+
+#if (BOARD_MPU6050_CONNECTED == true)
 
 MPU6050Driver moduleLldMpu6050 = {
   /* I2C Driver       */ &MODULE_HAL_I2C3,
   /* I²C address      */ MPU6050_LLD_I2C_ADDR_FIXED,
 };
 
-#endif /* defined(AMIROLLD_CFG_MPU6050) */
+#endif /* (BOARD_MPU6050_CONNECTED == true) */
 
 /** @} */
 
 /*===========================================================================*/
 /**
- * @name Unit tests (UT)
+ * @name Tests
  * @{
  */
 /*===========================================================================*/
 #if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
 
-#if defined(AMIROLLD_CFG_MPU6050)
+/*
+ * LED
+ */
+#include <module_test_LED.h>
+static int _testLedShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
+{
+  return moduleTestLedShellCb(stream, argc, argv, NULL);
+}
+AOS_SHELL_COMMAND(moduleTestLedShellCmd, "test:LED", _testLedShellCmdCb);
+
+/*
+ * User button
+ */
+#include <module_test_button.h>
+static int _testButtonShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
+{
+  return moduleTestButtonShellCb(stream, argc, argv, NULL);
+}
+AOS_SHELL_COMMAND(moduleTestButtonShellCmd, "test:button", _testButtonShellCmdCb);
+
+#if (BOARD_MPU6050_CONNECTED == true) || defined(__DOXYGEN__)
+
+/*
+ * MPU6050 (accelerometer & gyroscope)
+ */
+#include <module_test_MPU6050.h>
+static int _testMpu6050ShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
+{
+  return moduleTestMpu6050ShellCb(stream, argc, argv, NULL);
+}
+AOS_SHELL_COMMAND(moduleTestMpu6050ShellCmd, "test:IMU", _testMpu6050ShellCmdCb);
+
+#endif /* (BOARD_MPU6050_CONNECTED == true) */
 
-/* MPU6050 */
-static int _utShellCmdCb_AlldMpu6050(BaseSequentialStream* stream, int argc, char* argv[])
+/*
+ * entire module
+ */
+static int _testAllShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
 {
   (void)argc;
   (void)argv;
-  aosUtRun(stream, &moduleUtAlldMpu6050, NULL);
-  return AOS_OK;
-}
-static ut_mpu6050data_t _utAlldMpu6050Data = {
-   /* driver */ &moduleLldMpu6050,
-  /* timeout  */ MICROSECONDS_PER_SECOND,
-};
-aos_unittest_t moduleUtAlldMpu6050 = {
-  /* name           */ "MPU6050",
-  /* info           */ "accelerometer and gyroscope",
-  /* test function  */ utAlldMpu6050Func,
-  /* shell command  */ {
-    /* name     */ "unittest:Accelerometer&Gyroscope",
-    /* callback */ _utShellCmdCb_AlldMpu6050,
-    /* next     */ NULL,
-  },
-  /* data           */ &_utAlldMpu6050Data
-};
 
-#endif /* defined(AMIROLLD_CFG_MPU6050) */
+  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};
+
+  /* LED */
+  status |= moduleTestLedShellCb(stream, 0, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+
+  /* User button */
+  status |= moduleTestButtonShellCb(stream, 0, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+
+  /* MPU6050 (accelerometer & gyroscope) */
+#if (BOARD_MPU6050_CONNECTED == true)
+  status |= moduleTestMpu6050ShellCb(stream, 0, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+#endif /* (BOARD_MPU6050_CONNECTED == true) */
+
+  // print total result
+  chprintf(stream, "\n");
+  aosTestResultPrintSummary(stream, &result_total, "entire module");
+
+  return status;
+}
+AOS_SHELL_COMMAND(moduleTestAllShellCmd, "test:all", _testAllShellCmdCb);
 
 #endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 
