From 3bfb1afe5c84099c4ae22f12ec91d6f59944b8a7 Mon Sep 17 00:00:00 2001 From: ReggaeMuffin <644950+reggaemuffin@users.noreply.github.com> Date: Mon, 5 Apr 2021 16:16:00 +0100 Subject: [PATCH 1/2] uucore: Start testing uucore Before this change we never ran tests on uucore itself meaning that is was not possible to test functions of the shared core, only their usage in the different binaries This change adds running uucore to our ci, which will increase coverage for the few doctests that exist and is extracted from #1988 where first tests for uucore will be introduced --- .github/workflows/CICD.yml | 13 ++++++++++++- README.md | 5 +++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index a1683ab83..cc0972bf9 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -150,7 +150,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: test - args: --features "feat_os_unix" + args: --features "feat_os_unix" -p uucore -p coreutils env: RUSTFLAGS: '-Awarnings' @@ -536,6 +536,17 @@ jobs: CARGO_UTILITY_LIST_OPTIONS="$(for u in ${UTILITY_LIST}; do echo "-puu_${u}"; done;)" echo set-output name=UTILITY_LIST::${UTILITY_LIST} echo ::set-output name=CARGO_UTILITY_LIST_OPTIONS::${CARGO_UTILITY_LIST_OPTIONS} + - name: Test uucore + uses: actions-rs/cargo@v1 + with: + command: test + args: ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} --no-fail-fast -p uucore + env: + CARGO_INCREMENTAL: '0' + RUSTC_WRAPPER: '' + RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort' + RUSTDOCFLAGS: '-Cpanic=abort' + # RUSTUP_TOOLCHAIN: ${{ steps.vars.outputs.TOOLCHAIN }} - name: Test uses: actions-rs/cargo@v1 with: diff --git a/README.md b/README.md index b6d265278..b2257b3fd 100644 --- a/README.md +++ b/README.md @@ -226,6 +226,11 @@ If you would prefer to test a select few utilities: $ cargo test --features "chmod mv tail" --no-default-features ``` +If you also want to test the core utilities: +```bash +$ cargo test -p uucore -p coreutils +``` + To debug: ```bash $ gdb --args target/debug/coreutils ls From 196bfebc8ba6817a13e35628842315474d14eebf Mon Sep 17 00:00:00 2001 From: ReggaeMuffin <644950+reggaemuffin@users.noreply.github.com> Date: Mon, 5 Apr 2021 16:27:26 +0100 Subject: [PATCH 2/2] uucore: add uucore testing to travis and cirrus --- .cirrus.yml | 2 +- .travis.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 3a34a933a..5d16dce92 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -11,4 +11,4 @@ task: - cargo build test_script: - . $HOME/.cargo/env - - cargo test + - cargo test -p uucore -p coreutils diff --git a/.travis.yml b/.travis.yml index 27525b5f2..389ba44b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,7 +56,7 @@ install: script: - cargo build $CARGO_ARGS --features "$FEATURES" - - if [ ! $REDOX ]; then cargo test $CARGO_ARGS --features "$FEATURES" --no-fail-fast; fi + - if [ ! $REDOX ]; then cargo test $CARGO_ARGS -p uucore -p coreutils --features "$FEATURES" --no-fail-fast; fi - if [ -n "$TEST_INSTALL" ]; then mkdir installdir_test; DESTDIR=installdir_test make install; [ `ls installdir_test/usr/local/bin | wc -l` -gt 0 ]; fi addons: