Skip to content

Commit

Permalink
Use go standard path for test data
Browse files Browse the repository at this point in the history
  • Loading branch information
dim committed Mar 12, 2016
1 parent eb78eed commit e80f790
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
*.rdb
.test/
testdata/*/
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
File renamed without changes.

0 comments on commit e80f790

Please sign in to comment.