From: George Dunlap Date: Fri, 23 Jun 2017 16:34:02 +0000 (+0100) Subject: systemtest: Implement --build X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=dafb89bb790b4322f0529ee398568beb921da410;p=people%2Fgdunlap%2Fxsatool.git systemtest: Implement --build Always run 'test-apply'; run 'test-build' afterwards if --build is specified. Signed-off-by: George Dunlap --- diff --git a/systemtest.go b/systemtest.go index 19d0d8e..dc3147e 100644 --- a/systemtest.go +++ b/systemtest.go @@ -21,6 +21,7 @@ func (st *SystemTest) Errorf(s string, args ...interface{}) { var TestFlags struct { Clean bool + Build bool } type InitialTreeState map[Tree]*map[string]string @@ -444,10 +445,16 @@ func Story206SyncOne(st *SystemTest) (pass bool) { func Story206TestMaster(st *SystemTest) bool { fmt.Print(" xsatool 206 test (initial)\n") - if MainHarness("206", "test") != 0 { - st.Errorf("xsatool 206 test (initial - master) failed\n") + if MainHarness("206", "test-apply") != 0 { + st.Errorf("xsatool 206 test-apply (initial - master) failed\n") return false } + + if TestFlags.Build && MainHarness("206", "test-build") != 0 { + st.Errorf("xsatool 206 test-build (initial - master) failed\n") + return false + } + return true } @@ -497,7 +504,7 @@ func Story206(st *SystemTest) bool { } // Test only 'master' patches - if false && !Story206TestMaster(st) { + if !Story206TestMaster(st) { return false } @@ -519,6 +526,7 @@ func MainSystemTest(args []string) (ret int) { flags := flag.NewFlagSet("xsatool:systemtest", flag.ContinueOnError) flags.BoolVar(&TestFlags.Clean, "clean", false, "Delete and re-clone repository before test. Slower but more complete") + flags.BoolVar(&TestFlags.Build, "build", false, "Do builds.") if err := flags.Parse(args); err != nil { if err != flag.ErrHelp {