runTest initializes the environment for the tests and allows for the proper exit if the test fails or succeeds.
(m *testing.M)
| 41 | // runTest initializes the environment for the tests and allows for |
| 42 | // the proper exit if the test fails or succeeds. |
| 43 | func runTest(m *testing.M) int { |
| 44 | // Parse the connection info. |
| 45 | var connInfo ConnectionInfo |
| 46 | |
| 47 | connData, err := ioutil.ReadFile(connectionFile) |
| 48 | if err != nil { |
| 49 | log.Fatal(err) |
| 50 | } |
| 51 | |
| 52 | if err = json.Unmarshal(connData, &connInfo); err != nil { |
| 53 | log.Fatal(err) |
| 54 | } |
| 55 | |
| 56 | // Store the connection parameters globally for use by the test client. |
| 57 | connectionKey = connInfo.Key |
| 58 | transport = connInfo.Transport |
| 59 | ip = connInfo.IP |
| 60 | shellPort = connInfo.ShellPort |
| 61 | iopubPort = connInfo.IOPubPort |
| 62 | |
| 63 | // Start the kernel. |
| 64 | go runKernel(connectionFile) |
| 65 | |
| 66 | return m.Run() |
| 67 | } |
| 68 | |
| 69 | //============================================================================== |
| 70 |