func NewValidationResult(s *gauge.SpecCollection, errMap *gauge.BuildErrors, r runner.Runner, parseOk bool, e ...error) *ValidationResult {
	return &ValidationResult{SpecCollection: s, ErrMap: errMap, Runner: r, ParseOk: parseOk, Errs: e}
}
NewValidationResult creates a new Validation result
package validation
import (
	"errors"
	"fmt"
	"os"
	"strconv"
	"strings"
	gm "github.com/getgauge/gauge-proto/go/gauge_messages"
	"github.com/getgauge/gauge/api"
	"github.com/getgauge/gauge/gauge"
	"github.com/getgauge/gauge/logger"
	"github.com/getgauge/gauge/parser"
	"github.com/getgauge/gauge/runner"
	"github.com/getgauge/gauge/util"
)
var TableRows = ""
var HideSuggestion bool
type validator struct {
	specsToExecute     []*gauge.Specification
	runner             runner.Runner
	conceptsDictionary *gauge.ConceptDictionary
}
type SpecValidator struct {
	specification       *gauge.Specification
	runner              runner.Runner
	conceptsDictionary  *gauge.ConceptDictionary
	validationErrors    []error
	stepValidationCache map[string]error
}
type StepValidationError struct {
	step       *gauge.Step
	message    string
	fileName   string
	errorType  *gm.StepValidateResponse_ErrorType
	suggestion string
}
type SpecValidationError struct {
	message  string
	fileName string
}
func (s StepValidationError) Message() string {
	return s.message
}
func (s StepValidationError) Step() *gauge.Step {
	return s.step
}
func (s StepValidationError) FileName() string {
	return s.fileName
}
func (s StepValidationError) ErrorType() gm.StepValidateResponse_ErrorType {
	return *s.errorType
}
func (s StepValidationError) Error() string {
	return fmt.Sprintf("%s:%d %s => '%s'", s.fileName, s.step.LineNo, s.message, s.step.GetLineText())
}
func (s StepValidationError) Suggestion() string {
	return s.suggestion
}
func (s SpecValidationError) Error() string {
	return fmt.Sprintf("%s %s", s.fileName, s.message)
}
func NewSpecValidationError(m string, f string) SpecValidationError {
	return SpecValidationError{message: m, fileName: f}
}
func NewStepValidationError(s *gauge.Step, m string, f string, e *gm.StepValidateResponse_ErrorType, suggestion string) StepValidationError {
	return StepValidationError{step: s, message: m, fileName: f, errorType: e, suggestion: suggestion}
}
func Validate(args []string) {
	if len(args) == 0 {
		args = append(args, util.GetSpecDirs()...)
	}
	res := ValidateSpecs(args, false)
	if len(res.Errs) > 0 {
		os.Exit(1)
	}
	if res.SpecCollection.Size() < 1 {
		logger.Infof(true, "No specifications found in %s.", strings.Join(args, ", "))
		err := res.Runner.Kill()
		if err != nil {
			logger.Errorf(false, "unable to kill runner: %s", err.Error())
		}
		if res.ParseOk {
			os.Exit(0)
		}
		os.Exit(1)
	}
	err := res.Runner.Kill()
	if err != nil {
		logger.Errorf(false, "unable to kill runner: %s", err.Error())
	}
	if res.ErrMap.HasErrors() {
		os.Exit(1)
	}
	logger.Infof(true, "No errors found.")
}
func startAPI(debug bool) runner.Runner {
	sc := api.StartAPI(debug)
	select {
	case runner := <-sc.RunnerChan:
		return runner
	case err := <-sc.ErrorChan:
		logger.Fatalf(true, "Failed to start gauge API: %s", err.Error())
	}
	return nil
}
type ValidationResult struct {
	SpecCollection *gauge.SpecCollection
	ErrMap         *gauge.BuildErrors
	Runner         runner.Runner
	Errs           []error
	ParseOk        bool
}