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/PowerManagement_1-1/module.c b/modules/PowerManagement_1-1/module.c
index 4b38320..f584017 100644
--- a/modules/PowerManagement_1-1/module.c
+++ b/modules/PowerManagement_1-1/module.c
@@ -246,7 +246,7 @@ ROMCONST apalControlGpio_t moduleGpioLed = {
   /* GPIO */ &_gpioLed,
   /* meta */ {
     /* direction      */ APAL_GPIO_DIRECTION_OUTPUT,
-    /* active state   */ LED_LLD_GPIO_ACTIVE_STATE,
+    /* active state   */ APAL_GPIO_ACTIVE_LOW,
     /* interrupt edge */ APAL_GPIO_EDGE_NONE,
   },
 };
@@ -682,614 +682,143 @@ AT42QT1050Driver moduleLldTouch = {
 
 /*===========================================================================*/
 /**
- * @name Unit tests (UT)
+ * @name Tests
  * @{
  */
 /*===========================================================================*/
 #if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
-#include <string.h>
 
 /*
- * ADC
+ * ADC (VSYS)
  */
-static int _utShellCmdCb_Adc(BaseSequentialStream* stream, int argc, char* argv[])
+#include <module_test_adc.h>
+static int _testAdcShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
 {
-  (void)argc;
-  (void)argv;
-  aosUtRun(stream, &moduleUtAdcVsys, NULL);
-  return AOS_OK;
+  return moduleTestAdcShellCb(stream, argc, argv, NULL);
 }
-static ut_adcdata_t _utAdcVsysData = {
-  /* driver               */ &MODULE_HAL_ADC_VSYS,
-  /* ADC conversion group */ &moduleHalAdcVsysConversionGroup,
-};
-aos_unittest_t moduleUtAdcVsys = {
-  /* name           */ "ADC",
-  /* info           */ "VSYS",
-  /* test function  */ utAdcFunc,
-  /* shell command  */ {
-    /* name     */ "unittest:ADC",
-    /* callback */ _utShellCmdCb_Adc,
-    /* next     */ NULL,
-  },
-  /* data           */ &_utAdcVsysData,
-};
+AOS_SHELL_COMMAND(moduleTestAdcShellCmd, "test:ADC", _testAdcShellCmdCb);
 
 /*
- * AT24C01B (EEPROM)
+ * AT24C01BN-SH-B (EEPROM)
  */
-static int _utShellCmdCb_AlldAt24c01b(BaseSequentialStream* stream, int argc, char* argv[])
+#include <module_test_AT24C01B.h>
+static int _testAt24c01bShellCmdCb(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", _testAt24c01bShellCmdCb);
 
 /*
  * bq24103a (battery charger)
  */
-static int _utShellCmdCb_AlldBq24103a(BaseSequentialStream* stream, int argc, char* argv[])
+#include <module_test_bq241xx.h>
+static int _testBq241xxShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
 {
-  // local variables
-  bool print_help = false;
-
-  // evaluate argument
-  if (argc == 2) {
-    if (strcmp(argv[1], "-f") == 0 || strcmp(argv[1], "--front") == 0) {
-      moduleUtAlldBq24103a.data = &moduleLldBatteryChargerFront;
-      aosUtRun(stream, &moduleUtAlldBq24103a, "front battery");
-      moduleUtAlldBq24103a.data = NULL;
-    }
-    else if (strcmp(argv[1], "-r") == 0 || strcmp(argv[1], "--rear") == 0) {
-      moduleUtAlldBq24103a.data = &moduleLldBatteryChargerRear;
-      aosUtRun(stream, &moduleUtAlldBq24103a, "rear battery");
-      moduleUtAlldBq24103a.data = NULL;
-    }
-    else {
-      print_help = true;
-    }
-  } else {
-    print_help = true;
-  }
-
-  // print help or just return
-  if (print_help) {
-    chprintf(stream, "Usage: %s OPTION\n", argv[0]);
-    chprintf(stream, "Options:\n");
-    chprintf(stream, "  --front, -f\n");
-    chprintf(stream, "    Test the front battery charger.\n");
-    chprintf(stream, "  --rear, -r\n");
-    chprintf(stream, "    Test the rear battery charger.\n");
-    return AOS_INVALIDARGUMENTS;
-  } else {
-    return AOS_OK;
-  }
+  return moduleTestBq241xxShellCb(stream, argc, argv, NULL);
 }
-aos_unittest_t moduleUtAlldBq24103a = {
-  /* name           */ "bq24103a",
-  /* info           */ "battery charger",
-  /* test function  */ utAlldBq241xxFunc,
-  /* shell command  */ {
-    /* name     */ "unittest:BatteryCharger",
-    /* callback */ _utShellCmdCb_AlldBq24103a,
-    /* next     */ NULL,
-  },
-  /* data           */ NULL,
-};
+AOS_SHELL_COMMAND(moduleTestBq241xxShellCmd, "test:BatteryCharger", _testBq241xxShellCmdCb);
 
 /*
  * bq27500 (fuel gauge)
  */
-static int _utShellCmdCb_AlldBq27500(BaseSequentialStream* stream, int argc, char* argv[])
+#include <module_test_bq27500.h>
+static int _testBq27500ShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
 {
-  // evaluate arguments
-  if (argc == 2) {
-    if (strcmp(argv[1], "-f") == 0 || strcmp(argv[1], "--front") == 0) {
-      ((ut_bq27500data_t*)moduleUtAlldBq27500.data)->driver = &moduleLldFuelGaugeFront;
-      aosUtRun(stream, &moduleUtAlldBq27500, "front battery");
-      ((ut_bq27500data_t*)moduleUtAlldBq27500.data)->driver = NULL;
-      return AOS_OK;
-    }
-    else if (strcmp(argv[1], "-r") == 0 || strcmp(argv[1], "--rear") == 0) {
-      ((ut_bq27500data_t*)moduleUtAlldBq27500.data)->driver = &moduleLldFuelGaugeRear;
-      aosUtRun(stream, &moduleUtAlldBq27500, "rear battery");
-      ((ut_bq27500data_t*)moduleUtAlldBq27500.data)->driver = NULL;
-      return AOS_OK;
-    }
-  }
-  // print help
-  chprintf(stream, "Usage: %s OPTION\n", argv[0]);
-  chprintf(stream, "Options:\n");
-  chprintf(stream, "  --front, -f\n");
-  chprintf(stream, "    Test the front battery fuel gauge.\n");
-  chprintf(stream, "  --rear, -r\n");
-  chprintf(stream, "    Test the rear battery fuel gauge.\n");
-  return AOS_INVALIDARGUMENTS;
+  return moduleTestBq27500ShellCb(stream, argc, argv, NULL);
 }
-static ut_bq27500data_t _utAlldBq27500Data = {
-  /* driver   */ NULL,
-  /* timeout  */ MICROSECONDS_PER_SECOND,
-};
-aos_unittest_t moduleUtAlldBq27500 = {
-  /* name           */ "bq27500",
-  /* info           */ "fuel gauge",
-  /* test function  */ utAlldBq27500Func,
-  /* shell command  */ {
-    /* name     */ "unittest:FuelGauge",
-    /* callback */ _utShellCmdCb_AlldBq27500,
-    /* next     */ NULL,
-  },
-  /* data           */ &_utAlldBq27500Data,
-};
+AOS_SHELL_COMMAND(moduleTestBq27500ShellCmd, "test:FuelGauge", _testBq27500ShellCmdCb);
 
 /*
  * bq27500 (fuel gauge) in combination with bq24103a (battery charger)
  */
-static int _utShellCmdCb_AlldBq27500Bq24103a(BaseSequentialStream* stream, int argc, char* argv[])
+#include <module_test_bq27500_bq241xx.h>
+static int _testBq27500Bq241xxShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
 {
-  // evaluate arguments
-  if (argc == 2) {
-    if (strcmp(argv[1], "-f") == 0 || strcmp(argv[1], "--front") == 0) {
-      ((ut_bq27500bq241xxdata_t*)moduleUtAlldBq27500Bq24103a.data)->bq27500 = &moduleLldFuelGaugeFront;
-      ((ut_bq27500bq241xxdata_t*)moduleUtAlldBq27500Bq24103a.data)->bq241xx = &moduleLldBatteryChargerFront;
-      aosUtRun(stream, &moduleUtAlldBq27500Bq24103a, "front battery");
-      ((ut_bq27500bq241xxdata_t*)moduleUtAlldBq27500Bq24103a.data)->bq27500 = NULL;
-      ((ut_bq27500bq241xxdata_t*)moduleUtAlldBq27500Bq24103a.data)->bq241xx = NULL;
-      return AOS_OK;
-    }
-    else if (strcmp(argv[1], "-r") == 0 || strcmp(argv[1], "--rear") == 0) {
-      ((ut_bq27500bq241xxdata_t*)moduleUtAlldBq27500Bq24103a.data)->bq27500 = &moduleLldFuelGaugeRear;
-      ((ut_bq27500bq241xxdata_t*)moduleUtAlldBq27500Bq24103a.data)->bq241xx = &moduleLldBatteryChargerRear;
-      aosUtRun(stream, &moduleUtAlldBq27500Bq24103a, "rear battery");
-      ((ut_bq27500bq241xxdata_t*)moduleUtAlldBq27500Bq24103a.data)->bq27500 = NULL;
-      ((ut_bq27500bq241xxdata_t*)moduleUtAlldBq27500Bq24103a.data)->bq241xx = NULL;
-      return AOS_OK;
-    }
-  }
-  // print help
-  chprintf(stream, "Usage: %s OPTION\n", argv[0]);
-  chprintf(stream, "Options:\n");
-  chprintf(stream, "  --front, -f\n");
-  chprintf(stream, "    Test the front battery fuel gauge and charger.\n");
-  chprintf(stream, "  --rear, -r\n");
-  chprintf(stream, "    Test the rear battery fuel gauge and charger.\n");
-  return AOS_INVALIDARGUMENTS;
+  return moduleTestBq27500Bq241xxShellCb(stream, argc, argv, NULL);
 }
-static ut_bq27500bq241xxdata_t _utAlldBq27500Bq24103aData= {
-  /* bq27500 driver   */ NULL,
-  /* bq24103a driver  */ NULL,
-  /* timeout          */ MICROSECONDS_PER_SECOND,
-};
-aos_unittest_t moduleUtAlldBq27500Bq24103a = {
-  /* name           */ "BQ27500 & BQ24103A",
-  /* info           */ "fuel gauge & battery charger",
-  /* test function  */ utAlldBq27500Bq241xxFunc,
-  /* shell command  */ {
-    /* name     */ "unittest:FuelGauge&BatteryCharger",
-    /* callback */ _utShellCmdCb_AlldBq27500Bq24103a,
-    /* next     */ NULL,
-  },
-  /* data           */ &_utAlldBq27500Bq24103aData,
-};
+AOS_SHELL_COMMAND(moduleTestBq27500Bq241xxShellCmd, "test:FuelGauge&BatteryCharger", _testBq27500Bq241xxShellCmdCb);
 
 /*
  * INA219 (power monitor)
  */
-static int _utShellCmdCb_AlldIna219(BaseSequentialStream* stream, int argc, char* argv[])
+#include <module_test_INA219.h>
+static int _testIna219ShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
 {
-  // evaluate arguments
-  if (argc == 2) {
-    if (strcmp(argv[1], "VDD") == 0) {
-      ((ut_ina219data_t*)moduleUtAlldIna219.data)->inad = &moduleLldPowerMonitorVdd;
-      ((ut_ina219data_t*)moduleUtAlldIna219.data)->v_expected = 3.3f;
-      aosUtRun(stream, &moduleUtAlldIna219, "VDD (3.3V)");
-      ((ut_ina219data_t*)moduleUtAlldIna219.data)->inad = NULL;
-      ((ut_ina219data_t*)moduleUtAlldIna219.data)->v_expected = 0.0f;
-      return AOS_OK;
-    }
-    else if (strcmp(argv[1], "VIO1.8") == 0) {
-      ((ut_ina219data_t*)moduleUtAlldIna219.data)->inad = &moduleLldPowerMonitorVio18;
-      ((ut_ina219data_t*)moduleUtAlldIna219.data)->v_expected = 1.8f;
-      aosUtRun(stream, &moduleUtAlldIna219, "VIO (1.8V)");
-      ((ut_ina219data_t*)moduleUtAlldIna219.data)->inad = NULL;
-      ((ut_ina219data_t*)moduleUtAlldIna219.data)->v_expected = 0.0f;
-      return AOS_OK;
-    }
-    else if (strcmp(argv[1], "VIO3.3") == 0) {
-      ((ut_ina219data_t*)moduleUtAlldIna219.data)->inad = &moduleLldPowerMonitorVio33;
-      ((ut_ina219data_t*)moduleUtAlldIna219.data)->v_expected = 3.3f;
-      aosUtRun(stream, &moduleUtAlldIna219, "VIO (3.3V)");
-      ((ut_ina219data_t*)moduleUtAlldIna219.data)->inad = NULL;
-      ((ut_ina219data_t*)moduleUtAlldIna219.data)->v_expected = 0.0f;
-      return AOS_OK;
-    }
-    else if (strcmp(argv[1], "VSYS4.2") == 0) {
-      ((ut_ina219data_t*)moduleUtAlldIna219.data)->inad = &moduleLldPowerMonitorVsys42;
-      ((ut_ina219data_t*)moduleUtAlldIna219.data)->v_expected = 4.2f;
-      aosUtRun(stream, &moduleUtAlldIna219, "VSYS (4.2V)");
-      ((ut_ina219data_t*)moduleUtAlldIna219.data)->inad = NULL;
-      ((ut_ina219data_t*)moduleUtAlldIna219.data)->v_expected = 0.0f;
-      return AOS_OK;
-    }
-    else if (strcmp(argv[1], "VIO5.0") == 0) {
-      ((ut_ina219data_t*)moduleUtAlldIna219.data)->inad = &moduleLldPowerMonitorVio50;
-      ((ut_ina219data_t*)moduleUtAlldIna219.data)->v_expected = 5.0f;
-      aosUtRun(stream, &moduleUtAlldIna219, "VIO (5.0V)");
-      ((ut_ina219data_t*)moduleUtAlldIna219.data)->inad = NULL;
-      ((ut_ina219data_t*)moduleUtAlldIna219.data)->v_expected = 0.0f;
-      return AOS_OK;
-    }
-  }
-  // print help
-  chprintf(stream, "Usage: %s OPTION\n", argv[0]);
-  chprintf(stream, "Options:\n");
-  chprintf(stream, "  VDD\n");
-  chprintf(stream, "    Test VDD (3.3V) power monitor.\n");
-  chprintf(stream, "  VIO1.8\n");
-  chprintf(stream, "    Test VIO 1.8V power monitor.\n");
-  chprintf(stream, "  VIO3.3\n");
-  chprintf(stream, "    Test VIO 3.3V power monitor.\n");
-  chprintf(stream, "  VSYS4.2\n");
-  chprintf(stream, "    Test VSYS 4.2V power monitor.\n");
-  chprintf(stream, "  VIO5.0\n");
-  chprintf(stream, "    Test VIO 5.0V power monitor.\n");
-  return AOS_INVALIDARGUMENTS;
+  return moduleTestIna219ShellCb(stream, argc, argv, NULL);
 }
-static ut_ina219data_t _utAlldIna219Data = {
-  /* driver           */ NULL,
-  /* expected voltage */ 0.0f,
-  /* tolerance        */ 0.05f,
-  /* timeout          */ MICROSECONDS_PER_SECOND,
-};
-aos_unittest_t moduleUtAlldIna219 = {
-  /* name           */ "INA219",
-  /* info           */ "power monitor",
-  /* test function  */ utAlldIna219Func,
-  /* shell command  */ {
-    /* name     */ "unittest:PowerMonitor",
-    /* callback */ _utShellCmdCb_AlldIna219,
-    /* next     */ NULL,
-  },
-  /* data           */ &_utAlldIna219Data,
-};
+AOS_SHELL_COMMAND(moduleTestIna219ShellCmd, "test:PowerMonitor", _testIna219ShellCmdCb);
 
 /*
  * Status LED
  */
-static int _utShellCmdCb_AlldLed(BaseSequentialStream* stream, int argc, char* argv[])
+#include <module_test_LED.h>
+static int _testLedShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
 {
-  (void)argc;
-  (void)argv;
-  aosUtRun(stream, &moduleUtAlldLed, NULL);
-  return AOS_OK;
+  return moduleTestLedShellCb(stream, argc, argv, NULL);
 }
-aos_unittest_t moduleUtAlldLed = {
-  /* name           */ "LED",
-  /* info           */ NULL,
-  /* test function  */ utAlldLedFunc,
-  /* shell command  */ {
-    /* name     */ "unittest:StatusLED",
-    /* callback */ _utShellCmdCb_AlldLed,
-    /* next     */ NULL,
-  },
-  /* data           */ &moduleLldStatusLed,
-};
+AOS_SHELL_COMMAND(moduleTestLedShellCmd, "test:StatusLED", _testLedShellCmdCb);
 
 /*
  * PKLCS1212E4001 (buzzer)
  */
-static int _utShellCmdCb_AlldPklcs1212e4001(BaseSequentialStream* stream, int argc, char* argv[])
+#include <module_test_PKxxxExxx.h>
+static int _testPkxxxexxxShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
 {
-  (void)argc;
-  (void)argv;
-  aosUtRun(stream, &moduleUtAlldPklcs1212e4001, NULL);
-  return AOS_OK;
+  return moduleTestPkxxxexxxShellCb(stream, argc, argv, NULL);
 }
-static ut_pkxxxexxx_t _utAlldPklcs1212e4001Data = {
-  /* PWM driver   */ &MODULE_HAL_PWM_BUZZER,
-  /* PWM channel  */ MODULE_HAL_PWM_BUZZER_CHANNEL
-};
-aos_unittest_t moduleUtAlldPklcs1212e4001 = {
-  /* name           */ "PKLCS1212E4001",
-  /* info           */ "buzzer",
-  /* test function  */ utAlldPkxxxexxxFunc,
-  /* shell command  */ {
-    /* name     */ "unittest:Buzzer",
-    /* callback */ _utShellCmdCb_AlldPklcs1212e4001,
-    /* next     */ NULL,
-  },
-  /* data           */ &_utAlldPklcs1212e4001Data,
-};
+AOS_SHELL_COMMAND(moduleTestPkxxxexxxShellCmd, "test:Buzzer", _testPkxxxexxxShellCmdCb);
 
 /*
  * TPS62113 (step-down converter)
  */
-static int _utShellCmdCb_AlldTps62113(BaseSequentialStream* stream, int argc, char* argv[])
+#include <module_test_TPS6211x.h>
+static int _testTps6211xShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
 {
-  // Although there are four TPS62113 on the PCB, they all share the same input signal.
-  // A sa result, no additional shell arguments need to be evaluated.
-  (void)argc;
-  (void)argv;
-  aosUtRun(stream, &moduleUtAlldTps62113, NULL);
-  return AOS_OK;
+  return moduleTestTps6211xShellCb(stream, argc, argv, NULL);
 }
-aos_unittest_t moduleUtAlldTps62113 = {
-  /* name           */ "TPS62113",
-  /* info           */ "step-down converter",
-  /* test function  */ utAlldTps6211xFunc,
-  /* shell command  */ {
-    /* name     */ "unittest:StepDownConverter",
-    /* callback */ _utShellCmdCb_AlldTps62113,
-    /* next     */ NULL,
-  },
-  /* data           */ &moduleLldStepDownConverter,
-};
+AOS_SHELL_COMMAND(moduleTestTps6211xShellCmd, "test:StepDownConverter", _testTps6211xShellCmdCb);
 
 /*
- * TPS62113 (step-donw converter) in combination with INA219 (power monitor)
+ * TPS62113 (step-sown converter) in combination with INA219 (power monitor)
  */
-static int _utShellCmdCb_AlldTps62113Ina219(BaseSequentialStream* stream, int argc, char* argv[])
+#include <module_test_TPS6211x_INA219.h>
+static int _testTps6211xIna219ShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
 {
-  (void)argc;
-  (void)argv;
-  aosUtRun(stream, &moduleUtAlldTps62113Ina219, "VSYS (4.2V)");
-  return AOS_OK;
+  return moduleTestTps6211xIna219ShellCb(stream, argc, argv, NULL);
 }
-static ut_tps6211xina219data_t _utAlldTps62113Ina219Data = {
-  /* TPS62113 */ &moduleLldStepDownConverter,
-  /* INA219   */ &moduleLldPowerMonitorVsys42,
-  /* timeout  */ MICROSECONDS_PER_SECOND,
-};
-aos_unittest_t moduleUtAlldTps62113Ina219 = {
-  /* name           */ "TPS62113 & INA219",
-  /* info           */ "step-down converter & power monitor",
-  /* test function  */ utAlldTps6211xIna219Func,
-  /* shell command  */ {
-    /* name     */ "unittest:StepDownConverter&PowerMonitor",
-    /* callback */ _utShellCmdCb_AlldTps62113Ina219,
-    /* next     */ NULL,
-  },
-  /* data           */ &_utAlldTps62113Ina219Data,
-};
+AOS_SHELL_COMMAND(moduleTestTps6211xIna219ShellCmd, "test:StepDownConverter&PowerMonitor", _testTps6211xIna219ShellCmdCb);
 
 #if (BOARD_SENSORRING == BOARD_PROXIMITYSENSOR) || defined(__DOXYGEN__)
 
 /*
  * MPR121 (touch sensor)
  */
-static int _utShellCmdCb_AlldMpr121(BaseSequentialStream* stream, int argc, char* argv[])
+#include <module_test_MPR121.h>
+static int _testMpr121ShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
 {
-  (void)argc;
-  (void)argv;
-  aosUtRun(stream, &moduleUtAlldMpr121, NULL);
-  return AOS_OK;
+  return moduleTestMpr121ShellCb(stream, argc, argv, NULL);
 }
-static ut_mpr121data_t _utAlldMpr121Data= {
-  /* MPR121 driver  */ &moduleLldTouch,
-  /* timeout        */ MICROSECONDS_PER_SECOND,
-  /* event source   */ &aos.events.io,
-  /* event flags    */ MODULE_OS_IOEVENTFLAGS_TOUCHINT,
-};
-aos_unittest_t moduleUtAlldMpr121 = {
-  /* name           */ "MPR121",
-  /* info           */ "touch sensor",
-  /* test function  */ utAlldMpr121Func,
-  /* shell command  */ {
-    /* name     */ "unittest:Touch",
-    /* callback */ _utShellCmdCb_AlldMpr121,
-    /* next     */ NULL,
-  },
-  /* data           */ &_utAlldMpr121Data,
-};
+AOS_SHELL_COMMAND(moduleTestMpr121ShellCmd, "test:Touch", _testMpr121ShellCmdCb);
 
 /*
  * PCA9544A (I2C multiplexer)
  */
-static int _utShellCmdCb_AlldPca5944a(BaseSequentialStream* stream, int argc, char* argv[])
+#include <module_test_PCA9544A.h>
+static int _testPca9544aShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
 {
-  // evaluate arguments
-  if (argc == 2) {
-    if (strcmp(argv[1], "#1") == 0) {
-      ((ut_pca9544adata_t*)moduleUtAlldPca9544a.data)->driver = &moduleLldI2cMultiplexer1;
-      aosUtRun(stream, &moduleUtAlldPca9544a, "I2C bus #1");
-      ((ut_pca9544adata_t*)moduleUtAlldPca9544a.data)->driver = NULL;
-      return AOS_OK;
-    }
-    else if (strcmp(argv[1], "#2") == 0) {
-      ((ut_pca9544adata_t*)moduleUtAlldPca9544a.data)->driver = &moduleLldI2cMultiplexer2;
-      aosUtRun(stream, &moduleUtAlldPca9544a, "I2C bus #2");
-      ((ut_pca9544adata_t*)moduleUtAlldPca9544a.data)->driver = NULL;
-      return AOS_OK;
-    }
-  }
-  // print help
-  chprintf(stream, "Usage: %s OPTION\n", argv[0]);
-  chprintf(stream, "Options:\n");
-  chprintf(stream, "  #1\n");
-  chprintf(stream, "    Test the multiplexer on the I2C bus #1.\n");
-  chprintf(stream, "  #2\n");
-  chprintf(stream, "    Test the multiplexer on the I2C bus #2.\n");
-  return AOS_INVALIDARGUMENTS;
+  return moduleTestPca9544aShellCb(stream, argc, argv, NULL);
 }
-static ut_pca9544adata_t _utAlldPca9544aData = {
-  /* driver   */ NULL,
-  /* timeout  */ MICROSECONDS_PER_SECOND,
-};
-aos_unittest_t moduleUtAlldPca9544a = {
-  /* name           */ "PCA9544A",
-  /* info           */ "I2C multiplexer",
-  /* test function  */ utAlldPca9544aFunc,
-  /* shell command  */ {
-    /* name     */ "unittest:I2CMultiplexer",
-    /* callback */ _utShellCmdCb_AlldPca5944a,
-    /* next     */ NULL,
-  },
-  /* data           */ &_utAlldPca9544aData,
-};
+AOS_SHELL_COMMAND(moduleTestPca9544aShellCmd, "test:I2CMultiplexer", _testPca9544aShellCmdCb);
 
 /*
  * VCNL4020 (proximity sensor)
  */
-static void _utAlldVcnl4020_disableInterrupt(VCNL4020Driver* vcnl)
+#include <module_test_VCNL4020.h>
+static int _testVcnl4020ShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
 {
-  uint8_t intstatus;
-  vcnl4020_lld_writereg(vcnl, VCNL4020_LLD_REGADDR_INTCTRL, 0, ((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->timeout);
-  vcnl4020_lld_readreg(vcnl, VCNL4020_LLD_REGADDR_INTSTATUS, &intstatus, ((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->timeout);
-  if (intstatus) {
-    vcnl4020_lld_writereg(vcnl, VCNL4020_LLD_REGADDR_INTSTATUS, intstatus, ((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->timeout);
-  }
-  return;
+  return moduleTestVcnl4020ShellCb(stream, argc, argv, NULL);
 }
-static int _utShellCmdCb_AlldVcnl4020(BaseSequentialStream* stream, int argc, char* argv[])
-{
-  enum {
-    UNKNOWN,
-    NNE, ENE, ESE, SSE, SSW,WSW,WNW, NNW,
-  } sensor = UNKNOWN;
-  // evaluate arguments
-  if (argc == 2) {
-    if (strcmp(argv[1], "-nne") == 0) {
-      sensor = NNE;
-    } else if (strcmp(argv[1], "-ene") == 0) {
-      sensor = ENE;
-    } else if (strcmp(argv[1], "-ese") == 0) {
-      sensor = ESE;
-    } else if (strcmp(argv[1], "-sse") == 0) {
-      sensor = SSE;
-    } else if (strcmp(argv[1], "-ssw") == 0) {
-      sensor = SSW;
-    } else if (strcmp(argv[1], "-wsw") == 0) {
-      sensor = WSW;
-    } else if (strcmp(argv[1], "-wnw") == 0) {
-      sensor = WNW;
-    } else if (strcmp(argv[1], "-nnw") == 0) {
-      sensor = NNW;
-    }
-  }
-  if (sensor != UNKNOWN) {
-    PCA9544ADriver* mux = NULL;
-    switch (sensor) {
-      case SSE:
-      case SSW:
-      case WSW:
-      case WNW:
-        mux = &moduleLldI2cMultiplexer1;
-        ((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->vcnld = &moduleLldProximity1;
-        ((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT2;
-        break;
-      case NNW:
-      case NNE:
-      case ENE:
-      case ESE:
-        mux = &moduleLldI2cMultiplexer2;
-        ((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->vcnld = &moduleLldProximity2;
-        ((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->evtflags = MODULE_OS_IOEVENTFLAGS_IRINT1;
-        break;
-      default:
-        break;
-    }
-    pca9544a_lld_setchannel(mux, PCA9544A_LLD_CH0, ((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->timeout);
-    _utAlldVcnl4020_disableInterrupt(((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->vcnld);
-    pca9544a_lld_setchannel(mux, PCA9544A_LLD_CH1, ((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->timeout);
-    _utAlldVcnl4020_disableInterrupt(((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->vcnld);
-    pca9544a_lld_setchannel(mux, PCA9544A_LLD_CH2, ((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->timeout);
-    _utAlldVcnl4020_disableInterrupt(((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->vcnld);
-    pca9544a_lld_setchannel(mux, PCA9544A_LLD_CH3, ((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->timeout);
-    _utAlldVcnl4020_disableInterrupt(((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->vcnld);
-    switch (sensor) {
-      case NNE:
-        pca9544a_lld_setchannel(mux, PCA9544A_LLD_CH1, ((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->timeout);
-        aosUtRun(stream, &moduleUtAlldVcnl4020, "north-northeast sensor");
-        break;
-      case ENE:
-        pca9544a_lld_setchannel(mux, PCA9544A_LLD_CH3, ((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->timeout);
-        aosUtRun(stream, &moduleUtAlldVcnl4020, "east-northeast sensor");
-        break;
-      case ESE:
-        pca9544a_lld_setchannel(mux, PCA9544A_LLD_CH2, ((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->timeout);
-        aosUtRun(stream, &moduleUtAlldVcnl4020, "north-southeast sensor");
-        break;
-      case SSE:
-        pca9544a_lld_setchannel(mux, PCA9544A_LLD_CH0, ((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->timeout);
-        aosUtRun(stream, &moduleUtAlldVcnl4020, "south-southeast sensor");
-        break;
-      case SSW:
-        pca9544a_lld_setchannel(mux, PCA9544A_LLD_CH1, ((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->timeout);
-        aosUtRun(stream, &moduleUtAlldVcnl4020, "south-southwest sensor");
-        break;
-      case WSW:
-        pca9544a_lld_setchannel(mux, PCA9544A_LLD_CH3, ((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->timeout);
-        aosUtRun(stream, &moduleUtAlldVcnl4020, "west-southwest sensor");
-        break;
-      case WNW:
-        pca9544a_lld_setchannel(mux, PCA9544A_LLD_CH2, ((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->timeout);
-        aosUtRun(stream, &moduleUtAlldVcnl4020, "west-northwest sensor");
-        break;
-      case NNW:
-        pca9544a_lld_setchannel(mux, PCA9544A_LLD_CH0, ((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->timeout);
-        aosUtRun(stream, &moduleUtAlldVcnl4020, "north-northwest sensor");
-        break;
-      default:
-        break;
-    }
-    ((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->vcnld = NULL;
-    ((ut_vcnl4020data_t*)moduleUtAlldVcnl4020.data)->evtflags = 0;
-    return AOS_OK;
-  }
-  // print help
-  chprintf(stream, "Usage: %s OPTION\n", argv[0]);
-  chprintf(stream, "Options:\n");
-  chprintf(stream, "  -nne\n");
-  chprintf(stream, "    Test north-northeast sensor.\n");
-  chprintf(stream, "  -ene\n");
-  chprintf(stream, "    Test east-northeast sensor.\n");
-  chprintf(stream, "  -ese\n");
-  chprintf(stream, "    Test east-southeast sensor.\n");
-  chprintf(stream, "  -sse\n");
-  chprintf(stream, "    Test south-southeast sensor.\n");
-  chprintf(stream, "  -ssw\n");
-  chprintf(stream, "    Test south-southwest sensor.\n");
-  chprintf(stream, "  -wsw\n");
-  chprintf(stream, "    Test west-southwest sensor.\n");
-  chprintf(stream, "  -wnw\n");
-  chprintf(stream, "    Test west-northwest sensor.\n");
-  chprintf(stream, "  -nnw\n");
-  chprintf(stream, "    Test north-northwest sensor.\n");
-  return AOS_INVALIDARGUMENTS;
-}
-static ut_vcnl4020data_t _utAlldVcnl4020Data = {
-  /* driver       */ NULL,
-  /* timeout      */ MICROSECONDS_PER_SECOND,
-  /* event source */ &aos.events.io,
-  /* event flags  */ 0,
-};
-aos_unittest_t moduleUtAlldVcnl4020 = {
-  /* name           */ "VCNL4020",
-  /* info           */ "proximity sensor",
-  /* test function  */ utAlldVcnl4020Func,
-  /* shell command  */ {
-    /* name     */ "unittest:Proximity",
-    /* callback */ _utShellCmdCb_AlldVcnl4020,
-    /* next     */ NULL,
-  },
-  /* data           */ &_utAlldVcnl4020Data,
-};
+AOS_SHELL_COMMAND(moduleTestVcnl4020ShellCmd, "test:Proximity", _testVcnl4020ShellCmdCb);
 
 #endif /* (BOARD_SENSORRING == BOARD_PROXIMITYSENSOR) */
 
@@ -1298,75 +827,22 @@ aos_unittest_t moduleUtAlldVcnl4020 = {
 /*
  * PCAL6524 (GPIO extender)
  */
-static int _utShellCmdCb_AlldPcal6524(BaseSequentialStream* stream, int argc, char* argv[])
+#include <module_test_PCAL6524.h>
+static int _testPcal6524ShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
 {
-  // evaluate arguments
-  if (argc == 2) {
-    if (strcmp(argv[1], "#1") == 0) {
-      ((ut_pcal6524data_t*)moduleUtAlldPcal6524.data)->pcal6524d = &moduleLldGpioExtender1;
-      aosUtRun(stream, &moduleUtAlldPcal6524, "I2C bus #1");
-      ((ut_pcal6524data_t*)moduleUtAlldPcal6524.data)->pcal6524d = NULL;
-      return AOS_OK;
-    }
-    else if (strcmp(argv[1], "#2") == 0) {
-      ((ut_pcal6524data_t*)moduleUtAlldPcal6524.data)->pcal6524d = &moduleLldGpioExtender2;
-      aosUtRun(stream, &moduleUtAlldPcal6524, "I2C bus #2");
-      ((ut_pcal6524data_t*)moduleUtAlldPcal6524.data)->pcal6524d = NULL;
-      return AOS_OK;
-    }
-  }
-  // print help
-  chprintf(stream, "Usage: %s OPTION\n", argv[0]);
-  chprintf(stream, "Options:\n");
-  chprintf(stream, "  #1\n");
-  chprintf(stream, "    Test the GPIO extender on the I2C bus #1.\n");
-  chprintf(stream, "  #2\n");
-  chprintf(stream, "    Test the GPIO extender on the I2C bus #2.\n");
-  return AOS_INVALIDARGUMENTS;
+  return moduleTestPcal6524ShellCb(stream, argc, argv, NULL);
 }
-static ut_pcal6524data_t _utAlldPcal6524Data = {
-  /* driver   */ NULL,
-  /* timeout  */ MICROSECONDS_PER_SECOND,
-};
-aos_unittest_t moduleUtAlldPcal6524 = {
-  /* name           */ "PCAL6524",
-  /* info           */ "GPIO extender",
-  /* test function  */ utAlldPcal6524Func,
-  /* shell command  */ {
-    /* name     */ "unittest:GPIOExtender",
-    /* callback */ _utShellCmdCb_AlldPcal6524,
-    /* next     */ NULL,
-  },
-  /* data           */ &_utAlldPcal6524Data,
-};
+AOS_SHELL_COMMAND(moduleTestPcal6524ShellCmd, "test:GPIOExtenter", _testPcal6524ShellCmdCb);
 
 /*
  * AT42QT1050 (touch sensor)
  */
-static int _utShellCmdCb_AlldAt42qt1050(BaseSequentialStream* stream, int argc, char* argv[])
+#include <module_test_AT42QT1050.h>
+static int _testAt42qt1050ShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
 {
-  (void)argc;
-  (void)argv;
-  aosUtRun(stream, &moduleUtAlldAt42qt1050, NULL);
-  return AOS_OK;
+  return moduleTestAt42qt1050ShellCb(stream, argc, argv, NULL);
 }
-static ut_at42qt1050data_t _utAlldAt42qt1050Data= {
-  /* AT42QT1050 driver  */ &moduleLldTouch,
-  /* timeout            */ MICROSECONDS_PER_SECOND,
-  /* event source       */ &aos.events.io,
-  /* event flags        */ MODULE_OS_IOEVENTFLAGS_TOUCHINT,
-};
-aos_unittest_t moduleUtAlldAt42qt1050 = {
-  /* name           */ "AT42QT1050",
-  /* info           */ "touch sensor",
-  /* test function  */ utAlldAt42qt1050Func,
-  /* shell command  */ {
-    /* name     */ "unittest:Touch",
-    /* callback */ _utShellCmdCb_AlldAt42qt1050,
-    /* next     */ NULL,
-  },
-  /* data           */ &_utAlldAt42qt1050Data,
-};
+AOS_SHELL_COMMAND(moduleTestAt42qt1050ShellCmd, "test:Touch", _testAt42qt1050ShellCmdCb);
 
 #endif /* (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L0X) */
 
@@ -1375,78 +851,218 @@ aos_unittest_t moduleUtAlldAt42qt1050 = {
 /*
  * PCAL6524 (GPIO extender)
  */
-static int _utShellCmdCb_AlldPcal6524(BaseSequentialStream* stream, int argc, char* argv[])
+#include <module_test_PCAL6524.h>
+static int _testPcal6524ShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
 {
-  // evaluate arguments
-  if (argc == 2) {
-    if (strcmp(argv[1], "#1") == 0) {
-      ((ut_pcal6524data_t*)moduleUtAlldPcal6524.data)->pcal6524d = &moduleLldGpioExtender1;
-      aosUtRun(stream, &moduleUtAlldPcal6524, "I2C bus #1");
-      ((ut_pcal6524data_t*)moduleUtAlldPcal6524.data)->pcal6524d = NULL;
-      return AOS_OK;
-    }
-    else if (strcmp(argv[1], "#2") == 0) {
-      ((ut_pcal6524data_t*)moduleUtAlldPcal6524.data)->pcal6524d = &moduleLldGpioExtender2;
-      aosUtRun(stream, &moduleUtAlldPcal6524, "I2C bus #2");
-      ((ut_pcal6524data_t*)moduleUtAlldPcal6524.data)->pcal6524d = NULL;
-      return AOS_OK;
-    }
-  }
-  // print help
-  chprintf(stream, "Usage: %s OPTION\n", argv[0]);
-  chprintf(stream, "Options:\n");
-  chprintf(stream, "  #1\n");
-  chprintf(stream, "    Test the GPIO extender on the I2C bus #1.\n");
-  chprintf(stream, "  #2\n");
-  chprintf(stream, "    Test the GPIO extender on the I2C bus #2.\n");
-  return AOS_INVALIDARGUMENTS;
+  return moduleTestPcal6524ShellCb(stream, argc, argv, NULL);
 }
-static ut_pcal6524data_t _utAlldPcal6524Data = {
-  /* driver   */ NULL,
-  /* timeout  */ MICROSECONDS_PER_SECOND,
-};
-aos_unittest_t moduleUtAlldPcal6524 = {
-  /* name           */ "PCAL6524",
-  /* info           */ "GPIO extender",
-  /* test function  */ utAlldPcal6524Func,
-  /* shell command  */ {
-    /* name     */ "unittest:GPIOExtender",
-    /* callback */ _utShellCmdCb_AlldPcal6524,
-    /* next     */ NULL,
-  },
-  /* data           */ &_utAlldPcal6524Data,
-};
+AOS_SHELL_COMMAND(moduleTestPcal6524ShellCmd, "test:GPIOExtenter", _testPcal6524ShellCmdCb);
 
 /*
  * AT42QT1050 (touch sensor)
  */
-static int _utShellCmdCb_AlldAt42qt1050(BaseSequentialStream* stream, int argc, char* argv[])
+#include <module_test_AT42QT1050.h>
+static int _testAt42qt1050ShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
+{
+  return moduleTestAt42qt1050ShellCb(stream, argc, argv, NULL);
+}
+AOS_SHELL_COMMAND(moduleTestAt42qt1050ShellCmd, "test:Touch", _testAt42qt1050ShellCmdCb);
+
+#endif /* (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L1X) */
+
+/*
+ * entire module
+ */
+static int _testAllShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
 {
   (void)argc;
   (void)argv;
-  aosUtRun(stream, &moduleUtAlldAt42qt1050, NULL);
-  return AOS_OK;
-}
-static ut_at42qt1050data_t _utAlldAt42qt1050Data= {
-  /* AT42QT1050 driver  */ &moduleLldTouch,
-  /* timeout            */ MICROSECONDS_PER_SECOND,
-  /* event source       */ &aos.events.io,
-  /* event flags        */ MODULE_OS_IOEVENTFLAGS_TOUCHINT,
-};
-aos_unittest_t moduleUtAlldAt42qt1050 = {
-  /* name           */ "AT42QT1050",
-  /* info           */ "touch sensor",
-  /* test function  */ utAlldAt42qt1050Func,
-  /* shell command  */ {
-    /* name     */ "unittest:Touch",
-    /* callback */ _utShellCmdCb_AlldAt42qt1050,
-    /* next     */ NULL,
-  },
-  /* data           */ &_utAlldAt42qt1050Data,
-};
+
+  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};
+
+  /* ADC */
+  status |= moduleTestAdcShellCb(stream, 0, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+
+  /* AT24C01BN-SH-B (EEPROM) */
+  status |= moduleTestAt24c01bShellCb(stream, 0, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+
+  /* bq24103a (battery charger) */
+  // front
+  targv[1] = "-f";
+  status |= moduleTestBq241xxShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+  // rear
+  targv[1] = "-r";
+  status |= moduleTestBq241xxShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+  targv[1] = "";
+
+  /* bq27500 (fuel gauge) */
+  // front
+  targv[1] = "-f";
+  status |= moduleTestBq27500ShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+  // rear
+  targv[1] = "-r";
+  status |= moduleTestBq27500ShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+  targv[1] = "";
+
+  /* bq 27500 (fuel gauge) in combination with bq24103a (battery charger) */
+  // front
+  targv[1] = "-f";
+  status |= moduleTestBq27500Bq241xxShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+  // rear
+  targv[1] = "-r";
+  status |= moduleTestBq27500Bq241xxShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+  targv[1] = "";
+
+  /* INA219 (power monitor) */
+  // VDD
+  targv[1] = "VDD";
+  status |= moduleTestIna219ShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+  // VIO 1.8V
+  targv[1] = "VIO1.8";
+  status |= moduleTestIna219ShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+  // VIO 3.3V
+  targv[1] = "VIO3.3";
+  status |= moduleTestIna219ShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+  // VSYS 4.2V
+  targv[1] = "VSYS4.2";
+  status |= moduleTestIna219ShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+  // VIO 5.0V
+  targv[1] = "VIO5.0";
+  status |= moduleTestIna219ShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+  targv[1] = "";
+
+  /* status LED */
+  status |= moduleTestLedShellCb(stream, 0, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+
+  /* PKLCS1212E4001 (buzzer) */
+  status |= moduleTestPkxxxexxxShellCb(stream, 0, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+
+  /* TPS62113 (step-down converter) */
+  status |= moduleTestTps6211xShellCb(stream, 0, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+
+  /* TPS62113 (step-down converter) in combination with INA219 (power monitor) */
+  status |= moduleTestTps6211xIna219ShellCb(stream, 0, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+
+#if (BOARD_SENSORRING == BOARD_PROXIMITYSENSOR)
+
+  /* MPR121 (touch sensor) */
+  status |= moduleTestMpr121ShellCb(stream, 0, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+
+  /* PCA9544A (I2C multiplexer) */
+  // #1
+  targv[1] = "#1";
+  status |= moduleTestPca9544aShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+  // #2
+  targv[1] = "#2";
+  status |= moduleTestPca9544aShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+  targv[1] = "";
+
+  /* VCNL4020 (proximity sensor) */
+  // north-northeast
+  targv[1] = "-nne";
+  status |= moduleTestVcnl4020ShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+  // east-northeast
+  targv[1] = "-ene";
+  status |= moduleTestVcnl4020ShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+  // east-southeast
+  targv[1] = "-ese";
+  status |= moduleTestVcnl4020ShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+  // south-southeast
+  targv[1] = "-sse";
+  status |= moduleTestVcnl4020ShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+  // south-southwest
+  targv[1] = "-ssw";
+  status |= moduleTestVcnl4020ShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+  // west-southwest
+  targv[1] = "-wsw";
+  status |= moduleTestVcnl4020ShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+  // west-northwest
+  targv[1] = "-wnw";
+  status |= moduleTestVcnl4020ShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+  // west-northwest
+  targv[1] = "-nnw";
+  status |= moduleTestVcnl4020ShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+  targv[1] = "";
+
+#endif /* (BOARD_SENSORRING == BOARD_PROXIMITYSENSOR) */
+
+#if (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L0X)
+
+  /* PCAL6524 (GPIO extender) */
+  // #1
+  targv[1] = "#1";
+  status |= moduleTestPcal6524ShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+  // #2
+  targv[1] = "#2";
+  status |= moduleTestPcal6524ShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+  targv[1] = "";
+
+  /* AT42QT1050 (touch sensor) */
+  status |= moduleTestAt42qt1050ShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+
+#endif /* (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L0X) */
+
+#if (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L1X)
+
+  /* PCAL6524 (GPIO extender) */
+  // #1
+  targv[1] = "#1";
+  status |= moduleTestPcal6524ShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+  // #2
+  targv[1] = "#2";
+  status |= moduleTestPcal6524ShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
+  targv[1] = "";
+
+  /* AT42QT1050 (touch sensor) */
+  status |= moduleTestAt42qt1050ShellCb(stream, 2, targv, &result_test);
+  result_total = aosTestResultAdd(result_total, result_test);
 
 #endif /* (BOARD_SENSORRING == BOARD_DISTANCESENSOR_VL53L1X) */
 
+  // 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) */
 
 /** @} */
