mirror of
https://github.com/restic/restic.git
synced 2025-01-03 13:45:20 +00:00
Add integration tests
This commit is contained in:
parent
61f8169fa0
commit
aebfaec9c7
3 changed files with 15 additions and 13 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,5 +1,7 @@
|
||||||
/.gopath
|
/.gopath
|
||||||
/restic
|
/restic
|
||||||
|
/restic.debug
|
||||||
|
/dirdiff
|
||||||
cmd/dirdiff/dirdiff
|
cmd/dirdiff/dirdiff
|
||||||
cmd/gentestdata/gentestdata
|
cmd/gentestdata/gentestdata
|
||||||
cmd/restic/restic
|
cmd/restic/restic
|
||||||
|
|
19
Makefile
19
Makefile
|
@ -11,6 +11,9 @@ GOTESTFLAGS ?= -v
|
||||||
GOX_OS ?= linux darwin openbsd freebsd
|
GOX_OS ?= linux darwin openbsd freebsd
|
||||||
SFTP_PATH ?= /usr/lib/ssh/sftp-server
|
SFTP_PATH ?= /usr/lib/ssh/sftp-server
|
||||||
|
|
||||||
|
CMDS=$(patsubst cmd/%,%,$(wildcard cmd/*))
|
||||||
|
CMDS_DEBUG=$(patsubst %,%.debug,$(CMDS))
|
||||||
|
|
||||||
export GOPATH GOX_OS
|
export GOPATH GOX_OS
|
||||||
|
|
||||||
all: restic
|
all: restic
|
||||||
|
@ -19,16 +22,16 @@ all: restic
|
||||||
mkdir -p .gopath/src/github.com/restic
|
mkdir -p .gopath/src/github.com/restic
|
||||||
ln -sf ../../../.. .gopath/src/github.com/restic/restic
|
ln -sf ../../../.. .gopath/src/github.com/restic/restic
|
||||||
|
|
||||||
restic: .gopath
|
%: cmd/% .gopath
|
||||||
cd $(BASEPATH) && \
|
cd $(BASEPATH) && \
|
||||||
go build -a -ldflags "-s" -o restic ./cmd/restic
|
go build -a -ldflags "-s" -o $@ ./$<
|
||||||
|
|
||||||
restic.debug: .gopath
|
%.debug: cmd/% .gopath
|
||||||
cd $(BASEPATH) && \
|
cd $(BASEPATH) && \
|
||||||
go build -a -tags debug -o restic ./cmd/restic
|
go build -a -tags debug -ldflags "-s" -o $@ ./$<
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf .gopath restic *.cov restic_*
|
rm -rf .gopath $(CMDS) $(CMDS_DEBUG) *.cov restic_*
|
||||||
go clean ./...
|
go clean ./...
|
||||||
|
|
||||||
test: .gopath
|
test: .gopath
|
||||||
|
@ -43,7 +46,11 @@ gox: .gopath
|
||||||
cd $(BASEPATH) && \
|
cd $(BASEPATH) && \
|
||||||
gox -verbose -os "$(GOX_OS)" ./cmd/restic
|
gox -verbose -os "$(GOX_OS)" ./cmd/restic
|
||||||
|
|
||||||
test-integration: .gopath
|
test-integration: .gopath restic restic.debug dirdiff
|
||||||
|
# run testsuite
|
||||||
|
PATH=.:$(PATH) ./testsuite.sh
|
||||||
|
|
||||||
|
# run sftp integration tests
|
||||||
cd $(BASEPATH)/backend && \
|
cd $(BASEPATH)/backend && \
|
||||||
go test $(GOTESTFLAGS) -test.sftppath $(SFTP_PATH) ./...
|
go test $(GOTESTFLAGS) -test.sftppath $(SFTP_PATH) ./...
|
||||||
|
|
||||||
|
|
|
@ -2,18 +2,11 @@
|
||||||
|
|
||||||
# tempdir for binaries
|
# tempdir for binaries
|
||||||
export BASEDIR="$(mktemp --tmpdir --directory restic-testsuite-XXXXXX)"
|
export BASEDIR="$(mktemp --tmpdir --directory restic-testsuite-XXXXXX)"
|
||||||
export BINDIR="${BASEDIR}/bin"
|
|
||||||
export PATH="${BINDIR}:$PATH"
|
|
||||||
export DEBUG_LOG="${BASEDIR}/restic.log"
|
export DEBUG_LOG="${BASEDIR}/restic.log"
|
||||||
|
|
||||||
export TZ=UTC
|
export TZ=UTC
|
||||||
|
|
||||||
echo "restic testsuite basedir ${BASEDIR}"
|
echo "restic testsuite basedir ${BASEDIR}"
|
||||||
|
|
||||||
# build binaries
|
|
||||||
go build -a -o "${BINDIR}/restic" ./cmd/restic
|
|
||||||
go build -a -tags debug -o "${BINDIR}/restic.debug" ./cmd/restic
|
|
||||||
go build -a -o "${BINDIR}/dirdiff" ./cmd/dirdiff
|
|
||||||
|
|
||||||
# run tests
|
# run tests
|
||||||
testsuite/run.sh "$@"
|
testsuite/run.sh "$@"
|
||||||
|
|
Loading…
Reference in a new issue