From 9ab8bb5db5301f733bbbcfed213fde435d7409d7 Mon Sep 17 00:00:00 2001 From: Theophile Trunck Date: Wed, 10 Mar 2021 23:13:57 +0100 Subject: [PATCH 1/3] Fix make busytest The binary was rename from uutils to coreutils in that commit 52ae491fcdd2cd9bd56fb56fae8270c399654dcd but the makefile to run the busybox test wasn't updated This commit update the makefile to use the correct binary name. It also update the busybox to the 1.32.1 version and fix the makefile to run all the busybox tests instead of stopping after the failed exe --- GNUmakefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 28044f5f6..8b8a4cf36 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -41,7 +41,7 @@ PKG_BUILDDIR := $(BUILDDIR)/deps DOCSDIR := $(BASEDIR)/docs BUSYBOX_ROOT := $(BASEDIR)/tmp -BUSYBOX_VER := 1.24.1 +BUSYBOX_VER := 1.32.1 BUSYBOX_SRC := $(BUSYBOX_ROOT)/busybox-$(BUSYBOX_VER) # Possible programs @@ -228,7 +228,7 @@ endif define TEST_BUSYBOX test_busybox_$(1): - (cd $(BUSYBOX_SRC)/testsuite && bindir=$(BUILDDIR) ./runtest $(RUNTEST_ARGS) $(1) ) + -(cd $(BUSYBOX_SRC)/testsuite && bindir=$(BUILDDIR) ./runtest $(RUNTEST_ARGS) $(1)) endef # Output names @@ -276,7 +276,7 @@ $(BUILDDIR)/.config: $(BASEDIR)/.busybox-config # Test under the busybox testsuite $(BUILDDIR)/busybox: busybox-src build-uutils $(BUILDDIR)/.config - cp $(BUILDDIR)/uutils $(BUILDDIR)/busybox; \ + cp $(BUILDDIR)/coreutils $(BUILDDIR)/busybox; \ chmod +x $@; ifeq ($(EXES),) From 8bafcbab7ae3c99a5bedbacaf83ff3cbe2b93c05 Mon Sep 17 00:00:00 2001 From: Theophile Trunck Date: Wed, 10 Mar 2021 23:52:33 +0100 Subject: [PATCH 2/3] Update the binary usage to match busybox New tests in busybox are based on the fact that the function appears in the usage of the busybox binary. Because the tests are searching for an exact string they don't see the function defined by coreutils. By using the exact same string as busybox we can now also run the new busybox tests --- src/bin/coreutils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/coreutils.rs b/src/bin/coreutils.rs index b172edbd3..7fc494020 100644 --- a/src/bin/coreutils.rs +++ b/src/bin/coreutils.rs @@ -19,7 +19,7 @@ include!(concat!(env!("OUT_DIR"), "/uutils_map.rs")); fn usage(utils: &UtilityMap, name: &str) { println!("{} {} (multi-call binary)\n", name, VERSION); println!("Usage: {} [function [arguments...]]\n", name); - println!("Currently defined functions/utilities:\n"); + println!("Currently defined functions:\n"); #[allow(clippy::map_clone)] let mut utils: Vec<&str> = utils.keys().map(|&s| s).collect(); utils.sort_unstable(); From 0ac5dbe44d8d18f274e7a4b365af312e7b02cf27 Mon Sep 17 00:00:00 2001 From: Theophile Trunck Date: Sun, 14 Mar 2021 20:30:53 +0100 Subject: [PATCH 3/3] Add CICD for busytest --- .github/workflows/CICD.yml | 27 +++++++++++++++++++++++++++ GNUmakefile | 2 ++ 2 files changed, 29 insertions(+) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index bdc964c42..97369a8e7 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -154,6 +154,33 @@ jobs: env: RUSTFLAGS: '-Awarnings' + busybox_test: + name: Busybox test suite + runs-on: ${{ matrix.job.os }} + strategy: + fail-fast: false + matrix: + job: + - { os: ubuntu-latest } + steps: + - uses: actions/checkout@v1 + - name: Install `rust` toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + default: true + profile: minimal # minimal component installation (ie, no documentation) + - name: "prepare busytest" + shell: bash + run: | + make prepare-busytest + - name: "run busybox testsuite" + shell: bash + run: | + bindir=$(pwd)/target/debug + cd tmp/busybox-*/testsuite + S=$(bindir=$bindir ./runtest) && printf "%s\n" "$S" || { printf "%s\n" "$S" | grep "FAIL:" | sed -e "s/FAIL: /::warning ::Test failure:/g" ; } + build: name: Build runs-on: ${{ matrix.job.os }} diff --git a/GNUmakefile b/GNUmakefile index 8b8a4cf36..c4c9cbe8b 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -279,6 +279,8 @@ $(BUILDDIR)/busybox: busybox-src build-uutils $(BUILDDIR)/.config cp $(BUILDDIR)/coreutils $(BUILDDIR)/busybox; \ chmod +x $@; +prepare-busytest: $(BUILDDIR)/busybox + ifeq ($(EXES),) busytest: else