-
Notifications
You must be signed in to change notification settings - Fork 0
/
golt.go
51 lines (45 loc) · 1.08 KB
/
golt.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package main
import (
"fmt"
"github.com/codegangsta/cli"
"os"
)
var testFilename string
var logFilename string
var version = "0.1"
func main() {
app := cli.NewApp()
app.Name = "golt"
// TODO: Find a good description for the cli
app.Usage = "Go Load Test Framework!!"
app.Version = version
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "file, f",
Value: "golt.json",
Usage: "full path to the load test file",
Destination: &testFilename,
},
cli.StringFlag{
Name: "log, l",
Value: "golt.log",
Usage: "full path the the log file",
Destination: &logFilename,
},
}
app.Action = func(c *cli.Context) {
fmt.Println("Started Golt")
fmt.Println("Parsing input file...")
golt, err := ParseInputFile(testFilename)
if err != nil {
fmt.Println("Error occured during parsing of the file:")
fmt.Printf("%v\n", err)
os.Exit(1)
}
fmt.Println("Parsing completed")
fmt.Println("Executing test...")
ExecuteGoltTest(golt, logFilename)
fmt.Println("Test completed, see results in the log file")
}
app.Run(os.Args)
}