Пример #1
0
// Reads in the platform that we want to use and prepares for the tests
func main() {
	flag.Parse()
	deployP = platform.NewPlatform(platform_dst)
	if deployP == nil {
		dbg.Fatal("Platform not recognized.", platform_dst)
	}
	dbg.Lvl1("Deploying to", platform_dst)

	simulations := flag.Args()
	if len(simulations) == 0 {
		dbg.Fatal("Please give a simulation to run")
	}

	for _, simulation := range simulations {
		runconfigs := platform.ReadRunFile(deployP, simulation)

		if len(runconfigs) == 0 {
			dbg.Fatal("No tests found in", simulation)
		}
		deployP.Configure()

		if clean {
			deployP.Deploy(runconfigs[0])
			deployP.Cleanup()
		} else {
			logname := strings.Replace(filepath.Base(simulation), ".toml", "", 1)
			RunTests(logname, runconfigs)
		}
	}
}
Пример #2
0
func TestReadRunfile(t *testing.T) {
	dbg.TestOutput(testing.Verbose(), 2)
	tplat := &TPlat{}

	tmpfile := "/tmp/testrun.toml"
	err := ioutil.WriteFile(tmpfile, []byte(testfile), 0666)
	if err != nil {
		dbg.Fatal("Couldn't create file:", err)
	}

	tests := platform.ReadRunFile(tplat, tmpfile)
	dbg.Lvl2(tplat)
	dbg.Lvlf2("%+v\n", tests[0])
	if tplat.App != "sign" {
		dbg.Fatal("App should be 'sign'")
	}
	if len(tests) != 2 {
		dbg.Fatal("There should be 2 tests")
	}
	if tests[0].Get("machines") != "8" {
		dbg.Fatal("Machines = 8 has not been copied into RunConfig")
	}
}