}
static const char* test_filename = "/sdcard/hello.txt";
-static const char* test_filename_utf_8 = "/sdcard/测试文件.txt";
-TEST_CASE("Mount fails cleanly without card inserted", "[fatfs][ignore]")
+TEST_CASE("Mount fails cleanly without card inserted", "[fatfs][sd][ignore]")
{
size_t heap_size;
HEAP_SIZE_CAPTURE(heap_size);
};
for (int i = 0; i < 3; ++i) {
- printf("Initializing card, attempt %d ", i);
+ printf("Initializing card, attempt %d\n", i);
esp_err_t err = esp_vfs_fat_sdmmc_mount("/sdcard", &host, &slot_config, &mount_config, NULL);
- printf(" err=%d\n", err);
- TEST_ESP_ERR(ESP_FAIL, err);
+ printf("err=%d\n", err);
+ TEST_ESP_ERR(ESP_ERR_TIMEOUT, err);
}
HEAP_SIZE_CHECK(heap_size, 0);
}
-TEST_CASE("(SD) can create and write file", "[fatfs][sdcard][ignore]")
+TEST_CASE("(SD) can create and write file", "[fatfs][sd][test_env=UT_T1_SDMODE]")
{
test_setup();
test_fatfs_create_file_with_text(test_filename, fatfs_test_hello_str);
test_teardown();
}
-TEST_CASE("(SD) can read file", "[fatfs][ignore]")
+TEST_CASE("(SD) can read file", "[fatfs][test_env=UT_T1_SDMODE]")
{
test_setup();
test_fatfs_create_file_with_text(test_filename, fatfs_test_hello_str);
}
-TEST_CASE("(SD) overwrite and append file", "[fatfs][sdcard][ignore]")
+TEST_CASE("(SD) overwrite and append file", "[fatfs][sd][test_env=UT_T1_SDMODE]")
{
test_setup();
test_fatfs_overwrite_append(test_filename);
}
-TEST_CASE("(SD) can lseek", "[fatfs][sdcard][ignore]")
+TEST_CASE("(SD) can lseek", "[fatfs][sd][test_env=UT_T1_SDMODE]")
{
test_setup();
test_fatfs_lseek("/sdcard/seek.txt");
test_teardown();
}
-TEST_CASE("(SD) stat returns correct values", "[fatfs][ignore]")
+TEST_CASE("(SD) stat returns correct values", "[fatfs][test_env=UT_T1_SDMODE]")
{
test_setup();
test_fatfs_stat("/sdcard/stat.txt", "/sdcard");
test_teardown();
}
-TEST_CASE("(SD) unlink removes a file", "[fatfs][ignore]")
+TEST_CASE("(SD) unlink removes a file", "[fatfs][test_env=UT_T1_SDMODE]")
{
test_setup();
test_fatfs_unlink("/sdcard/unlink.txt");
test_teardown();
}
-TEST_CASE("(SD) link copies a file, rename moves a file", "[fatfs][ignore]")
+TEST_CASE("(SD) link copies a file, rename moves a file", "[fatfs][test_env=UT_T1_SDMODE]")
{
test_setup();
test_fatfs_link_rename("/sdcard/link");
test_teardown();
}
-TEST_CASE("(SD) can create and remove directories", "[fatfs][ignore]")
+TEST_CASE("(SD) can create and remove directories", "[fatfs][test_env=UT_T1_SDMODE]")
{
test_setup();
test_fatfs_mkdir_rmdir("/sdcard/dir");
test_teardown();
}
-TEST_CASE("(SD) can opendir root directory of FS", "[fatfs][ignore]")
+TEST_CASE("(SD) can opendir root directory of FS", "[fatfs][test_env=UT_T1_SDMODE]")
{
test_setup();
test_fatfs_can_opendir("/sdcard");
test_teardown();
}
-TEST_CASE("(SD) opendir, readdir, rewinddir, seekdir work as expected", "[fatfs][ignore]")
+TEST_CASE("(SD) opendir, readdir, rewinddir, seekdir work as expected", "[fatfs][test_env=UT_T1_SDMODE]")
{
test_setup();
test_fatfs_opendir_readdir_rewinddir("/sdcard/dir");
test_teardown();
}
-TEST_CASE("(SD) multiple tasks can use same volume", "[fatfs][ignore]")
+TEST_CASE("(SD) multiple tasks can use same volume", "[fatfs][test_env=UT_T1_SDMODE]")
{
test_setup();
test_fatfs_concurrent("/sdcard/f");
static void speed_test(void* buf, size_t buf_size, size_t file_size, bool write);
-TEST_CASE("(SD) write/read speed test", "[fatfs][sdcard][ignore]")
+TEST_CASE("(SD) write/read speed test", "[fatfs][sd][test_env=UT_T1_SDMODE]")
{
size_t heap_size;
HEAP_SIZE_CAPTURE(heap_size);
for (size_t i = 0; i < buf_size / 4; ++i) {
buf[i] = esp_random();
}
- const size_t file_size = 4 * 1024 * 1024;
+ const size_t file_size = 1 * 1024 * 1024;
speed_test(buf, 4 * 1024, file_size, true);
speed_test(buf, 8 * 1024, file_size, true);
TEST_ESP_OK(esp_vfs_fat_sdmmc_unmount());
}
-TEST_CASE("(SD) mount two FAT partitions, SDMMC and WL, at the same time", "[fatfs][sdcard][ignore]")
+TEST_CASE("(SD) mount two FAT partitions, SDMMC and WL, at the same time", "[fatfs][sd][test_env=UT_T1_SDMODE]")
{
esp_vfs_fat_sdmmc_mount_config_t mount_config = {
.format_if_mount_failed = true,
* Ensure that the text editor is UTF-8 compatible when compiling these tests.
*/
#if defined(CONFIG_FATFS_API_ENCODING_UTF_8) && (CONFIG_FATFS_CODEPAGE == 936)
-TEST_CASE("(SD) can read file using UTF-8 encoded strings", "[fatfs][ignore]")
+
+static const char* test_filename_utf_8 = "/sdcard/测试文件.txt";
+
+TEST_CASE("(SD) can read file using UTF-8 encoded strings", "[fatfs][sd][test_env=UT_T1_SDMODE]")
{
test_setup();
test_fatfs_create_file_with_text(test_filename_utf_8, fatfs_test_hello_str_utf);
test_fatfs_opendir_readdir_rewinddir_utf_8("/sdcard/目录");
test_teardown();
}
-#endif
+#endif // CONFIG_FATFS_API_ENCODING_UTF_8 && CONFIG_FATFS_CODEPAGE == 936