still testing when in 'go.work' mode

This commit is contained in:
Jeff Carr 2024-12-15 08:47:03 -06:00
parent 08cc2e58db
commit 41b716d644
2 changed files with 19 additions and 19 deletions

View File

@ -1,6 +1,6 @@
VERSION = $(shell git describe --tags) VERSION = $(shell git describe --tags)
GUIVERSION = $(shell git describe --tags) GUIVERSION = $(shell git describe --tags)
BUILDTIME = $(shell date +%Y.%m.%d_%H%M) BUILDTIME = $(shell date +%s)
all: build all: build

View File

@ -20,6 +20,7 @@ func main() {
me = new(testMe) me = new(testMe)
me.startPwd, _ = os.Getwd() me.startPwd, _ = os.Getwd()
// don't run this anywhere important
me.forge = forgepb.Init() me.forge = forgepb.Init()
if me.forge.IsGoWork() { if me.forge.IsGoWork() {
log.Info() log.Info()
@ -39,6 +40,9 @@ func main() {
} }
} }
// make sure this is empty
me.forge = nil
me.testDir1 = "goclonetest" me.testDir1 = "goclonetest"
fullRun(me.testDir1) fullRun(me.testDir1)
@ -101,8 +105,8 @@ func prepBinary(testDir string, gopath string) {
os.Unsetenv("FORGE_CONFIG") os.Unsetenv("FORGE_CONFIG")
os.Unsetenv("FORGE_GOSRC") os.Unsetenv("FORGE_GOSRC")
runStrict(wd, []string{"sync"}) runStrict(wd, []string{"sync"})
runStrict(wd, []string{"/home/jcarr/go/bin/go-clone", "--recursive", gopath}) runStrict(wd, []string{"/home/jcarr/go/bin/go-clone", "--recursive", gopath, "--work"})
runStrict(wd, []string{"/home/jcarr/go/bin/go-clone", "--work"}) // runStrict(wd, []string{"/home/jcarr/go/bin/go-clone", "--work"})
} }
func buildBinary(testDir string, gopath string) { func buildBinary(testDir string, gopath string) {
@ -142,24 +146,20 @@ func runStrict(wd string, cmd []string) {
log.Info(wd, "running:", wd, cmd) log.Info(wd, "running:", wd, cmd)
// result := shell.Run(cmd) // result := shell.Run(cmd)
result := shell.RunRealtime(cmd) result := shell.RunRealtime(cmd)
if result.Exit != 0 {
log.Info("cmd failed", wd, cmd, err)
for i, line := range result.Stdout {
log.Info("STDOUT:", i, line)
}
for i, line := range result.Stderr {
log.Info("STDERR:", i, line)
}
os.Exit(-1)
}
if result.Error != nil { if result.Error != nil {
log.Info("cmd failed", wd, cmd, err) log.Info("cmd failed", wd, cmd, err)
for i, line := range result.Stdout { /*
log.Info("STDOUT:", i, line) for i, line := range result.Stdout {
} log.Info("STDOUT:", i, line)
for i, line := range result.Stderr { }
log.Info("STDERR:", i, line) for i, line := range result.Stderr {
} log.Info("STDERR:", i, line)
}
*/
os.Exit(-1)
}
if result.Exit != 0 {
log.Info("cmd failed", wd, cmd)
os.Exit(-1) os.Exit(-1)
} }
for i, line := range result.Stdout { for i, line := range result.Stdout {