Add first idea how to exec all the tests in the Makefile
This commit is contained in:
parent
c35b08b4dc
commit
12b6da5c90
1 changed files with 6 additions and 0 deletions
6
Makefile
6
Makefile
|
@ -4,12 +4,14 @@ bin = $@/target/debug/$@
|
||||||
doc-crate-toml=./.imag-documentation/Cargo.toml
|
doc-crate-toml=./.imag-documentation/Cargo.toml
|
||||||
|
|
||||||
ECHO=$(shell which echo) -e
|
ECHO=$(shell which echo) -e
|
||||||
|
BASH=$(shell which bash)
|
||||||
CARGO=$(shell which cargo)
|
CARGO=$(shell which cargo)
|
||||||
|
|
||||||
BINS=$(shell find -maxdepth 1 -name "imag-*" -type d)
|
BINS=$(shell find -maxdepth 1 -name "imag-*" -type d)
|
||||||
LIBS=$(shell find -maxdepth 1 -name "libimag*" -type d)
|
LIBS=$(shell find -maxdepth 1 -name "libimag*" -type d)
|
||||||
|
|
||||||
BIN_TARGETS=$(patsubst imag-%,,$(BINS))
|
BIN_TARGETS=$(patsubst imag-%,,$(BINS))
|
||||||
|
BIN_TARGET_TESTS=$(foreach x,$(BIN_TARGETS),$(x)-test)
|
||||||
LIB_TARGETS=$(LIBS)
|
LIB_TARGETS=$(LIBS)
|
||||||
LIB_TARGETS_TEST=$(foreach x,$(subst ./,,$(LIBS)),test-$(x))
|
LIB_TARGETS_TEST=$(foreach x,$(subst ./,,$(LIBS)),test-$(x))
|
||||||
TARGETS=$(BIN_TARGETS) $(LIB_TARGETS)
|
TARGETS=$(BIN_TARGETS) $(LIB_TARGETS)
|
||||||
|
@ -65,6 +67,10 @@ $(TARGETS): %: .FORCE
|
||||||
@$(ECHO) "\t[CARGO ]:\t$@"
|
@$(ECHO) "\t[CARGO ]:\t$@"
|
||||||
@$(CARGO) build --manifest-path ./$@/Cargo.toml
|
@$(CARGO) build --manifest-path ./$@/Cargo.toml
|
||||||
|
|
||||||
|
$(BIN_TARGET_TESTS): %: .FORCE
|
||||||
|
@$(ECHO) "\t[BINTEST]:\t$@"
|
||||||
|
$(shell find $(subst -test,,$@) -name "*test.sh" -exec $(BASH) {} \;)
|
||||||
|
|
||||||
$(RELEASE_TARGETS): %: .FORCE
|
$(RELEASE_TARGETS): %: .FORCE
|
||||||
@$(ECHO) "\t[RELEASE]:\t$(subst -release,,$@)"
|
@$(ECHO) "\t[RELEASE]:\t$(subst -release,,$@)"
|
||||||
@$(CARGO) build --release --manifest-path ./$(subst -release,,$@)/Cargo.toml
|
@$(CARGO) build --release --manifest-path ./$(subst -release,,$@)/Cargo.toml
|
||||||
|
|
Loading…
Reference in a new issue