Skip to content

Commit

Permalink
Try another way of doing runfiles
Browse files Browse the repository at this point in the history
This might make windows work?
  • Loading branch information
achew22 committed Jun 9, 2020
1 parent fbdb8a6 commit fab8811
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions gazelle/gazelle_test.go
Expand Up @@ -29,19 +29,18 @@ import (

var gazellePath = findGazelle()

const base = "gazelle/testdata"

// TestGazelleBinary runs a gazelle binary with starlib installed on each
// directory in `testdata/*`. Please see `testdata/README.md` for more
// information on each test.
func TestGazelleBinary(t *testing.T) {
testdata, err := bazel.Runfile(base)
runfilesPath, err := bazel.RunfilesPath()
if err != nil {
t.Errorf("bazel.Runfile(%q) error: %v", base, err)
t.Fatalf("bazel.RunfilesPath() error: %v", err)
}
testdata := filepath.Join(runfilesPath, "gazelle", "testdata")
ds, err := ioutil.ReadDir(testdata)
if err != nil {
t.Errorf("ioutil.ReadDir(%q) error: %v", testdata, err)
t.Fatalf("ioutil.ReadDir(%q) error: %v", testdata, err)
}
for _, d := range ds {
if d.IsDir() {
Expand Down

0 comments on commit fab8811

Please sign in to comment.