Make the runner tests a go “test”

This change makes the runner tests (in ssl/test/runner) act like a
normal Go test rather than being a Go binary. This better aligns with
some internal tools.

Thus, from this point onwards, one has to run the runner tests with `go
test` rather than `go run` or `go build && ./runner`.

This will break the bots.

Change-Id: Idd72c31e8e0c2b7ed9939dacd3b801dbd31710dd
Reviewed-on: https://boringssl-review.googlesource.com/6009
Reviewed-by: Matt Braithwaite <mab@google.com>
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/BUILDING.md b/BUILDING.md
index c75851f..65e88e8 100644
--- a/BUILDING.md
+++ b/BUILDING.md
@@ -91,6 +91,13 @@
     don't have steps for assembling the assembly language source files, so they
     currently cannot be used to build BoringSSL.
 
+# Running tests
+
+There are two sets of tests: the C/C++ tests and the blackbox tests. For former
+are built by Ninja and can be run from the top-level directory with `go run
+util/all_tests.go`. The latter have to be run separately by running `go test`
+from within `ssl/test/runner`.
+
 
  [1]: http://www.cmake.org/download/
  [2]: http://strawberryperl.com/
diff --git a/ssl/test/runner/alert.go b/ssl/test/runner/alert.go
index b48ab2a..541216e 100644
--- a/ssl/test/runner/alert.go
+++ b/ssl/test/runner/alert.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package runner
 
 import "strconv"
 
