This is an automated email from the ASF dual-hosted git repository.
bneradt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new e3f2368a82 Build prefetch plugin and test in CMake build (#9954)
e3f2368a82 is described below
commit e3f2368a82abc5e27535d07cb4ef385df5f5a6b1
Author: JosiahWI <[email protected]>
AuthorDate: Wed Jul 5 15:03:51 2023 -0500
Build prefetch plugin and test in CMake build (#9954)
This builds the prefetch plugin and its Catch2 unit test. It
introduces a new project() directive for convenience; the test
executable can refer to source files relative to the plugin root.
---
plugins/CMakeLists.txt | 1 +
plugins/prefetch/CMakeLists.txt | 33 +++++++++++++++++++++++++++++++++
plugins/prefetch/test/CMakeLists.txt | 28 ++++++++++++++++++++++++++++
3 files changed, 62 insertions(+)
diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
index aaac10a2fa..362fd66e79 100644
--- a/plugins/CMakeLists.txt
+++ b/plugins/CMakeLists.txt
@@ -44,6 +44,7 @@ add_subdirectory(esi)
add_subdirectory(generator)
add_subdirectory(header_rewrite)
add_subdirectory(multiplexer)
+add_subdirectory(prefetch)
add_subdirectory(xdebug)
if(HOST_OS STREQUAL "linux")
diff --git a/plugins/prefetch/CMakeLists.txt b/plugins/prefetch/CMakeLists.txt
new file mode 100644
index 0000000000..f785ec8489
--- /dev/null
+++ b/plugins/prefetch/CMakeLists.txt
@@ -0,0 +1,33 @@
+#######################
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
contributor license
+# agreements. See the NOTICE file distributed with this work for additional
information regarding
+# copyright ownership. The ASF licenses this file to you under the Apache
License, Version 2.0
+# (the "License"); you may not use this file except in compliance with the
License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
distributed under the License
+# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express
+# or implied. See the License for the specific language governing permissions
and limitations under
+# the License.
+#
+#######################
+
+project(prefetch)
+
+add_atsplugin(prefetch
+ common.cc
+ configs.cc
+ evaluate.cc
+ fetch.cc
+ fetch_policy.cc
+ fetch_policy_simple.cc
+ fetch_policy_lru.cc
+ headers.cc
+ pattern.cc
+ plugin.cc
+)
+
+add_subdirectory(test)
diff --git a/plugins/prefetch/test/CMakeLists.txt
b/plugins/prefetch/test/CMakeLists.txt
new file mode 100644
index 0000000000..0cb7b6226b
--- /dev/null
+++ b/plugins/prefetch/test/CMakeLists.txt
@@ -0,0 +1,28 @@
+#######################
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
contributor license
+# agreements. See the NOTICE file distributed with this work for additional
information regarding
+# copyright ownership. The ASF licenses this file to you under the Apache
License, Version 2.0
+# (the "License"); you may not use this file except in compliance with the
License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
distributed under the License
+# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express
+# or implied. See the License for the specific language governing permissions
and limitations under
+# the License.
+#
+#######################
+
+add_executable(test_evaluate
+ test_evaluate.cc
+ "${PROJECT_SOURCE_DIR}/common.cc"
+ "${PROJECT_SOURCE_DIR}/evaluate.cc"
+)
+
+target_link_libraries(test_evaluate PRIVATE catch2::catch2)
+
+target_compile_definitions(test_evaluate PRIVATE PREFETCH_UNIT_TEST)
+
+add_test(NAME test_evaluate COMMAND test_evaluate)