Skip to content

Commit

Permalink
Add support for running tests on OSX (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianBelloni authored Nov 13, 2024
1 parent e1d6fd8 commit 4c621e1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
10 changes: 9 additions & 1 deletion generate_bindings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,12 @@ GEN_DIR="dotnet-tests/UniffiCS/gen"
rm -rf "$GEN_DIR"
mkdir -p "$GEN_DIR"

target/debug/uniffi-bindgen-cs target/debug/libuniffi_fixtures.so --library --out-dir="$GEN_DIR" --no-format
libname=""

if [[ $(uname) == "Darwin" ]]; then
libname="libuniffi_fixtures.dylib"
else
libname="libuniffi_fixtures.so"
fi

target/debug/uniffi-bindgen-cs "target/debug/$libname" --library --out-dir="$GEN_DIR" --no-format
5 changes: 5 additions & 0 deletions test_bindings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,10 @@ SCRIPT_DIR="${SCRIPT_DIR:-$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>
SOLUTION_DIR="dotnet-tests"

export LD_LIBRARY_PATH="$SCRIPT_DIR/target/debug/:${LD_LIBRARY_PATH:-}"

if [[ $(uname) == "Darwin" ]]; then
export DYLD_LIBRARY_PATH="$SCRIPT_DIR/target/debug/:${DYLD_LIBRARY_PATH:-}"
fi

cd $SOLUTION_DIR
dotnet test -l "console;verbosity=normal"

0 comments on commit 4c621e1

Please sign in to comment.