Skip to content

Commit

Permalink
add separate step for only testing C apis
Browse files Browse the repository at this point in the history
  • Loading branch information
cwaldren-ld committed Aug 8, 2024
1 parent 2adc88c commit b5db523
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/hello-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,17 @@ jobs:
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
OPENSSL_ROOT_DIR: ${{ steps.install-openssl.outputs.OPENSSL_ROOT_DIR }}
- name: Dynamically Linked Hello Apps
- name: Dynamically Linked Hello Apps (C API only)
shell: bash
continue-on-error: true # TODO(SC-223804)
run: ./scripts/run-hello-apps.sh dynamic hello-c-client hello-cpp-client hello-c-server hello-cpp-server
run: ./scripts/run-hello-apps.sh dynamic hello-c-client hello-c-server
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
OPENSSL_ROOT_DIR: ${{ steps.install-openssl.outputs.OPENSSL_ROOT_DIR }}
- name: Dynamically Linked Hello Apps (C and C++ APIs)
shell: bash
continue-on-error: true # TODO(SC-223804)
run: ./scripts/run-hello-apps.sh dynamic-export-all-symbols hello-c-client hello-cpp-client hello-c-server hello-cpp-server
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
OPENSSL_ROOT_DIR: ${{ steps.install-openssl.outputs.OPENSSL_ROOT_DIR }}
16 changes: 12 additions & 4 deletions scripts/run-hello-apps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,26 @@
# Example:
# ./scripts/run-hello-apps.sh dynamic hello-cpp-client hello-c-client
#
# $1 is the linkage, either 'static' or 'dynamic'.
# $1 is the linkage, either 'static', 'dynamic', or 'dynamic-export-all-symbols'.
# The difference between the dynamic options is that 'dynamic' only exports the C API,
# whereas 'dynamic-export-all-symbols' exports all symbols (including C++, so we can link
# a dynamic C++ library in the hello example.)
# Subsequent arguments are cmake target names.

if [ "$1" != "static" ] && [ "$1" != "dynamic" ]
if [ "$1" != "static" ] && [ "$1" != "dynamic" ] && [ "$1" != "dynamic-export-all-symbols" ]
then
echo "Linkage must be specified ('static' or 'dynamic')"
echo "Linkage must be specified ('static', 'dynamic', or 'dynamic-export-all-symbols')"
exit 1
fi

dynamic_linkage="Off"
export_all_symbols="Off"

if [ "$1" == "dynamic" ]; then
dynamic_linkage="On"
elif [ "$1" == "dynamic-export-all-symbols" ]; then
dynamic_linkage="On"
export_all_symbols="On"
fi

shift
Expand All @@ -35,7 +43,7 @@ trap cleanup EXIT
cmake -G Ninja -D CMAKE_BUILD_TYPE=Release \
-D BUILD_TESTING=OFF \
-D LD_BUILD_SHARED_LIBS=$dynamic_linkage \
-D LD_BUILD_EXPORT_ALL_SYMBOLS=ON ..
-D LD_BUILD_EXPORT_ALL_SYMBOLS=$export_all_symbols ..

export LD_MOBILE_KEY="bogus"
export LD_SDK_KEY="bogus"
Expand Down

0 comments on commit b5db523

Please sign in to comment.