Continue working on the CMake build.
* CMakeLists.txt (SOURCES): Explicitly list all source files.
* test/CMakeLists.txt: New; module for unit tests.
git-svn-id: https://svn.apache.org/repos/asf/serf/trunk@1834249 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d913984..5ea6bd7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -35,11 +35,58 @@
"serf_bucket_util.h"
)
-file(GLOB SOURCES "src/*.c" "auth/*.c" "buckets/*.c" "protocols/*.c")
+set(SOURCES
+ "src/config_store.c"
+ "src/context.c"
+ "src/deprecated.c"
+ "src/incoming.c"
+ "src/logging.c"
+ "src/outgoing.c"
+ "src/outgoing_request.c"
+ "src/pump.c"
+ "src/ssltunnel.c"
+ "auth/auth.c"
+ "auth/auth_basic.c"
+ "auth/auth_digest.c"
+ "auth/auth_spnego.c"
+ "auth/auth_spnego_gss.c"
+ "auth/auth_spnego_sspi.c"
+ "buckets/aggregate_buckets.c"
+ "buckets/allocator.c"
+ "buckets/barrier_buckets.c"
+ "buckets/brotli_buckets.c"
+ "buckets/buckets.c"
+ "buckets/bwtp_buckets.c"
+ "buckets/chunk_buckets.c"
+ "buckets/copy_buckets.c"
+ "buckets/dechunk_buckets.c"
+ "buckets/deflate_buckets.c"
+ "buckets/event_buckets.c"
+ "buckets/fcgi_buckets.c"
+ "buckets/file_buckets.c"
+ "buckets/headers_buckets.c"
+ "buckets/hpack_buckets.c"
+ "buckets/http2_frame_buckets.c"
+ "buckets/iovec_buckets.c"
+ "buckets/limit_buckets.c"
+ "buckets/log_wrapper_buckets.c"
+ "buckets/mmap_buckets.c"
+ "buckets/prefix_buckets.c"
+ "buckets/request_buckets.c"
+ "buckets/response_body_buckets.c"
+ "buckets/response_buckets.c"
+ "buckets/simple_buckets.c"
+ "buckets/socket_buckets.c"
+ "buckets/split_buckets.c"
+ "buckets/ssl_buckets.c"
+ "protocols/fcgi_protocol.c"
+ "protocols/fcgi_stream.c"
+ "protocols/http2_protocol.c"
+ "protocols/http2_stream.c"
+)
+
if(WINDOWS)
set(SHARED_SOURCES "serf.rc")
-else(WINDOWS)
- set(SHARED_SOURCES)
endif(WINDOWS)
@@ -90,3 +137,5 @@
OUTPUT_NAME "serf-${SERF_MAJOR_VERSION}"
VERSION ${SERF_VERSION}
SOVERSION ${SERF_SOVERSION})
+
+add_subdirectory(test)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
new file mode 100644
index 0000000..be9e77a
--- /dev/null
+++ b/test/CMakeLists.txt
@@ -0,0 +1,41 @@
+# ===================================================================
+# 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.
+# ===================================================================
+
+
+set(TEST_ALL_SOURCES
+ "test_all.c"
+ "CuTest.c"
+ "test_util.c"
+ "test_context.c"
+ "test_buckets.c"
+ "test_auth.c"
+ "test_internal.c"
+ "test_server.c"
+ "mock_buckets.c"
+ "mock_sock_buckets.c"
+ "test_ssl.c"
+ "MockHTTPinC/MockHTTP.c"
+ "MockHTTPinC/MockHTTP_server.c"
+)
+
+add_definitions("-DMOCKHTTP_OPENSSL")
+add_executable(test_all ${TEST_ALL_SOURCES})
+add_dependencies(test_all SerfStatic)
+target_link_libraries(test_all SerfStatic ${DEPENDENCY_LIBRARIES})
+add_test(NAME test_all COMMAND test_all)