[lib][fs] move the existing test code into its own sub module lib/fs/test

No real functional change, just following the pattern of moving unittest
code into a sub module that is picked up by the build system when
WITH_TESTS is set.
This commit is contained in:
Travis Geiselbrecht
2024-04-23 23:48:22 -07:00
parent 78fa76a658
commit 9e9e7d3fe4
3 changed files with 14 additions and 5 deletions

View File

@@ -5,6 +5,9 @@ MODULE := $(LOCAL_DIR)
MODULE_SRCS += $(LOCAL_DIR)/debug.c
MODULE_SRCS += $(LOCAL_DIR)/fs.c
MODULE_SRCS += $(LOCAL_DIR)/shell.c
MODULE_SRCS += $(LOCAL_DIR)/test.c
ifeq ($(call TOBOOL,WITH_TESTS),true)
MODULE_DEPS += $(LOCAL_DIR)/test
endif
include make/module.mk

10
lib/fs/test/rules.mk Normal file
View File

@@ -0,0 +1,10 @@
LOCAL_DIR := $(GET_LOCAL_DIR)
MODULE := $(LOCAL_DIR)
MODULE_DEPS += lib/fs
MODULE_DEPS += lib/unittest
MODULE_SRCS += $(LOCAL_DIR)/test.c
include make/module.mk

View File

@@ -11,8 +11,6 @@
#include <string.h>
#include <string.h>
#include <stdio.h>
#if WITH_LIB_UNITTEST
#include <lib/unittest.h>
// returns true if the input path passed through the path normalization
@@ -109,5 +107,3 @@ BEGIN_TEST_CASE(fs_tests);
RUN_TEST(test_path_normalize);
RUN_TEST(test_stdio_fs);
END_TEST_CASE(fs_tests);
#endif // WITH_LIB_UNITTEST