Esempio n. 1
0
func (resolver *specialTypeResolver) resolve(arg string) (*gauge.StepArg, error) {
	if util.IsWindows() {
		arg = GetUnescapedString(arg)
	}
	regEx := regexp.MustCompile("(.*?):(.*)")
	match := regEx.FindAllStringSubmatch(arg, -1)
	specialType := strings.TrimSpace(match[0][1])
	value := strings.TrimSpace(match[0][2])
	stepArg, err := resolver.getStepArg(specialType, value, arg)
	if err == nil {
		stepArg.Name = arg
	}
	return stepArg, err
}
Esempio n. 2
0
func initPackageFlags() {
	if util.IsWindows() {
		*simpleConsoleOutput = true
	}
	execLogger.SimpleConsoleOutput = *simpleConsoleOutput
	env.ProjectEnv = *currentEnv
	execution.ExecuteTags = *executeTags
	execution.TableRows = *tableRows
	execution.NumberOfExecutionStreams = *numberOfExecutionStreams
	filter.ExecuteTags = *executeTags
	filter.DoNotRandomize = *doNotRandomize
	filter.Distribute = *distribute
	filter.NumberOfExecutionStreams = *numberOfExecutionStreams
}
Esempio n. 3
0
func (s *MySuite) TestParsingFileAsSpecialParamWithWindowsPathAsValue(c *C) {
	resolver := newSpecialTypeResolver()
	resolver.predefinedResolvers["file"] = func(value string) (*gauge.StepArg, error) {
		return &gauge.StepArg{Value: "hello", ArgType: gauge.SpecialString}, nil
	}

	stepArg, _ := resolver.resolve(`file:C:\Users\abc`)
	c.Assert(stepArg.Value, Equals, "hello")
	c.Assert(stepArg.ArgType, Equals, gauge.SpecialString)
	if util.IsWindows() {
		c.Assert(stepArg.Name, Equals, `file:C:\\Users\\abc`)
	} else {
		c.Assert(stepArg.Name, Equals, `file:C:\Users\abc`)
	}
}
Esempio n. 4
0
func (s *MySuite) TestGetVersionedPluginDirName(c *C) {
	name := getVersionedPluginDirName("abcd/foo/bar/html-report-2.0.1.nightly-2016-02-09-darwin.x86.zip")
	c.Assert(name, Equals, "2.0.1.nightly-2016-02-09")

	name = getVersionedPluginDirName("abcd/foo/bar/xml-report-2.0.1.nightly-2016-02-09-darwin.x86.zip")
	c.Assert(name, Equals, "2.0.1.nightly-2016-02-09")

	name = getVersionedPluginDirName("abcd/foo/bar/html-report-0.3.4-windows.x86_64.zip")
	c.Assert(name, Equals, "0.3.4")

	name = getVersionedPluginDirName("abcd/foo/bar/gauge-java-0.3.4.nightly-2016-02-09-linux.x86.zip")
	c.Assert(name, Equals, "0.3.4.nightly-2016-02-09")

	name = getVersionedPluginDirName("abcd/foo/bar/gauge-java-0.3.4-linux.x86_64.zip")
	c.Assert(name, Equals, "0.3.4")

	name = getVersionedPluginDirName("abcd/foo/gauge-ruby-0.1.2.nightly-2016-02-09-linux.x86.zip")
	c.Assert(name, Equals, "0.1.2.nightly-2016-02-09")

	if util.IsWindows() {
		name = getVersionedPluginDirName("C:\\Users\\apoorvam\\AppData\\Local\\Temp\\gauge_temp1456130044460213700\\gauge-java-0.3.4-windows.x86_64.zip")
		c.Assert(name, Equals, "0.3.4")
	}
}
Esempio n. 5
0
func getSuccessSymbol() string {
	if util.IsWindows() {
		return spaces(1) + successChar
	}
	return spaces(1) + successSymbol
}
Esempio n. 6
0
func getFailureSymbol() string {
	if util.IsWindows() {
		return spaces(1) + failureChar
	}
	return spaces(1) + failureSymbol
}