@@ -335,44 +335,44 @@ set -x
335335mv include/lightningpp_new.hpp include/lightningpp.hpp
336336
337337if $RUN_CPP_TESTS ; then
338- # Finally, sanity-check the generated C and C++ bindings with demo apps:
339- # Naively run the C demo app:
340- gcc " $LOCAL_CFLAGS " -Wall -g -pthread demo.c target/debug/libldk.a -ldl -lm
341- ./a.out
342-
343- # And run the C++ demo app
344- if [ " $2 " = " true" ]; then
345- g++ " $LOCAL_CFLAGS " -std=c++11 -Wall -g -pthread demo.cpp -Ltarget/debug/ -lldk -ldl
346- LD_LIBRARY_PATH=target/debug/ ./a.out > /dev/null
347- fi
338+ # Finally, sanity-check the generated C and C++ bindings with demo apps:
339+ # Naively run the C demo app:
340+ gcc " $LOCAL_CFLAGS " -Wall -g -pthread demo.c target/debug/libldk.a -ldl -lm
341+ ./a.out
342+
343+ # And run the C++ demo app
344+ if [ " $2 " = " true" ]; then
345+ g++ " $LOCAL_CFLAGS " -std=c++11 -Wall -g -pthread demo.cpp -Ltarget/debug/ -lldk -ldl
346+ LD_LIBRARY_PATH=target/debug/ ./a.out > /dev/null
347+ fi
348348
349- # Finally, run the C++ demo app with our native networking library
350- # in valgrind to test memory model correctness and lack of leaks.
351- gcc " $LOCAL_CFLAGS " -fPIC -std=c99 -Wall -g -pthread -I../ldk-net ../ldk-net/ldk_net.c -c -o ldk_net.o
352- if [ " $2 " = " true" ]; then
353- 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
349+ # Finally, run the C++ demo app with our native networking library
350+ # in valgrind to test memory model correctness and lack of leaks.
351+ gcc " $LOCAL_CFLAGS " -fPIC -std=c99 -Wall -g -pthread -I../ldk-net ../ldk-net/ldk_net.c -c -o ldk_net.o
352+ if [ " $2 " = " true" ]; then
353+ 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
354354 if [ -x " $( which valgrind) " ] && [ " $( uname -m) " != " ppc64le" ]; then
355- valgrind --error-exitcode=4 --memcheck:leak-check=full --show-leak-kinds=all ./a.out
356- echo
357- else
358- echo " WARNING: Please install valgrind for more testing"
359- ./a.out
360- fi
361- fi
355+ valgrind --error-exitcode=4 --memcheck:leak-check=full --show-leak-kinds=all ./a.out
356+ echo
357+ else
358+ echo " WARNING: Please install valgrind for more testing"
359+ ./a.out
360+ fi
361+ fi
362362
363363
364- # Test a statically-linked C++ version, tracking the resulting binary size and runtime
365- # across debug, LTO, and cross-language LTO builds (using the same compiler each time).
366- if [ " $2 " = " true" ]; then
367- clang++ " $LOCAL_CFLAGS " -std=c++11 demo.cpp target/debug/libldk.a -ldl
368- strip ./a.out
369- time ./a.out
370- echo " C++ Bin size and runtime w/o optimization:"
371- ls -lha a.out
372- fi
364+ # Test a statically-linked C++ version, tracking the resulting binary size and runtime
365+ # across debug, LTO, and cross-language LTO builds (using the same compiler each time).
366+ if [ " $2 " = " true" ]; then
367+ clang++ " $LOCAL_CFLAGS " -std=c++11 demo.cpp target/debug/libldk.a -ldl
368+ strip ./a.out
369+ time ./a.out
370+ echo " C++ Bin size and runtime w/o optimization:"
371+ ls -lha a.out
372+ fi
373373
374374else
375- echo " Skipping tests!"
375+ echo " Skipping tests!"
376376fi
377377
378378function REALLY_PIN_CC {
0 commit comments