diff --git a/ssl/test/runner/chacha20_poly1305.go b/ssl/test/runner/chacha20_poly1305.go
index 42911d4..f2a1bbf 100644
--- a/ssl/test/runner/chacha20_poly1305.go
+++ b/ssl/test/runner/chacha20_poly1305.go
@@ -1,4 +1,4 @@
-package main
+package runner
 
 import (
 	"crypto/cipher"
diff --git a/ssl/test/runner/chacha20_poly1305_test.go b/ssl/test/runner/chacha20_poly1305_test.go
index 726f482..be49b11 100644
--- a/ssl/test/runner/chacha20_poly1305_test.go
+++ b/ssl/test/runner/chacha20_poly1305_test.go
@@ -1,4 +1,4 @@
-package main
+package runner
 
 import (
 	"bytes"
diff --git a/ssl/test/runner/cipher_suites.go b/ssl/test/runner/cipher_suites.go
index ffc056d..c406000 100644
--- a/ssl/test/runner/cipher_suites.go
+++ b/ssl/test/runner/cipher_suites.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package runner
 
 import (
 	"crypto/aes"
diff --git a/ssl/test/runner/common.go b/ssl/test/runner/common.go
index 77be9f6..3e5696d 100644
--- a/ssl/test/runner/common.go
+++ b/ssl/test/runner/common.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package runner
 
 import (
 	"container/list"
diff --git a/ssl/test/runner/conn.go b/ssl/test/runner/conn.go
index 39bdfda..986e2b5 100644
--- a/ssl/test/runner/conn.go
+++ b/ssl/test/runner/conn.go
@@ -4,7 +4,7 @@
 
 // TLS low level connection and record layer
 
-package main
+package runner
 
 import (
 	"bytes"
diff --git a/ssl/test/runner/dtls.go b/ssl/test/runner/dtls.go
index 5c59dea..fac035e 100644
--- a/ssl/test/runner/dtls.go
+++ b/ssl/test/runner/dtls.go
@@ -12,7 +12,7 @@
 // with simulated loss, but there is no point in forcing the test
 // driver to.
 
-package main
+package runner
 
 import (
 	"bytes"
diff --git a/ssl/test/runner/handshake_client.go b/ssl/test/runner/handshake_client.go
index a3ce686..e63d5eb 100644
--- a/ssl/test/runner/handshake_client.go
+++ b/ssl/test/runner/handshake_client.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package runner
 
 import (
 	"bytes"
diff --git a/ssl/test/runner/handshake_messages.go b/ssl/test/runner/handshake_messages.go
index da85e7a..530ddbc 100644
--- a/ssl/test/runner/handshake_messages.go
+++ b/ssl/test/runner/handshake_messages.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package runner
 
 import "bytes"
 
diff --git a/ssl/test/runner/handshake_server.go b/ssl/test/runner/handshake_server.go
index 068dff9..aa91723 100644
--- a/ssl/test/runner/handshake_server.go
+++ b/ssl/test/runner/handshake_server.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package runner
 
 import (
 	"bytes"
diff --git a/ssl/test/runner/key_agreement.go b/ssl/test/runner/key_agreement.go
index 2ee0087..3a9b899 100644
--- a/ssl/test/runner/key_agreement.go
+++ b/ssl/test/runner/key_agreement.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package runner
 
 import (
 	"crypto"
diff --git a/ssl/test/runner/packet_adapter.go b/ssl/test/runner/packet_adapter.go
index bbcd388..b432659 100644
--- a/ssl/test/runner/packet_adapter.go
+++ b/ssl/test/runner/packet_adapter.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package runner
 
 import (
 	"encoding/binary"
diff --git a/ssl/test/runner/poly1305.go b/ssl/test/runner/poly1305.go
index 51a1009..edef338 100644
--- a/ssl/test/runner/poly1305.go
+++ b/ssl/test/runner/poly1305.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package runner
 
 // Based on original, public domain implementation from NaCl by D. J.
 // Bernstein.
diff --git a/ssl/test/runner/prf.go b/ssl/test/runner/prf.go
index d445e76..8521aba 100644
--- a/ssl/test/runner/prf.go
+++ b/ssl/test/runner/prf.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package runner
 
 import (
 	"crypto"
diff --git a/ssl/test/runner/recordingconn.go b/ssl/test/runner/recordingconn.go
index a67fa48..6537714 100644
--- a/ssl/test/runner/recordingconn.go
+++ b/ssl/test/runner/recordingconn.go
@@ -1,4 +1,4 @@
-package main
+package runner
 
 import (
 	"bufio"
diff --git a/ssl/test/runner/runner.go b/ssl/test/runner/runner.go
index 269a955..a9823fc 100644
--- a/ssl/test/runner/runner.go
+++ b/ssl/test/runner/runner.go
@@ -1,4 +1,4 @@
-package main
+package runner
 
 import (
 	"bytes"
diff --git a/ssl/test/runner/runner_test.go b/ssl/test/runner/runner_test.go
new file mode 100644
index 0000000..320ff52
--- /dev/null
+++ b/ssl/test/runner/runner_test.go
@@ -0,0 +1,7 @@
+package runner
+
+import "testing"
+
+func TestAll(t *testing.T) {
+	main()
+}
diff --git a/ssl/test/runner/test_output.go b/ssl/test/runner/test_output.go
index bcb7a93..2112092 100644
--- a/ssl/test/runner/test_output.go
+++ b/ssl/test/runner/test_output.go
@@ -12,7 +12,7 @@
  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
 
-package main
+package runner
 
 import (
 	"encoding/json"
diff --git a/ssl/test/runner/ticket.go b/ssl/test/runner/ticket.go
index 8355822..e121c05 100644
--- a/ssl/test/runner/ticket.go
+++ b/ssl/test/runner/ticket.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package runner
 
 import (
 	"bytes"
diff --git a/ssl/test/runner/tls.go b/ssl/test/runner/tls.go
index 6b637c8..24f9b1e 100644
--- a/ssl/test/runner/tls.go
+++ b/ssl/test/runner/tls.go
@@ -3,7 +3,7 @@
 // license that can be found in the LICENSE file.
 
 // Package tls partially implements TLS 1.2, as specified in RFC 5246.
-package main
+package runner
 
 import (
 	"crypto"