From c56ce78026c7f7c8cb0929ea96e4dc4abaf9cb20 Mon Sep 17 00:00:00 2001 From: xhd2015 Date: Sat, 23 Nov 2024 14:38:56 +0800 Subject: [PATCH] correctly recognize running from root --- cmd/xgo/test-explorer/run_session.go | 14 +++++++++----- cmd/xgo/version.go | 4 ++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/cmd/xgo/test-explorer/run_session.go b/cmd/xgo/test-explorer/run_session.go index eb06836c..3b266a40 100644 --- a/cmd/xgo/test-explorer/run_session.go +++ b/cmd/xgo/test-explorer/run_session.go @@ -246,6 +246,15 @@ func (c *runSession) Start() error { rootPath := c.path if len(rootPath) == 0 { + if len(itemPaths) > 0 { + rootPath = itemPaths[0] + } else { + rootPath = pathPrefix + } + } + + // the root path + if len(rootPath) == len(pathPrefix) { // trigger clear coverage if c.covController != nil { err := c.covController.Clear() @@ -253,11 +262,6 @@ func (c *runSession) Start() error { return fmt.Errorf("clear coverage: %w", err) } } - if len(itemPaths) > 0 { - rootPath = itemPaths[0] - } else { - rootPath = pathPrefix - } } plainMsgBuilder := func(line []byte) ([]*TestingItemEvent, error) { diff --git a/cmd/xgo/version.go b/cmd/xgo/version.go index 61c4e984..5831215d 100644 --- a/cmd/xgo/version.go +++ b/cmd/xgo/version.go @@ -6,8 +6,8 @@ import "fmt" // VERSION is manually updated when needed a new tag // see also runtime/core/version.go const VERSION = "1.0.52" -const REVISION = "a6f0088f2e43fe837c905792459dfca4e1022a0b+1" -const NUMBER = 324 +const REVISION = "4123ef9cd711daea863cd3cf319989a581debaad+1" +const NUMBER = 325 // the matching runtime/core's version // manually updated