Esempio n. 1
0
func main() {
	// Parse flags and print Usage if `-tests` flag is empty.
	parseFlags()

	// Load tests from file
	tests, err := testutils.ReadTests(dirname)
	if err != nil {
		l.Fatal(err)
	}

	// Print error when no tests
	if len(tests) == 0 {
		fmt.Printf("--- FAIL no tests")
		return
	}

	// Add actions sources
	for _, source := range strings.Split(sources, ",") {
		core.Source(source)
	}

	// Run tests
	results := tests.Run()

	// Print results
	results.Print()
}
Esempio n. 2
0
// Run - Runs tests and returns convey output straight for API.
func (e *Executor) Run() {
	// Read tests from directory
	tests, _ := utils.ReadTests(e.Dirname)

	e.lock.Lock()
	run := tests.Run()
	e.lock.Unlock()

	// Convert to convey output
	e.Latest = convey.NewResults(run)
	e.Status = IdleStatus

	// Run event for API to lookup for changes
	e.RunEvent()
}