Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests of subdirectories are not skipped #50

Closed
zyzjaffery opened this issue Sep 1, 2016 · 1 comment · Fixed by #52
Closed

tests of subdirectories are not skipped #50

zyzjaffery opened this issue Sep 1, 2016 · 1 comment · Fixed by #52

Comments

@zyzjaffery
Copy link

zyzjaffery commented Sep 1, 2016

I am using Mac. By looking at the source code, the '*_test.go' is in skip patterns by default.
However it doesn't work for tests in subdirectories (at least this is the case in Mac).

For example, if I run 'gas ./...' under /Users/xxx/Workspace/goprojects/src/a
then the results of the three patterns used in filelist.go are:

pathname: /Users/xxx/Workspace/goprojects/src/a/b/timeTransformer_test.go
pattern 1: _test.go - not matched
pattern 2: /Users/xxx/Workspace/goprojects/src/a/
_test.go - not matched
pattern 3: **/*_test.go - not matched

I think the quick fix is to make the third pattern join 'cwd' as well
// match file suffixes ie. *_test.go if matched, _ := filepath.Match(filepath.Join(cwd, "**", pattern), pathname); matched {

I've tested then the test in subdirectories is skip.

@aeneasr
Copy link

aeneasr commented Sep 10, 2016

I can confirm this on windows, see #51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants