You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/03/17 06:32:25 UTC

[53/56] [abbrv] incubator-mynewt-newt git commit: Don't show unittest package in "newt info"

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/master
Commit: 9a826fd48f7e6536ae212b604249729228fb5511
Parents: bb53fed
Author: Christopher Collins <cc...@apache.org>
Authored: Wed Mar 16 18:51:55 2016 -0700
Committer: Christopher Collins <cc...@apache.org>
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)
 			}
 		}