From 91da25ff2b4197d8a4b9235187c14c237dd1bb1e Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Sun, 1 Jun 2014 11:26:58 -0700 Subject: [PATCH] Add a 'busytest' target to run uutils under the busybox testsuite It requires the BUSYBOX_SRC environment variable to be set, and optionally passes arguments to the busybox test runner with the RUNTEST_ARGS environment variable. Example: ``` make busytest MULTICALL=1 BUSYBOX_SRC=~/dev/busybox RUNTEST_ARGS=tr ``` --- Makefile | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 27f1c8112..26e6ccf32 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ include common.mk +SRC_DIR=$(shell pwd) + # Possible programs PROGS := \ base64 \ @@ -136,4 +138,23 @@ ifeq ($(MULTICALL), 1) $(foreach crate,$(CRATES),$(eval $(call CRATE_BUILD,$(crate),$(shell $(RUSTC) --crate-type rlib --crate-file-name --out-dir build $(crate)/$(crate).rs)))) endif -.PHONY: all test clean +# Test under the busybox testsuite +ifeq ($(MULTICALL), 1) +build/busybox: build/uutils + rm -f build/busybox + ln -s $(SRC_DIR)/build/uutils build/busybox + +ifeq ($(BUSYBOX_SRC),) +busytest: + @echo + @echo "To run \`busytest\` set BUSYBOX_SRC to the directory of the compiled busybox source code." + @echo "Optionally set RUNTEST_ARGS to arguments to pass to the busybox \`runtest\` program." + @echo + @false +else +busytest: build/busybox + (cd $(BUSYBOX_SRC)/testsuite && bindir=$(SRC_DIR)/build tstdir=$(BUSYBOX_SRC)/testsuite $(BUSYBOX_SRC)/testsuite/runtest $(RUNTEST_ARGS)) +endif +endif + +.PHONY: all test clean busytest