blob: 55e19213e52a3775557beb5494e6ae296c00e154 [file] [log] [blame]
Adam Langleye9ada862015-05-11 17:20:37 -07001/* Copyright (c) 2015, Google Inc.
2 *
3 * Permission to use, copy, modify, and/or distribute this software for any
4 * purpose with or without fee is hereby granted, provided that the above
5 * copyright notice and this permission notice appear in all copies.
6 *
7 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
10 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
12 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
13 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
14
15package main
16
17import (
Robert Sloan8ff03552017-06-14 12:40:58 -070018 "bufio"
Adam Langleye9ada862015-05-11 17:20:37 -070019 "bytes"
20 "encoding/json"
Robert Sloanc9abfe42018-11-26 12:19:07 -080021 "errors"
Adam Langleye9ada862015-05-11 17:20:37 -070022 "flag"
23 "fmt"
Robert Sloan8ff03552017-06-14 12:40:58 -070024 "math/rand"
Adam Langleye9ada862015-05-11 17:20:37 -070025 "os"
26 "os/exec"
27 "path"
Robert Sloan572a4e22017-04-17 10:52:19 -070028 "runtime"
Adam Langleyf4e42722015-06-04 17:45:09 -070029 "strconv"
Adam Langleye9ada862015-05-11 17:20:37 -070030 "strings"
David Benjamin4969cc92016-04-22 15:02:23 -040031 "sync"
Adam Langleyf4e42722015-06-04 17:45:09 -070032 "syscall"
Robert Sloanc9abfe42018-11-26 12:19:07 -080033
34 "boringssl.googlesource.com/boringssl/util/testresult"
Adam Langleye9ada862015-05-11 17:20:37 -070035)
36
37// TODO(davidben): Link tests with the malloc shim and port -malloc-test to this runner.
38
39var (
Adam Langleyf4e42722015-06-04 17:45:09 -070040 useValgrind = flag.Bool("valgrind", false, "If true, run code under valgrind")
David Benjamin4969cc92016-04-22 15:02:23 -040041 useCallgrind = flag.Bool("callgrind", false, "If true, run code under valgrind to generate callgrind traces.")
Adam Langleyf4e42722015-06-04 17:45:09 -070042 useGDB = flag.Bool("gdb", false, "If true, run BoringSSL code under gdb")
Robert Sloan4d1ac502017-02-06 08:36:14 -080043 useSDE = flag.Bool("sde", false, "If true, run BoringSSL code under Intel's SDE for each supported chip")
Robert Sloan8ff03552017-06-14 12:40:58 -070044 sdePath = flag.String("sde-path", "sde", "The path to find the sde binary.")
Adam Langleyf4e42722015-06-04 17:45:09 -070045 buildDir = flag.String("build-dir", "build", "The build directory to run the tests from.")
Robert Sloan572a4e22017-04-17 10:52:19 -070046 numWorkers = flag.Int("num-workers", runtime.NumCPU(), "Runs the given number of workers when testing.")
Adam Langleyf4e42722015-06-04 17:45:09 -070047 jsonOutput = flag.String("json-output", "", "The file to output JSON results to.")
48 mallocTest = flag.Int64("malloc-test", -1, "If non-negative, run each test with each malloc in turn failing from the given number onwards.")
49 mallocTestDebug = flag.Bool("malloc-test-debug", false, "If true, ask each test to abort rather than fail a malloc. This can be used with a specific value for --malloc-test to identity the malloc failing that is causing problems.")
Robert Sloanc9abfe42018-11-26 12:19:07 -080050 simulateARMCPUs = flag.Bool("simulate-arm-cpus", simulateARMCPUsDefault(), "If true, runs tests simulating different ARM CPUs.")
Adam Langleye9ada862015-05-11 17:20:37 -070051)
52
Robert Sloanc9abfe42018-11-26 12:19:07 -080053func simulateARMCPUsDefault() bool {
54 return runtime.GOOS == "linux" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64")
55}
56
Robert Sloan4d1ac502017-02-06 08:36:14 -080057type test struct {
Robert Sloan4562e9d2017-10-02 10:26:51 -070058 args []string
59 shard, numShards int
Robert Sloanc9abfe42018-11-26 12:19:07 -080060 // cpu, if not empty, contains a code to simulate. For SDE, run `sde64
61 // -help` to get a list of these codes. For ARM, see gtest_main.cc for
62 // the supported values.
Robert Sloan4d1ac502017-02-06 08:36:14 -080063 cpu string
64}
Adam Langleye9ada862015-05-11 17:20:37 -070065
David Benjamin4969cc92016-04-22 15:02:23 -040066type result struct {
67 Test test
68 Passed bool
69 Error error
70}
71
Robert Sloan4d1ac502017-02-06 08:36:14 -080072// sdeCPUs contains a list of CPU code that we run all tests under when *useSDE
73// is true.
74var sdeCPUs = []string{
75 "p4p", // Pentium4 Prescott
76 "mrm", // Merom
77 "pnr", // Penryn
78 "nhm", // Nehalem
79 "wsm", // Westmere
80 "snb", // Sandy Bridge
81 "ivb", // Ivy Bridge
82 "hsw", // Haswell
83 "bdw", // Broadwell
84 "skx", // Skylake Server
85 "skl", // Skylake Client
86 "cnl", // Cannonlake
87 "knl", // Knights Landing
88 "slt", // Saltwell
89 "slm", // Silvermont
90 "glm", // Goldmont
Robert Sloanfe7cd212017-08-07 09:03:39 -070091 "knm", // Knights Mill
Robert Sloan4d1ac502017-02-06 08:36:14 -080092}
93
Robert Sloanc9abfe42018-11-26 12:19:07 -080094var armCPUs = []string{
95 "none", // No support for any ARM extensions.
96 "neon", // Support for NEON.
97 "crypto", // Support for NEON and crypto extensions.
Adam Langleye9ada862015-05-11 17:20:37 -070098}
99
100func valgrindOf(dbAttach bool, path string, args ...string) *exec.Cmd {
David Benjamin7c0d06c2016-08-11 13:26:41 -0400101 valgrindArgs := []string{"--error-exitcode=99", "--track-origins=yes", "--leak-check=full", "--quiet"}
Adam Langleye9ada862015-05-11 17:20:37 -0700102 if dbAttach {
103 valgrindArgs = append(valgrindArgs, "--db-attach=yes", "--db-command=xterm -e gdb -nw %f %p")
104 }
105 valgrindArgs = append(valgrindArgs, path)
106 valgrindArgs = append(valgrindArgs, args...)
107
108 return exec.Command("valgrind", valgrindArgs...)
109}
110
David Benjamin4969cc92016-04-22 15:02:23 -0400111func callgrindOf(path string, args ...string) *exec.Cmd {
112 valgrindArgs := []string{"-q", "--tool=callgrind", "--dump-instr=yes", "--collect-jumps=yes", "--callgrind-out-file=" + *buildDir + "/callgrind/callgrind.out.%p"}
113 valgrindArgs = append(valgrindArgs, path)
114 valgrindArgs = append(valgrindArgs, args...)
115
116 return exec.Command("valgrind", valgrindArgs...)
117}
118
Adam Langleyf4e42722015-06-04 17:45:09 -0700119func gdbOf(path string, args ...string) *exec.Cmd {
120 xtermArgs := []string{"-e", "gdb", "--args"}
121 xtermArgs = append(xtermArgs, path)
122 xtermArgs = append(xtermArgs, args...)
123
124 return exec.Command("xterm", xtermArgs...)
125}
126
Robert Sloan4d1ac502017-02-06 08:36:14 -0800127func sdeOf(cpu, path string, args ...string) *exec.Cmd {
Robert Sloanb6d070c2017-07-24 08:40:01 -0700128 sdeArgs := []string{"-" + cpu}
129 // The kernel's vdso code for gettimeofday sometimes uses the RDTSCP
130 // instruction. Although SDE has a -chip_check_vsyscall flag that
131 // excludes such code by default, it does not seem to work. Instead,
132 // pass the -chip_check_exe_only flag which retains test coverage when
133 // statically linked and excludes the vdso.
134 if cpu == "p4p" || cpu == "pnr" || cpu == "mrm" || cpu == "slt" {
135 sdeArgs = append(sdeArgs, "-chip_check_exe_only")
136 }
137 sdeArgs = append(sdeArgs, "--", path)
Robert Sloan4d1ac502017-02-06 08:36:14 -0800138 sdeArgs = append(sdeArgs, args...)
Robert Sloan8ff03552017-06-14 12:40:58 -0700139 return exec.Command(*sdePath, sdeArgs...)
Robert Sloan4d1ac502017-02-06 08:36:14 -0800140}
141
Robert Sloanc9abfe42018-11-26 12:19:07 -0800142var (
143 errMoreMallocs = errors.New("child process did not exhaust all allocation calls")
144 errTestSkipped = errors.New("test was skipped")
145)
Adam Langleyf4e42722015-06-04 17:45:09 -0700146
147func runTestOnce(test test, mallocNumToFail int64) (passed bool, err error) {
Robert Sloan4d1ac502017-02-06 08:36:14 -0800148 prog := path.Join(*buildDir, test.args[0])
149 args := test.args[1:]
Robert Sloanc9abfe42018-11-26 12:19:07 -0800150 if *simulateARMCPUs && test.cpu != "" {
151 args = append([]string{"--cpu=" + test.cpu}, args...)
152 }
Adam Langleye9ada862015-05-11 17:20:37 -0700153 var cmd *exec.Cmd
154 if *useValgrind {
155 cmd = valgrindOf(false, prog, args...)
David Benjamin4969cc92016-04-22 15:02:23 -0400156 } else if *useCallgrind {
157 cmd = callgrindOf(prog, args...)
Adam Langleyf4e42722015-06-04 17:45:09 -0700158 } else if *useGDB {
159 cmd = gdbOf(prog, args...)
Robert Sloan4d1ac502017-02-06 08:36:14 -0800160 } else if *useSDE {
161 cmd = sdeOf(test.cpu, prog, args...)
Adam Langleye9ada862015-05-11 17:20:37 -0700162 } else {
163 cmd = exec.Command(prog, args...)
164 }
Robert Sloan5d625782017-02-13 09:55:39 -0800165 var outBuf bytes.Buffer
166 cmd.Stdout = &outBuf
167 cmd.Stderr = &outBuf
Adam Langleyf4e42722015-06-04 17:45:09 -0700168 if mallocNumToFail >= 0 {
169 cmd.Env = os.Environ()
170 cmd.Env = append(cmd.Env, "MALLOC_NUMBER_TO_FAIL="+strconv.FormatInt(mallocNumToFail, 10))
171 if *mallocTestDebug {
172 cmd.Env = append(cmd.Env, "MALLOC_ABORT_ON_FAIL=1")
173 }
174 cmd.Env = append(cmd.Env, "_MALLOC_CHECK=1")
175 }
Adam Langleye9ada862015-05-11 17:20:37 -0700176
177 if err := cmd.Start(); err != nil {
178 return false, err
179 }
180 if err := cmd.Wait(); err != nil {
Adam Langleyf4e42722015-06-04 17:45:09 -0700181 if exitError, ok := err.(*exec.ExitError); ok {
Robert Sloanc9abfe42018-11-26 12:19:07 -0800182 switch exitError.Sys().(syscall.WaitStatus).ExitStatus() {
183 case 88:
Adam Langleyf4e42722015-06-04 17:45:09 -0700184 return false, errMoreMallocs
Robert Sloanc9abfe42018-11-26 12:19:07 -0800185 case 89:
186 fmt.Print(string(outBuf.Bytes()))
187 return false, errTestSkipped
Adam Langleyf4e42722015-06-04 17:45:09 -0700188 }
189 }
Robert Sloan5d625782017-02-13 09:55:39 -0800190 fmt.Print(string(outBuf.Bytes()))
Adam Langleye9ada862015-05-11 17:20:37 -0700191 return false, err
192 }
193
194 // Account for Windows line-endings.
Robert Sloan5d625782017-02-13 09:55:39 -0800195 stdout := bytes.Replace(outBuf.Bytes(), []byte("\r\n"), []byte("\n"), -1)
Adam Langleye9ada862015-05-11 17:20:37 -0700196
197 if bytes.HasSuffix(stdout, []byte("PASS\n")) &&
198 (len(stdout) == 5 || stdout[len(stdout)-6] == '\n') {
199 return true, nil
200 }
David Benjaminf31229b2017-01-25 14:08:15 -0500201
202 // Also accept a googletest-style pass line. This is left here in
203 // transition until the tests are all converted and this script made
204 // unnecessary.
205 if bytes.Contains(stdout, []byte("\n[ PASSED ]")) {
206 return true, nil
207 }
208
Robert Sloan5d625782017-02-13 09:55:39 -0800209 fmt.Print(string(outBuf.Bytes()))
Adam Langleye9ada862015-05-11 17:20:37 -0700210 return false, nil
211}
212
Adam Langleyf4e42722015-06-04 17:45:09 -0700213func runTest(test test) (bool, error) {
214 if *mallocTest < 0 {
215 return runTestOnce(test, -1)
216 }
217
218 for mallocNumToFail := int64(*mallocTest); ; mallocNumToFail++ {
219 if passed, err := runTestOnce(test, mallocNumToFail); err != errMoreMallocs {
220 if err != nil {
221 err = fmt.Errorf("at malloc %d: %s", mallocNumToFail, err)
222 }
223 return passed, err
224 }
225 }
226}
227
Kenny Rootb8494592015-09-25 02:29:14 +0000228// setWorkingDirectory walks up directories as needed until the current working
229// directory is the top of a BoringSSL checkout.
230func setWorkingDirectory() {
231 for i := 0; i < 64; i++ {
232 if _, err := os.Stat("BUILDING.md"); err == nil {
233 return
234 }
235 os.Chdir("..")
236 }
237
238 panic("Couldn't find BUILDING.md in a parent directory!")
239}
240
241func parseTestConfig(filename string) ([]test, error) {
242 in, err := os.Open(filename)
243 if err != nil {
244 return nil, err
245 }
246 defer in.Close()
247
248 decoder := json.NewDecoder(in)
Robert Sloan4d1ac502017-02-06 08:36:14 -0800249 var testArgs [][]string
250 if err := decoder.Decode(&testArgs); err != nil {
Kenny Rootb8494592015-09-25 02:29:14 +0000251 return nil, err
252 }
Robert Sloan4d1ac502017-02-06 08:36:14 -0800253
254 var result []test
255 for _, args := range testArgs {
256 result = append(result, test{args: args})
257 }
Kenny Rootb8494592015-09-25 02:29:14 +0000258 return result, nil
259}
260
David Benjamin4969cc92016-04-22 15:02:23 -0400261func worker(tests <-chan test, results chan<- result, done *sync.WaitGroup) {
262 defer done.Done()
263 for test := range tests {
264 passed, err := runTest(test)
265 results <- result{test, passed, err}
266 }
267}
268
Robert Sloan4562e9d2017-10-02 10:26:51 -0700269func (t test) shortName() string {
270 return t.args[0] + t.shardMsg() + t.cpuMsg()
271}
272
273func (t test) longName() string {
274 return strings.Join(t.args, " ") + t.cpuMsg()
275}
276
277func (t test) shardMsg() string {
278 if t.numShards == 0 {
279 return ""
280 }
281
282 return fmt.Sprintf(" [shard %d/%d]", t.shard+1, t.numShards)
283}
284
Robert Sloan4d1ac502017-02-06 08:36:14 -0800285func (t test) cpuMsg() string {
286 if len(t.cpu) == 0 {
287 return ""
288 }
289
290 return fmt.Sprintf(" (for CPU %q)", t.cpu)
291}
292
Robert Sloan8ff03552017-06-14 12:40:58 -0700293func (t test) getGTestShards() ([]test, error) {
294 if *numWorkers == 1 || len(t.args) != 1 {
295 return []test{t}, nil
296 }
297
298 // Only shard the three GTest-based tests.
299 if t.args[0] != "crypto/crypto_test" && t.args[0] != "ssl/ssl_test" && t.args[0] != "decrepit/decrepit_test" {
300 return []test{t}, nil
301 }
302
303 prog := path.Join(*buildDir, t.args[0])
304 cmd := exec.Command(prog, "--gtest_list_tests")
305 var stdout bytes.Buffer
306 cmd.Stdout = &stdout
307 if err := cmd.Start(); err != nil {
308 return nil, err
309 }
310 if err := cmd.Wait(); err != nil {
311 return nil, err
312 }
313
314 var group string
315 var tests []string
316 scanner := bufio.NewScanner(&stdout)
317 for scanner.Scan() {
318 line := scanner.Text()
319
320 // Remove the parameter comment and trailing space.
321 if idx := strings.Index(line, "#"); idx >= 0 {
322 line = line[:idx]
323 }
324 line = strings.TrimSpace(line)
325 if len(line) == 0 {
326 continue
327 }
328
329 if line[len(line)-1] == '.' {
330 group = line
331 continue
332 }
333
334 if len(group) == 0 {
335 return nil, fmt.Errorf("found test case %q without group", line)
336 }
337 tests = append(tests, group+line)
338 }
339
340 const testsPerShard = 20
341 if len(tests) <= testsPerShard {
342 return []test{t}, nil
343 }
344
345 // Slow tests which process large test vector files tend to be grouped
346 // together, so shuffle the order.
347 shuffled := make([]string, len(tests))
348 perm := rand.Perm(len(tests))
349 for i, j := range perm {
350 shuffled[i] = tests[j]
351 }
352
353 var shards []test
354 for i := 0; i < len(shuffled); i += testsPerShard {
355 n := len(shuffled) - i
356 if n > testsPerShard {
357 n = testsPerShard
358 }
359 shard := t
360 shard.args = []string{shard.args[0], "--gtest_filter=" + strings.Join(shuffled[i:i+n], ":")}
Robert Sloan4562e9d2017-10-02 10:26:51 -0700361 shard.shard = len(shards)
Robert Sloan8ff03552017-06-14 12:40:58 -0700362 shards = append(shards, shard)
363 }
364
Robert Sloan4562e9d2017-10-02 10:26:51 -0700365 for i := range shards {
366 shards[i].numShards = len(shards)
367 }
368
Robert Sloan8ff03552017-06-14 12:40:58 -0700369 return shards, nil
370}
371
Adam Langleye9ada862015-05-11 17:20:37 -0700372func main() {
373 flag.Parse()
Kenny Rootb8494592015-09-25 02:29:14 +0000374 setWorkingDirectory()
375
David Benjamin4969cc92016-04-22 15:02:23 -0400376 testCases, err := parseTestConfig("util/all_tests.json")
Kenny Rootb8494592015-09-25 02:29:14 +0000377 if err != nil {
378 fmt.Printf("Failed to parse input: %s\n", err)
379 os.Exit(1)
380 }
Adam Langleye9ada862015-05-11 17:20:37 -0700381
David Benjamin4969cc92016-04-22 15:02:23 -0400382 var wg sync.WaitGroup
383 tests := make(chan test, *numWorkers)
384 results := make(chan result, *numWorkers)
385
386 for i := 0; i < *numWorkers; i++ {
387 wg.Add(1)
388 go worker(tests, results, &wg)
389 }
390
391 go func() {
392 for _, test := range testCases {
Robert Sloan4d1ac502017-02-06 08:36:14 -0800393 if *useSDE {
Robert Sloan8ff03552017-06-14 12:40:58 -0700394 // SDE generates plenty of tasks and gets slower
395 // with additional sharding.
Robert Sloan4d1ac502017-02-06 08:36:14 -0800396 for _, cpu := range sdeCPUs {
397 testForCPU := test
398 testForCPU.cpu = cpu
399 tests <- testForCPU
400 }
Robert Sloanc9abfe42018-11-26 12:19:07 -0800401 } else if *simulateARMCPUs {
402 // This mode is run instead of the default path,
403 // so also include the native flow.
404 tests <- test
405 for _, cpu := range armCPUs {
406 testForCPU := test
407 testForCPU.cpu = cpu
408 tests <- testForCPU
409 }
Robert Sloan4d1ac502017-02-06 08:36:14 -0800410 } else {
Robert Sloan8ff03552017-06-14 12:40:58 -0700411 shards, err := test.getGTestShards()
412 if err != nil {
413 fmt.Printf("Error listing tests: %s\n", err)
414 os.Exit(1)
415 }
416 for _, shard := range shards {
417 tests <- shard
418 }
Robert Sloan4d1ac502017-02-06 08:36:14 -0800419 }
David Benjamin4969cc92016-04-22 15:02:23 -0400420 }
421 close(tests)
422
423 wg.Wait()
424 close(results)
425 }()
426
Robert Sloanc9abfe42018-11-26 12:19:07 -0800427 testOutput := testresult.NewResults()
428 var failed, skipped []test
David Benjamin4969cc92016-04-22 15:02:23 -0400429 for testResult := range results {
430 test := testResult.Test
Robert Sloan4d1ac502017-02-06 08:36:14 -0800431 args := test.args
Adam Langleye9ada862015-05-11 17:20:37 -0700432
Robert Sloanc9abfe42018-11-26 12:19:07 -0800433 if testResult.Error == errTestSkipped {
434 fmt.Printf("%s\n", test.longName())
435 fmt.Printf("%s was skipped\n", args[0])
436 skipped = append(skipped, test)
437 testOutput.AddSkip(test.longName())
438 } else if testResult.Error != nil {
Robert Sloan4562e9d2017-10-02 10:26:51 -0700439 fmt.Printf("%s\n", test.longName())
Robert Sloan4d1ac502017-02-06 08:36:14 -0800440 fmt.Printf("%s failed to complete: %s\n", args[0], testResult.Error)
Adam Langleye9ada862015-05-11 17:20:37 -0700441 failed = append(failed, test)
Robert Sloanc9abfe42018-11-26 12:19:07 -0800442 testOutput.AddResult(test.longName(), "CRASH")
David Benjamin4969cc92016-04-22 15:02:23 -0400443 } else if !testResult.Passed {
Robert Sloan4562e9d2017-10-02 10:26:51 -0700444 fmt.Printf("%s\n", test.longName())
Robert Sloan4d1ac502017-02-06 08:36:14 -0800445 fmt.Printf("%s failed to print PASS on the last line.\n", args[0])
Adam Langleye9ada862015-05-11 17:20:37 -0700446 failed = append(failed, test)
Robert Sloanc9abfe42018-11-26 12:19:07 -0800447 testOutput.AddResult(test.longName(), "FAIL")
Adam Langleye9ada862015-05-11 17:20:37 -0700448 } else {
Robert Sloan4562e9d2017-10-02 10:26:51 -0700449 fmt.Printf("%s\n", test.shortName())
Robert Sloanc9abfe42018-11-26 12:19:07 -0800450 testOutput.AddResult(test.longName(), "PASS")
Adam Langleye9ada862015-05-11 17:20:37 -0700451 }
452 }
453
454 if *jsonOutput != "" {
Robert Sloanc9abfe42018-11-26 12:19:07 -0800455 if err := testOutput.WriteToFile(*jsonOutput); err != nil {
Adam Langleye9ada862015-05-11 17:20:37 -0700456 fmt.Fprintf(os.Stderr, "Error: %s\n", err)
457 }
458 }
459
Robert Sloanc9abfe42018-11-26 12:19:07 -0800460 if len(skipped) > 0 {
461 fmt.Printf("\n%d of %d tests were skipped:\n", len(skipped), len(testCases))
462 for _, test := range skipped {
463 fmt.Printf("\t%s%s\n", strings.Join(test.args, " "), test.cpuMsg())
464 }
465 }
466
Adam Langleye9ada862015-05-11 17:20:37 -0700467 if len(failed) > 0 {
David Benjamin4969cc92016-04-22 15:02:23 -0400468 fmt.Printf("\n%d of %d tests failed:\n", len(failed), len(testCases))
Adam Langleye9ada862015-05-11 17:20:37 -0700469 for _, test := range failed {
Robert Sloan8ff03552017-06-14 12:40:58 -0700470 fmt.Printf("\t%s%s\n", strings.Join(test.args, " "), test.cpuMsg())
Adam Langleye9ada862015-05-11 17:20:37 -0700471 }
472 os.Exit(1)
473 }
474
475 fmt.Printf("\nAll tests passed!\n")
476}