Sean Abraham | b59bf65 | 2019-04-26 11:27:56 -0600 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # Copyright 2019 The Chromium OS Authors. All rights reserved. |
| 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
| 5 | # |
Sean Abraham | d26bc8d | 2019-07-03 09:57:20 -0600 | [diff] [blame] | 6 | # Runs all of the Go tests in this module and verifies all binaries compile. |
Sean Abraham | b59bf65 | 2019-04-26 11:27:56 -0600 | [diff] [blame] | 7 | # This file shouldn't really be necessary. We should be able to just run |
| 8 | # "go test .", but the module definition isn't quite right at the moment. |
| 9 | |
| 10 | # Move to this script's directory. |
| 11 | cd "$(dirname "$0")" |
| 12 | |
Sean Abraham | 5151aff | 2019-07-03 16:02:36 -0600 | [diff] [blame] | 13 | echo "Running tests" |
Jack Neus | e130b5a | 2019-07-02 15:33:56 -0600 | [diff] [blame] | 14 | if ! go test ./...; then |
| 15 | exit 1 |
| 16 | fi |
Sean Abraham | b59bf65 | 2019-04-26 11:27:56 -0600 | [diff] [blame] | 17 | |
Sean Abraham | d26bc8d | 2019-07-03 09:57:20 -0600 | [diff] [blame] | 18 | echo "Checking that binaries compile" |
Jack Neus | e130b5a | 2019-07-02 15:33:56 -0600 | [diff] [blame] | 19 | if ! go build ./...; then |
| 20 | exit 1 |
| 21 | fi |
Sean Abraham | d26bc8d | 2019-07-03 09:57:20 -0600 | [diff] [blame] | 22 | |
Sean Abraham | 5151aff | 2019-07-03 16:02:36 -0600 | [diff] [blame] | 23 | echo "Vetting the code" |
Jack Neus | e130b5a | 2019-07-02 15:33:56 -0600 | [diff] [blame] | 24 | if ! go vet ./...; then |
| 25 | exit 1 |
| 26 | fi |
Sean Abraham | 5151aff | 2019-07-03 16:02:36 -0600 | [diff] [blame] | 27 | |
Sean Abraham | d26bc8d | 2019-07-03 09:57:20 -0600 | [diff] [blame] | 28 | echo "Done" |