1 /*
2 * Copyright (c) 2018 Codecoup
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7 #include <zephyr/ztest.h>
8 #include "test_common.h"
9 #include "test_fat.h"
10 #include "test_littlefs.h"
11 #include "test_fs_shell.h"
12
ZTEST(multi_fs_fat_dir,test_multi_fs_fat)13 ZTEST(multi_fs_fat_dir, test_multi_fs_fat)
14 {
15 /*
16 * fat dir operation.
17 * These tests are order-dependent.
18 * They have to be executed in order.
19 */
20 test_fat_mkdir();
21 test_fat_readdir();
22 test_fat_rmdir();
23 }
ZTEST(multi_fs_fat_file,test_multi_fs_fat)24 ZTEST(multi_fs_fat_file, test_multi_fs_fat)
25 {
26 /*
27 * fat file operation.
28 * These tests are order-dependent.
29 * They have to be executed in order.
30 */
31 test_fat_open();
32 test_fat_write();
33 test_fat_read();
34 test_fat_close();
35 test_fat_unlink();
36 }
ZTEST(multi_fs_littlefs_dir,test_multi_fs_littlefs)37 ZTEST(multi_fs_littlefs_dir, test_multi_fs_littlefs)
38 {
39 /*
40 * littlefs dir operation.
41 * These tests are order-dependent.
42 * They have to be executed in order.
43 */
44 test_littlefs_mkdir();
45 test_littlefs_readdir();
46 test_littlefs_rmdir();
47 }
ZTEST(multi_fs_littlefs_file,test_multi_fs_littlefs)48 ZTEST(multi_fs_littlefs_file, test_multi_fs_littlefs)
49 {
50 /*
51 * littlefs file operation.
52 * These tests are order-dependent.
53 * They have to be executed in order.
54 */
55 test_littlefs_open();
56 test_littlefs_write();
57 test_littlefs_read();
58 test_littlefs_close();
59 test_littlefs_unlink();
60 }
multi_fs_fat_setup(void)61 static void *multi_fs_fat_setup(void)
62 {
63 test_clear_flash();
64 test_fat_mount();
65 return NULL;
66 }
multi_fs_littlefs_setup(void)67 static void *multi_fs_littlefs_setup(void)
68 {
69 test_clear_flash();
70 test_littlefs_mount();
71 return NULL;
72 }
73 ZTEST_SUITE(multi_fs_fat_dir, NULL, multi_fs_fat_setup, NULL, NULL, NULL);
74 ZTEST_SUITE(multi_fs_fat_file, NULL, NULL, NULL, NULL, NULL);
75 ZTEST_SUITE(multi_fs_littlefs_dir, NULL, multi_fs_littlefs_setup, NULL, NULL, NULL);
76 ZTEST_SUITE(multi_fs_littlefs_file, NULL, NULL, NULL, NULL, NULL);
77