Use config.http.addr and config.http.ssl for create baseURL test server

This commit is contained in:
krhubert
2016-08-11 11:41:48 +02:00
parent 86e9258a8f
commit fb3980ce9d

View File

@@ -97,8 +97,18 @@ func testApp(args []string) {
defer cmd.Kill()
revel.INFO.Printf("Testing %s (%s) in %s mode\n", revel.AppName, revel.ImportPath, mode)
var httpAddr = revel.HttpAddr
if httpAddr == "" {
httpAddr = "127.0.0.1"
}
var httpProto = "http"
if revel.HttpSsl {
httpProto = "httpss"
}
// Get a list of tests
var baseURL = fmt.Sprintf("http://127.0.0.1:%d", revel.HTTPPort)
var baseURL = fmt.Sprintf("%s://%s:%d", httpProto, httpAddr, revel.HTTPPort)
testSuites, _ := getTestsList(baseURL)
// If a specific TestSuite[.Method] is specified, only run that suite/test