From 534843d476b243919a2696fcc7f77c2d04ec7cad Mon Sep 17 00:00:00 2001 From: yulin liang <64815511+yulin-liang@users.noreply.github.com> Date: Tue, 11 May 2021 12:55:06 -0700 Subject: [PATCH] Add test for spm build. (#26178) --- Package.swift | 9 +++++++++ test/spm_build/test.cc | 29 +++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 test/spm_build/test.cc diff --git a/Package.swift b/Package.swift index 66e4a740765..65a7a51d2bc 100644 --- a/Package.swift +++ b/Package.swift @@ -22,6 +22,8 @@ let package = Package( dependencies: [ .package( name: "abseil", + //TODO(yulinliang): Firebase abseil is too old, update the dependency + //when abseil repo supports SPM. url: "https://github.com/firebase/abseil-cpp-SwiftPM.git", .revision("05d8107f2971a37e6c77245b7c4c6b0a7e97bc99") ), @@ -140,6 +142,13 @@ let package = Package( .unsafeFlags(["-Wno-module-import-in-extern-c"]), ] ), + .testTarget( + name: "build-test", + dependencies: [ + "gRPC-cpp", + ], + path: "test/spm_build" + ), ], cLanguageStandard: .gnu11, cxxLanguageStandard: .cxx11 diff --git a/test/spm_build/test.cc b/test/spm_build/test.cc new file mode 100644 index 00000000000..2eab4acf0b3 --- /dev/null +++ b/test/spm_build/test.cc @@ -0,0 +1,29 @@ +/* + * + * Copyright 2021 gRPC authors. + * + * Licensed 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. + * + */ + +#include "grpcpp/channel.h" +#include "grpcpp/client_context.h" +#include "grpcpp/completion_queue.h" +#include "grpcpp/create_channel.h" +#include "grpcpp/generic/generic_stub.h" +#include "grpcpp/grpcpp.h" +#include "grpcpp/impl/codegen/grpc_library.h" +#include "grpcpp/support/byte_buffer.h" +#include "grpcpp/support/status.h" +#include "grpcpp/support/status_code_enum.h" +#include "grpcpp/support/string_ref.h"