]> xenbits.xensource.com Git - people/gdunlap/xsatool.git/commitdiff
systemtest: Implement --build
authorGeorge Dunlap <george.dunlap@citrix.com>
Fri, 23 Jun 2017 16:34:02 +0000 (17:34 +0100)
committerGeorge Dunlap <george.dunlap@citrix.com>
Mon, 26 Jun 2017 11:21:56 +0000 (12:21 +0100)
Always run 'test-apply'; run 'test-build' afterwards if --build is specified.

Signed-off-by: George Dunlap <george.dunlap@citrix.com>
systemtest.go

index 19d0d8ee4a2a090409018b0fdb1f2aa0226bb3be..dc3147eb1b529219d4aced87d8a5d373605803c0 100644 (file)
@@ -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 {