From e80f790e7640c34e347cf4235aa5f8348a7f4c9c Mon Sep 17 00:00:00 2001 From: Dimitrij Denissenko Date: Sat, 12 Mar 2016 10:25:59 +0000 Subject: [PATCH] Use go standard path for test data --- .gitignore | 2 +- Makefile | 6 +++--- main_test.go | 6 +++--- {.test => testdata}/redis.conf | 0 4 files changed, 7 insertions(+), 7 deletions(-) rename {.test => testdata}/redis.conf (100%) diff --git a/.gitignore b/.gitignore index 5959942..ebfe903 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ *.rdb -.test/ +testdata/*/ diff --git a/Makefile b/Makefile index e9fdd93..03d8959 100644 --- a/Makefile +++ b/Makefile @@ -2,13 +2,13 @@ all: testdeps go test ./... -test.v -test.cpu=1,2,4 go test ./... -test.v -test.short -test.race -testdeps: .test/redis/src/redis-server +testdeps: testdata/redis/src/redis-server .PHONY: all test testdeps -.test/redis: +testdata/redis: mkdir -p $@ wget -qO- https://github.com/antirez/redis/archive/unstable.tar.gz | tar xvz --strip-components=1 -C $@ -.test/redis/src/redis-server: .test/redis +testdata/redis/src/redis-server: testdata/redis cd $< && make all diff --git a/main_test.go b/main_test.go index d298dd2..e1d65c6 100644 --- a/main_test.go +++ b/main_test.go @@ -171,12 +171,12 @@ func (p *redisProcess) Close() error { } var ( - redisServerBin, _ = filepath.Abs(filepath.Join(".test", "redis", "src", "redis-server")) - redisServerConf, _ = filepath.Abs(filepath.Join(".test", "redis.conf")) + redisServerBin, _ = filepath.Abs(filepath.Join("testdata", "redis", "src", "redis-server")) + redisServerConf, _ = filepath.Abs(filepath.Join("testdata", "redis.conf")) ) func redisDir(port string) (string, error) { - dir, err := filepath.Abs(filepath.Join(".test", "instances", port)) + dir, err := filepath.Abs(filepath.Join("testdata", "instances", port)) if err != nil { return "", err } diff --git a/.test/redis.conf b/testdata/redis.conf similarity index 100% rename from .test/redis.conf rename to testdata/redis.conf