Repository: incubator-mynewt-newt Updated Branches: refs/heads/master ca783a7dd -> 98b9a71dc
Support for Windows Path to fix newt test problems - Convert paths to slashes for paths returned from filepath.Dir and filepath.Glob to make newt test work correctly. Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/03416d7f Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/03416d7f Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/03416d7f Branch: refs/heads/master Commit: 03416d7f527d188d2f63d7b2f604ccb45b477cfa Parents: 25d8734 Author: cwanda <[email protected]> Authored: Mon May 1 05:34:04 2017 -0700 Committer: cwanda <[email protected]> Committed: Mon May 1 06:25:18 2017 -0700 ---------------------------------------------------------------------- newt/builder/selftest.go | 3 ++- newt/cli/build_cmds.go | 5 +++-- newt/toolchain/compiler.go | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/03416d7f/newt/builder/selftest.go ---------------------------------------------------------------------- diff --git a/newt/builder/selftest.go b/newt/builder/selftest.go index fc7268c..efa0e40 100644 --- a/newt/builder/selftest.go +++ b/newt/builder/selftest.go @@ -133,7 +133,8 @@ func (b *Builder) testOwner(bpkg *BuildPackage) *BuildPackage { curPath := bpkg.rpkg.Lpkg.BasePath() for { - parentPath := filepath.Dir(curPath) + parentPath := filepath.ToSlash(filepath.Dir(curPath)) + if parentPath == project.GetProject().BasePath || parentPath == "." { return nil } http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/03416d7f/newt/cli/build_cmds.go ---------------------------------------------------------------------- diff --git a/newt/cli/build_cmds.go b/newt/cli/build_cmds.go index 5fb7944..f2a4cc7 100644 --- a/newt/cli/build_cmds.go +++ b/newt/cli/build_cmds.go @@ -67,7 +67,7 @@ func testablePkgs() map[*pkg.LocalPackage]struct{} { // Next add first ancestor of each test package. for _, testPkgItf := range testPkgs { testPkg := testPkgItf.(*pkg.LocalPackage) - for cur := filepath.Dir(testPkg.BasePath()); cur != proj.BasePath; cur = filepath.Dir(cur) { + for cur := filepath.ToSlash(filepath.Dir(testPkg.BasePath())); cur != proj.BasePath; cur = filepath.ToSlash(filepath.Dir(cur)) { lpkg := pathLpkgMap[cur] if lpkg != nil && lpkg.Type() != pkg.PACKAGE_TYPE_UNITTEST { testablePkgMap[lpkg] = struct{}{} @@ -90,8 +90,9 @@ func pkgToUnitTests(pack *pkg.LocalPackage) []*pkg.LocalPackage { result := []*pkg.LocalPackage{} srcPath := pack.BasePath() for p, _ := range testablePkgs() { + dirPath := filepath.ToSlash(filepath.Dir(p.BasePath())) if p.Type() == pkg.PACKAGE_TYPE_UNITTEST && - filepath.Dir(p.BasePath()) == srcPath { + dirPath == srcPath { result = append(result, p) } http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/03416d7f/newt/toolchain/compiler.go ---------------------------------------------------------------------- diff --git a/newt/toolchain/compiler.go b/newt/toolchain/compiler.go index 2fe8bb7..b846ee2 100644 --- a/newt/toolchain/compiler.go +++ b/newt/toolchain/compiler.go @@ -749,6 +749,7 @@ func (c *Compiler) RecursiveCollectEntries(cType int, for _, ext := range exts { files, _ := filepath.Glob(c.srcDir + "/*." + ext) for _, file := range files { + file = filepath.ToSlash(file) entries = append(entries, CompilerJob{ Filename: file, Compiler: c,
