Skip to content

Commit

Permalink
move library tests out of run_test.{sh,bat} and expand
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed Sep 4, 2022
1 parent 52f1276 commit 80701ab
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 16 deletions.
27 changes: 27 additions & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
{% set version = "1.48.1" %}

{% set libraries = [
"address_sorting", "gpr", "grpc++", "grpc++_unsecure",
"grpc", "grpc_unsecure", "upb"
] %}
{% set binaries_plugin_langs = [
"cpp", "csharp", "node", "objective_c", "php", "python", "ruby"
] %}

package:
name: grpc-split
version: {{ version }}
Expand Down Expand Up @@ -73,6 +81,25 @@ outputs:
- cmake $CMAKE_ARGS . # [unix and (build_platform == target_platform)]
- cmake %CMAKE_ARGS% . # [win]

# libraries
{% for each_lib in libraries %}
# presence of shared libs (unix)
- test -f $PREFIX/lib/lib{{ each_lib }}.so # [linux]
- test -f $PREFIX/lib/lib{{ each_lib }}.dylib # [osx]

# absence of static libs (unix)
- test ! -f $PREFIX/lib/lib{{ each_lib }}.a # [unix]

# static libs on windows
- if not exist %LIBRARY_LIB%\{{ each_lib }}.lib exit 1 # [win]
{% endfor %}

# binaries
{% for each_lang in binaries_plugin_langs %}
- test -f $PREFIX/bin/grpc_{{ each_lang }}_plugin # [unix]
- if not exist %LIBRARY_BIN%\grpc_{{ each_lang }}_plugin.exe exit 1 # [win]
{% endfor %}

- name: grpcio
script: build-grpcio.sh # [not win]
script: build-grpcio.bat # [win]
Expand Down
9 changes: 1 addition & 8 deletions recipe/run_test.bat
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
@echo on

@rem Compile a trivial service definition to C++

protoc -I%RECIPE_DIR% --plugin=protoc-gen-grpc=%LIBRARY_PREFIX%/bin/grpc_cpp_plugin.exe --grpc_out=. hello.proto || exit /B

if errorlevel 1 exit 1
if %ERRORLEVEL% neq 0 exit 1

if not exist hello.grpc.pb.h exit 1
if not exist hello.grpc.pb.cc exit 1

if not exist %PREFIX%\\Library\\lib\\address_sorting.lib exit 1
if not exist %PREFIX%\\Library\\lib\\gpr.lib exit 1
if not exist %PREFIX%\\Library\\lib\\grpc.lib exit 1
if not exist %PREFIX%\\Library\\lib\\grpc++.lib exit 1
8 changes: 0 additions & 8 deletions recipe/run_test.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
#!/bin/bash

set -ex

# Compile a trivial service definition to C++

if [[ "${build_platform}" == "${target_platform}" ]]; then
protoc -I$RECIPE_DIR --plugin=protoc-gen-grpc=$PREFIX/bin/grpc_cpp_plugin --grpc_out=. hello.proto
test -f hello.grpc.pb.h
test -f hello.grpc.pb.cc
fi

test -f $PREFIX/bin/grpc_cpp_plugin
test -f $PREFIX/lib/libgrpc${SHLIB_EXT}
test -f $PREFIX/lib/libgrpc_unsecure${SHLIB_EXT}
test -f $PREFIX/lib/libgrpc++${SHLIB_EXT}
test -f $PREFIX/lib/libgrpc++_unsecure${SHLIB_EXT}

0 comments on commit 80701ab

Please sign in to comment.