Skip to content

Commit

Permalink
Fix interop cpp tests
Browse files Browse the repository at this point in the history
  • Loading branch information
UnidenifiedUser committed Feb 8, 2024
1 parent 8b0d283 commit 94736e9
Show file tree
Hide file tree
Showing 4 changed files with 170 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ jobs:
- name: Run ping-pong-with-noise example
run: |
cargo run --manifest-path=examples/ping-pong_with-noise/Cargo.toml --bin ping_pong_with_noise -- 10
cargo run --manifest-path=examples/ping-pong-with-noise/Cargo.toml --bin ping_pong_with_noise -- 10
- name: Run ping-pong-without-noise example
run: |
cargo run --manifest-path=examples/ping-pong-without-noise/Cargo.toml --bin ping_pong_with_noise -- 10
cargo run --manifest-path=examples/ping-pong-without-noise/Cargo.toml --bin ping_pong_without_noise -- 10
10 changes: 6 additions & 4 deletions build_header.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
#! /bin/sh
#! /bin/sh

cargo install --version 0.20.0 cbindgen
cargo install --version 0.20.0 cbindgen

rm -f ./sv2.h
touch ./sv2.h

cd protocols
dir=${1:-protocols}

cd "$dir"
cbindgen --crate const_sv2 >> ../sv2.h
cbindgen --crate binary_codec_sv2 >> ../sv2.h
cbindgen --crate common_messages_sv2 >> ../sv2.h
cbindgen --crate template_distribution_sv2 >> ../sv2.h
cbindgen --crate codec_sv2 >> ../sv2.h
cbindgen --crate sv2_ffi >> ../sv2.h
cd ..
cd ..
9 changes: 7 additions & 2 deletions examples/interop-cpp/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ rm -f libsv2_ffi.a
rm -f a.out
rm -f sv2.h

cargo build --release -p sv2_ffi && cp ../../target/release/libsv2_ffi.a ./
../../build_header.sh
cargo build \
--manifest-path=../../protocols/Cargo.toml \
--release \
-p sv2_ffi && \
cp ../../protocols/target/release/libsv2_ffi.a ./

../../build_header.sh ../../protocols && mv ../../sv2.h .

g++ -I ./ ./template-provider/template-provider.cpp libsv2_ffi.a -lpthread -ldl

Expand Down
158 changes: 155 additions & 3 deletions utils/buffer/fuzz/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 94736e9

Please sign in to comment.