Move configuration into a dedicated TestConfig struct.

This removes some duplicate code in parsing command-line flags and, more
importantly, makes configuration available when constructing the SSL_CTX and
avoids a number of globals.

Change-Id: I26e2d2285b732f855a2c82752bc8e0db480c3b30
Reviewed-on: https://boringssl-review.googlesource.com/1502
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/ssl/test/runner/runner.go b/ssl/test/runner/runner.go
index 57bcf87..4fd5a1d 100644
--- a/ssl/test/runner/runner.go
+++ b/ssl/test/runner/runner.go
@@ -549,20 +549,10 @@
 	shimEndResume, connResume := openSocketPair()
 
 	shim_path := path.Join(buildDir, "ssl/test/bssl_shim")
-	flags := []string{}
-	if test.testType == clientTest {
-		flags = append(flags, "client")
-	} else {
-		flags = append(flags, "server")
-	}
-
-	if test.resumeSession {
-		flags = append(flags, "resume")
-	} else {
-		flags = append(flags, "normal")
-	}
-
+	var flags []string
 	if test.testType == serverTest {
+		flags = append(flags, "-server")
+
 		flags = append(flags, "-key-file")
 		if test.keyFile == "" {
 			flags = append(flags, rsaKeyFile)
@@ -577,6 +567,11 @@
 			flags = append(flags, test.certFile)
 		}
 	}
+
+	if test.resumeSession {
+		flags = append(flags, "-resume")
+	}
+
 	flags = append(flags, test.flags...)
 
 	var shim *exec.Cmd