]> granicus.if.org Git - esp-idf/commitdiff
unit test: add sd env and spi env for sdmmc
authorhouchenyao <houchenyao@espressif.com>
Fri, 11 Aug 2017 07:25:55 +0000 (15:25 +0800)
committerhouchenyao <houchenyao@espressif.com>
Tue, 22 Aug 2017 13:01:34 +0000 (21:01 +0800)
.gitlab-ci.yml
components/idf_test/integration_test/TestEnvAll.yml
components/idf_test/unit_test/TestEnvAll.yml
components/sdmmc/test/test_sd.c
tools/unit-test-app/components/unity/unity_platform.c

index 465a8c7106397875ea8e02b840fdb2e6b3317a58..c4b0ee0c0d28c8f9c404c9a31bb5c607c60d7d7f 100644 (file)
@@ -525,6 +525,18 @@ UT_001_04:
     - ESP32_IDF
     - UT_T1_1
 
+UT_001_05:
+  <<: *unit_test_template
+  tags:
+    - ESP32_IDF
+    - UT_T1_SDMODE
+
+UT_001_06:
+  <<: *unit_test_template
+  tags:
+    - ESP32_IDF
+    - UT_T1_SPIMODE
+
 IT_001_01:
   <<: *test_template
   tags:
index 33026a7d4cf860bef01007e8e2c5eae9645ced4f..6926a2dcdd03ebeda8afde39bdaff74de991ed6a 100644 (file)
@@ -272,6 +272,10 @@ test environment:
     通过 TTLcable 连到PC', test script: EnvBase}
 - {PC OS: '', Special: N, Target Count: 1.0, script path: EnvBase.py, tag: UT_T1_1,
   test environment detail: Environment for running ESP32 unit tests, test script: EnvBase}
+- {PC OS: '', Special: N, Target Count: 1.0, script path: EnvBase.py, tag: UT_T1_SDMODE,
+  test environment detail: Environment for running sd card sd mode unit tests, test script: EnvBase}
+- {PC OS: '', Special: N, Target Count: 1.0, script path: EnvBase.py, tag: UT_T1_SPIMODE,
+  test environment detail: Environment for running sd card spi mode unit tests, test script: EnvBase}
 - {PC OS: linux, Special: Y, Target Count: 1.0, script path: EnvBase.py, tag: WebServer_T1_1,
   test environment detail: 'Web Server target connect with PC by UART.
 
index b8a2a497c6505a39a5852e95d0850498e52a80ce..a6054cf512b59d3ac4bdbe5da315e18dc1ee4edd 100644 (file)
@@ -272,6 +272,10 @@ test environment:
     通过 TTLcable 连到PC', test script: EnvBase}
 - {PC OS: '', Special: N, Target Count: 1.0, script path: EnvBase.py, tag: UT_T1_1,
   test environment detail: Environment for running ESP32 unit tests, test script: EnvBase}
+- {PC OS: '', Special: N, Target Count: 1.0, script path: EnvBase.py, tag: UT_T1_SDMODE,
+  test environment detail: Environment for running sd card sd mode unit tests, test script: EnvBase}
+- {PC OS: '', Special: N, Target Count: 1.0, script path: EnvBase.py, tag: UT_T1_SPIMODE,
+  test environment detail: Environment for running sd card spi mode unit tests, test script: EnvBase}
 - {PC OS: linux, Special: Y, Target Count: 1.0, script path: EnvBase.py, tag: WebServer_T1_1,
   test environment detail: 'Web Server target connect with PC by UART.
 
index 86ff501b855a87b1dc29a6de84c950c324d48246..4bcce09be4281ec7f42b5430f4b11194cbc1e693 100644 (file)
@@ -27,7 +27,7 @@
 #include <sys/time.h>
 
 
-TEST_CASE("can probe SD", "[sd][ignore]")
+TEST_CASE("can probe SD", "[sd][test_env=UT_T1_SDMODE]")
 {
     sdmmc_host_t config = SDMMC_HOST_DEFAULT();
     sdmmc_slot_config_t slot_config = SDMMC_SLOT_CONFIG_DEFAULT();
@@ -41,7 +41,8 @@ TEST_CASE("can probe SD", "[sd][ignore]")
     free(card);
 }
 
-TEST_CASE("can probe SD (using SPI)", "[sdspi][ignore]")
+
+TEST_CASE("can probe SD(using SPI)", "[sdspi][test_env=UT_T1_SPIMODE]")
 {
     sdmmc_host_t config = SDSPI_HOST_DEFAULT();
     sdspi_slot_config_t slot_config = SDSPI_SLOT_CONFIG_DEFAULT();
@@ -136,7 +137,7 @@ static void read_write_test(sdmmc_card_t* card)
     do_single_write_read_test(card, card->csd.capacity/2, 128, 1);
 }
 
-TEST_CASE("can write and read back blocks", "[sd][ignore]")
+TEST_CASE("can write and read back blocks", "[sd][test_env=UT_T1_SDMODE]")
 {
     sdmmc_host_t config = SDMMC_HOST_DEFAULT();
     config.max_freq_khz = SDMMC_FREQ_HIGHSPEED;
@@ -151,7 +152,7 @@ TEST_CASE("can write and read back blocks", "[sd][ignore]")
     TEST_ESP_OK(sdmmc_host_deinit());
 }
 
-TEST_CASE("can write and read back blocks (using SPI)", "[sdspi][ignore]")
+TEST_CASE("can write and read back blocks(using SPI)", "[sdspi][test_env=UT_T1_SPIMODE]")
 {
     sdmmc_host_t config = SDSPI_HOST_DEFAULT();
     config.max_freq_khz = SDMMC_FREQ_HIGHSPEED;
@@ -166,11 +167,12 @@ TEST_CASE("can write and read back blocks (using SPI)", "[sdspi][ignore]")
     TEST_ESP_OK(sdspi_host_deinit());
 }
 
-TEST_CASE("reads and writes with an unaligned buffer", "[sd][ignore]")
+TEST_CASE("reads and writes with an unaligned buffer", "[sd][test_env=UT_T1_SDMODE]")
 {
     sdmmc_host_t config = SDMMC_HOST_DEFAULT();
-    TEST_ESP_OK(sdmmc_host_init());
     sdmmc_slot_config_t slot_config = SDMMC_SLOT_CONFIG_DEFAULT();
+    TEST_ESP_OK(sdmmc_host_init());
+
     TEST_ESP_OK(sdmmc_host_init_slot(SDMMC_HOST_SLOT_1, &slot_config));
     sdmmc_card_t* card = malloc(sizeof(sdmmc_card_t));
     TEST_ASSERT_NOT_NULL(card);
index 03d79d26bc99cc8786467e3dad5731264d84b494..9ee114fc67a11809fe06c19238516f37288220fb 100644 (file)
@@ -107,7 +107,7 @@ static void unity_run_single_test_by_name(const char* filter)
     tmp[strlen(filter) - 2] = 0;
     for (const struct test_desc_t* test = s_unity_tests_first; test != NULL; test = test->next)
     {
-        if (strstr(test->name, tmp) != NULL)
+        if (strcmp(test->name, tmp) == 0)
         {
             unity_run_single_test(test);
         }