@@ -37,8 +37,8 @@ var Cmd = &base.Command{
|
||||
|
||||
// llgo cmptest
|
||||
var CmpTestCmd = &base.Command{
|
||||
UsageLine: "llgo cmptest [build flags] package [arguments...]",
|
||||
Short: "Compile programs by llgo and go, run them and do comparative tests (stdout/stderr/exitcode)",
|
||||
UsageLine: "llgo cmptest [-genexpect] [build flags] package [arguments...]",
|
||||
Short: "Compile and run with llgo, compare result (stdout/stderr/exitcode) with go or llgo.expect; generate llgo.expect file if -genexpect is specified",
|
||||
}
|
||||
|
||||
func init() {
|
||||
@@ -55,9 +55,13 @@ func runCmpTest(cmd *base.Command, args []string) {
|
||||
}
|
||||
|
||||
func runCmdEx(cmd *base.Command, args []string, mode build.Mode) {
|
||||
conf := build.NewDefaultConf(mode)
|
||||
if mode == build.ModeCmpTest && len(args) > 0 && args[0] == "-genexpect" {
|
||||
conf.GenExpect = true
|
||||
args = args[1:]
|
||||
}
|
||||
args, runArgs, err := parseRunArgs(args)
|
||||
check(err)
|
||||
conf := build.NewDefaultConf(mode)
|
||||
conf.RunArgs = runArgs
|
||||
build.Do(args, conf)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user