From e212d7429803833f01c98284a3607dcf58bcc134 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sat, 17 Aug 2024 20:18:31 +0000 Subject: [PATCH] Somewhat clean up `ci-tests.sh` and sort by `RUSTFLAGS` --- ci/ci-tests.sh | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/ci/ci-tests.sh b/ci/ci-tests.sh index d41c86310..d6c8f0517 100755 --- a/ci/ci-tests.sh +++ b/ci/ci-tests.sh @@ -80,23 +80,26 @@ done echo -e "\n\nTesting no-std builds" for DIR in lightning-invoice lightning-rapid-gossip-sync; do cargo test -p $DIR --verbose --color always --no-default-features - # check if there is a conflict between no-std and the c_bindings cfg - RUSTFLAGS="$RUSTFLAGS --cfg=c_bindings" cargo test -p $DIR --verbose --color always --no-default-features done -echo -e "\n\nTesting no-std flags in various combinations" -for DIR in lightning; do - cargo test -p $DIR --verbose --color always --no-default-features --features no-std - # check if there is a conflict between no-std and the default std feature - cargo test -p $DIR --verbose --color always --features no-std -done +cargo test -p lightning --verbose --color always --no-default-features --features no-std +# check if there is a conflict between no-std and the default std feature +cargo test -p lightning --verbose --color always --features no-std + +echo -e "\n\nTesting c_bindings builds" +RUSTFLAGS="$RUSTFLAGS --cfg=c_bindings" cargo test --verbose --color always -for DIR in lightning; do +for DIR in lightning-invoice lightning-rapid-gossip-sync; do # check if there is a conflict between no-std and the c_bindings cfg - RUSTFLAGS="$RUSTFLAGS --cfg=c_bindings" cargo test -p $DIR --verbose --color always --no-default-features --features=no-std + RUSTFLAGS="$RUSTFLAGS --cfg=c_bindings" cargo test -p $DIR --verbose --color always --no-default-features done -RUSTFLAGS="$RUSTFLAGS --cfg=c_bindings" cargo test --verbose --color always +# Note that because `$RUSTFLAGS` is not passed through to doctest builds we cannot selectively +# disable tests in `c_bindings` so we skip doctests entirely here. +RUSTFLAGS="$RUSTFLAGS --cfg=c_bindings" cargo test -p lightning-background-processor --verbose --color always --features futures --no-default-features --lib --bins --tests +RUSTFLAGS="$RUSTFLAGS --cfg=c_bindings" cargo test -p lightning --verbose --color always --no-default-features --features=no-std + +echo -e "\n\nTesting other crate-specific builds" # Note that outbound_commitment_test only runs in this mode because of hardcoded signature values cargo test -p lightning --verbose --color always --no-default-features --features=std,_test_vectors # This one only works for lightning-invoice -- 2.39.5