Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/develop bb53feda0 -> cd6087c6c


Don't show unittest package in "newt info"


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/9a826fd4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/9a826fd4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/9a826fd4

Branch: refs/heads/develop
Commit: 9a826fd48f7e6536ae212b604249729228fb5511
Parents: bb53fed
Author: Christopher Collins <[email protected]>
Authored: Wed Mar 16 18:51:55 2016 -0700
Committer: Christopher Collins <[email protected]>
Committed: Wed Mar 16 18:51:55 2016 -0700

----------------------------------------------------------------------
 newt/cli/project_cmds.go | 9 ++++++++-
 newt/cli/target_cmds.go  | 6 +++---
 2 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/9a826fd4/newt/cli/project_cmds.go
----------------------------------------------------------------------
diff --git a/newt/cli/project_cmds.go b/newt/cli/project_cmds.go
index c9a4ce7..7bf03b7 100644
--- a/newt/cli/project_cmds.go
+++ b/newt/cli/project_cmds.go
@@ -131,7 +131,14 @@ func infoRunCmd(cmd *cobra.Command, args []string) {
                if reqRepoName == "all" || reqRepoName == repoName {
                        packNames := []string{}
                        for _, pack := range *proj.PackageList()[repoName] {
-                               packNames = append(packNames, pack.Name())
+                               // Don't display the special unittest target; 
this is used
+                               // internally by newt, so the user doesn't need 
to know about
+                               // it.
+                               // XXX: This is a hack; come up with a better 
solution for
+                               // unit testing.
+                               if !strings.HasSuffix(pack.Name(), "/unittest") 
{
+                                       packNames = append(packNames, 
pack.Name())
+                               }
                        }
 
                        sort.Strings(packNames)

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/9a826fd4/newt/cli/target_cmds.go
----------------------------------------------------------------------
diff --git a/newt/cli/target_cmds.go b/newt/cli/target_cmds.go
index 1fcc7a6..975d3e5 100644
--- a/newt/cli/target_cmds.go
+++ b/newt/cli/target_cmds.go
@@ -89,9 +89,9 @@ func targetShowCmd(cmd *cobra.Command, args []string) {
                for name, _ := range target.GetTargets() {
                        // Don't display the special unittest target; this is 
used
                        // internally by newt, so the user doesn't need to know 
about it.
-                       // XXX: This is a hack; come up with a better solution 
for hiding
-                       // targets.
-                       if name != "targets/unittest" {
+                       // XXX: This is a hack; come up with a better solution 
for unit
+                       // testing.
+                       if !strings.HasSuffix(name, "/unittest") {
                                targetNames = append(targetNames, name)
                        }
                }

Reply via email to