summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-01-09 23:29:30 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-01-11 23:33:26 -0700
commitf6b4897e86ee68836794caa641cf0d4a93131c0f (patch)
tree34f0bb918db3506c88d2034b6b4bf73b7f9d1db8
parent1dcc029b2d25dc2d337de00262dfedecb7aa7fd1 (diff)
mv cmd/srv9p lib9p/tests/test_server # and supporting changes
-rw-r--r--.editorconfig4
-rw-r--r--CMakeLists.txt3
-rw-r--r--GNUmakefile4
-rw-r--r--cmd/srv9p/CMakeLists.txt42
-rw-r--r--lib9p/CMakeLists.txt6
-rw-r--r--lib9p/tests/test_server/CMakeLists.txt42
-rw-r--r--lib9p/tests/test_server/config/config.h (renamed from cmd/srv9p/config/config.h)0
-rw-r--r--lib9p/tests/test_server/main.c (renamed from cmd/srv9p/main.c)4
-rw-r--r--lib9p/tests/test_server/static/Documentation/x (renamed from cmd/srv9p/static/Documentation/x)0
-rw-r--r--lib9p/tests/test_server/static/README.md (renamed from cmd/srv9p/static/README.md)0
10 files changed, 54 insertions, 51 deletions
diff --git a/.editorconfig b/.editorconfig
index b95a6ff..88ea6cb 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,6 +1,6 @@
# .editorconfig - How files in sbc-harness should be formatted
#
-# Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com>
+# Copyright (C) 2024-2025 Luke T. Shumaker <lukeshu@lukeshu.com>
# SPDX-License-Identifier: AGPL-3.0-or-later
root = true
@@ -30,7 +30,7 @@ _mode = markdown
[*.9p{,.wip}]
_mode = 9p
-[{cmd/srv9p/static.h.gen,build-aux/embed-sources.h.gen}]
+[{lib9p/tests/test_server/static.h.gen,build-aux/embed-sources.h.gen}]
_mode = sh
[{build-aux/linux-errno.txt.gen,libusb/include/libusb/tusb_helpers.h.gen}]
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e4f4d91..0c2a9e5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
# CMakeLists.txt - Main per-platform build script for sbc-harness project
#
-# Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com>
+# Copyright (C) 2024-2025 Luke T. Shumaker <lukeshu@lukeshu.com>
# SPDX-License-Identifier: AGPL-3.0-or-later
cmake_minimum_required(VERSION 3.30)
@@ -138,4 +138,3 @@ add_subdirectory(lib9p)
add_subdirectory(lib9p_util)
add_subdirectory(cmd/sbc_harness)
-add_subdirectory(cmd/srv9p)
diff --git a/GNUmakefile b/GNUmakefile
index 571a30a..ab28ede 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -60,7 +60,7 @@ generate-clean:
# `build` and `check` ##########################################################
-platforms := $(shell sed -nE 's/if *\(PICO_PLATFORM STREQUAL "(.*)"\)/\1/p' cmd/*/CMakeLists.txt)
+platforms := rp2040 host # $(shell sed -nE 's/if *\(PICO_PLATFORM STREQUAL "(.*)"\)/\1/p' cmd/*/CMakeLists.txt)
build_types = Debug Release RelWithDebInfo MinSizeRel
build: $(foreach t,$(build_types),$(foreach p,$(platforms),build/$p-$t/build))
@@ -120,7 +120,7 @@ lint/unknown: lint/%:
@printf "%s: cannot lint unknown file type\n" $(sources_$*) >&2
lint/all: lint/%:
$(eval export sources_$*)
- @find $$(printf '%s\n' $${sources_$*} | grep -vE '^cmd/[^/]+/static/') \
+ @find $$(printf '%s\n' $${sources_$*} | grep -vE '^lib9p/tests/[^/]+/static/') \
-maxdepth 0 -type f | \
{ r=0; while read -r filename; do \
if ! grep -E -q 'Copyright \(C\) 202[4-9]((-|, )202[5-9])* Luke T. Shumaker' $$filename; then \
diff --git a/cmd/srv9p/CMakeLists.txt b/cmd/srv9p/CMakeLists.txt
deleted file mode 100644
index 0d8e320..0000000
--- a/cmd/srv9p/CMakeLists.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-# cmd/srv9p/CMakeLists.txt - Build script for srv9p test/dev executable
-#
-# Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com>
-# SPDX-License-Identifier: AGPL-3.0-or-later
-
-if (PICO_PLATFORM STREQUAL "host")
-
-# Compile ######################################################################
-
-add_library(srv9p_objs OBJECT
- main.c
-)
-target_include_directories(srv9p_objs PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/config)
-target_include_directories(srv9p_objs PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
-target_link_libraries(srv9p_objs
- libcr
- libcr_ipc
- libmisc
- lib9p
- lib9p_util
-)
-
-# Analyze the stack ############################################################
-
-add_stack_analysis(srv9p_stack.c srv9p_objs)
-
-# Link #########################################################################
-
-add_executable(srv9p)
-target_sources(srv9p PRIVATE
- srv9p_stack.c
- "$<TARGET_OBJECTS:srv9p_objs>"
-)
-
-# Embed ########################################################################
-
-target_embed_sources(srv9p_objs srv9p static.h
- static/README.md
- static/Documentation/x
-)
-
-endif()
diff --git a/lib9p/CMakeLists.txt b/lib9p/CMakeLists.txt
index 488cff9..86fde39 100644
--- a/lib9p/CMakeLists.txt
+++ b/lib9p/CMakeLists.txt
@@ -1,6 +1,6 @@
# lib9p/CMakeLists.txt - TODO
#
-# Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com>
+# Copyright (C) 2024-2025 Luke T. Shumaker <lukeshu@lukeshu.com>
# SPDX-License-Identifier: AGPL-3.0-or-later
add_library(lib9p INTERFACE)
@@ -15,3 +15,7 @@ target_link_libraries(lib9p INTERFACE
libmisc
libhw
)
+
+if (ENABLE_TESTS)
+ add_subdirectory(tests/test_server)
+endif()
diff --git a/lib9p/tests/test_server/CMakeLists.txt b/lib9p/tests/test_server/CMakeLists.txt
new file mode 100644
index 0000000..a107b75
--- /dev/null
+++ b/lib9p/tests/test_server/CMakeLists.txt
@@ -0,0 +1,42 @@
+# lib9p/tests/test_server/CMakeLists.txt - Build script for test_server executable
+#
+# Copyright (C) 2024-2025 Luke T. Shumaker <lukeshu@lukeshu.com>
+# SPDX-License-Identifier: AGPL-3.0-or-later
+
+if (PICO_PLATFORM STREQUAL "host")
+
+# Compile ######################################################################
+
+add_library(test_server_objs OBJECT
+ main.c
+)
+target_include_directories(test_server_objs PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/config)
+target_include_directories(test_server_objs PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+target_link_libraries(test_server_objs
+ libcr
+ libcr_ipc
+ libmisc
+ lib9p
+ lib9p_util
+)
+
+# Analyze the stack ############################################################
+
+add_stack_analysis(test_server_stack.c test_server_objs)
+
+# Link #########################################################################
+
+add_executable(test_server)
+target_sources(test_server PRIVATE
+ test_server_stack.c
+ "$<TARGET_OBJECTS:test_server_objs>"
+)
+
+# Embed ########################################################################
+
+target_embed_sources(test_server_objs test_server static.h
+ static/README.md
+ static/Documentation/x
+)
+
+endif()
diff --git a/cmd/srv9p/config/config.h b/lib9p/tests/test_server/config/config.h
index 4f8384e..4f8384e 100644
--- a/cmd/srv9p/config/config.h
+++ b/lib9p/tests/test_server/config/config.h
diff --git a/cmd/srv9p/main.c b/lib9p/tests/test_server/main.c
index b5cb122..adeba38 100644
--- a/cmd/srv9p/main.c
+++ b/lib9p/tests/test_server/main.c
@@ -1,6 +1,6 @@
-/* srv9p/main.c - Main entry point for test 9P server
+/* lib9p/tests/test_server/main.c - Main entry point for test 9P server
*
- * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com>
+ * Copyright (C) 2024-2025 Luke T. Shumaker <lukeshu@lukeshu.com>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
diff --git a/cmd/srv9p/static/Documentation/x b/lib9p/tests/test_server/static/Documentation/x
index 257cc56..257cc56 100644
--- a/cmd/srv9p/static/Documentation/x
+++ b/lib9p/tests/test_server/static/Documentation/x
diff --git a/cmd/srv9p/static/README.md b/lib9p/tests/test_server/static/README.md
index af5626b..af5626b 100644
--- a/cmd/srv9p/static/README.md
+++ b/lib9p/tests/test_server/static/README.md