forked from LaconicNetwork/kompose
add test targets to Makefile
This commit is contained in:
parent
3dd7689364
commit
6099428364
6
Makefile
6
Makefile
@ -22,3 +22,9 @@ binary-cross:
|
||||
|
||||
clean:
|
||||
./script/make.sh clean
|
||||
|
||||
test-unit:
|
||||
./script/make.sh test-unit
|
||||
|
||||
test-cmd:
|
||||
./script/make.sh test-cmd
|
||||
|
||||
3
script/test-cmd
Executable file
3
script/test-cmd
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
./script/test/cmd/tests.sh
|
||||
25
script/test-unit
Executable file
25
script/test-unit
Executable file
@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
find_dirs() {
|
||||
(
|
||||
find . -not \( \
|
||||
\( \
|
||||
-path './vendor/*' \
|
||||
\) -prune \
|
||||
\) -name '*_test.go' -print0 | xargs -0n1 dirname | sed 's|^\./||' | sort -u
|
||||
)
|
||||
}
|
||||
|
||||
TEST_FLAGS="-tags experimental -cover -coverprofile=cover.out"
|
||||
|
||||
if [ -z "$TEST_DIRS" ]; then
|
||||
TEST_DIRS=$(find_dirs '*_test.go')
|
||||
fi
|
||||
|
||||
TESTS_FAILED=()
|
||||
|
||||
set +e
|
||||
for dir in $TEST_DIRS; do
|
||||
go test ${TEST_FLAGS} "./${dir}"
|
||||
done
|
||||
Loading…
Reference in New Issue
Block a user