Skip to content

Commit

Permalink
Fix indentation to use tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
tnull committed Jun 6, 2024
1 parent b81f532 commit ac0c537
Showing 1 changed file with 32 additions and 32 deletions.
64 changes: 32 additions & 32 deletions genbindings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -335,44 +335,44 @@ set -x
mv include/lightningpp_new.hpp include/lightningpp.hpp

if $RUN_CPP_TESTS; then
# Finally, sanity-check the generated C and C++ bindings with demo apps:
# Naively run the C demo app:
gcc "$LOCAL_CFLAGS" -Wall -g -pthread demo.c target/debug/libldk.a -ldl -lm
./a.out

# And run the C++ demo app
if [ "$2" = "true" ]; then
g++ "$LOCAL_CFLAGS" -std=c++11 -Wall -g -pthread demo.cpp -Ltarget/debug/ -lldk -ldl
LD_LIBRARY_PATH=target/debug/ ./a.out > /dev/null
fi
# Finally, sanity-check the generated C and C++ bindings with demo apps:
# Naively run the C demo app:
gcc "$LOCAL_CFLAGS" -Wall -g -pthread demo.c target/debug/libldk.a -ldl -lm
./a.out

# And run the C++ demo app
if [ "$2" = "true" ]; then
g++ "$LOCAL_CFLAGS" -std=c++11 -Wall -g -pthread demo.cpp -Ltarget/debug/ -lldk -ldl
LD_LIBRARY_PATH=target/debug/ ./a.out > /dev/null
fi

# Finally, run the C++ demo app with our native networking library
# in valgrind to test memory model correctness and lack of leaks.
gcc "$LOCAL_CFLAGS" -fPIC -std=c99 -Wall -g -pthread -I../ldk-net ../ldk-net/ldk_net.c -c -o ldk_net.o
if [ "$2" = "true" ]; then
g++ "$LOCAL_CFLAGS" -std=c++11 -Wall -g -pthread -DREAL_NET -I../ldk-net ldk_net.o demo.cpp target/debug/libldk.a -ldl -lm
# Finally, run the C++ demo app with our native networking library
# in valgrind to test memory model correctness and lack of leaks.
gcc "$LOCAL_CFLAGS" -fPIC -std=c99 -Wall -g -pthread -I../ldk-net ../ldk-net/ldk_net.c -c -o ldk_net.o
if [ "$2" = "true" ]; then
g++ "$LOCAL_CFLAGS" -std=c++11 -Wall -g -pthread -DREAL_NET -I../ldk-net ldk_net.o demo.cpp target/debug/libldk.a -ldl -lm
if [ -x "$(which valgrind)" ] && [ "$(uname -m)" != "ppc64le" ]; then
valgrind --error-exitcode=4 --memcheck:leak-check=full --show-leak-kinds=all ./a.out
echo
else
echo "WARNING: Please install valgrind for more testing"
./a.out
fi
fi
valgrind --error-exitcode=4 --memcheck:leak-check=full --show-leak-kinds=all ./a.out
echo
else
echo "WARNING: Please install valgrind for more testing"
./a.out
fi
fi


# Test a statically-linked C++ version, tracking the resulting binary size and runtime
# across debug, LTO, and cross-language LTO builds (using the same compiler each time).
if [ "$2" = "true" ]; then
clang++ "$LOCAL_CFLAGS" -std=c++11 demo.cpp target/debug/libldk.a -ldl
strip ./a.out
time ./a.out
echo " C++ Bin size and runtime w/o optimization:"
ls -lha a.out
fi
# Test a statically-linked C++ version, tracking the resulting binary size and runtime
# across debug, LTO, and cross-language LTO builds (using the same compiler each time).
if [ "$2" = "true" ]; then
clang++ "$LOCAL_CFLAGS" -std=c++11 demo.cpp target/debug/libldk.a -ldl
strip ./a.out
time ./a.out
echo " C++ Bin size and runtime w/o optimization:"
ls -lha a.out
fi

else
echo "Skipping tests!"
echo "Skipping tests!"
fi

function REALLY_PIN_CC {
Expand Down

0 comments on commit ac0c537

Please sign in to comment.