blob: 9e2d88e18af1c6dc1f82af360698c933b53063c6 [file] [log] [blame]
Sean Abrahamb59bf652019-04-26 11:27:56 -06001#!/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 Abrahamd26bc8d2019-07-03 09:57:20 -06006# Runs all of the Go tests in this module and verifies all binaries compile.
Sean Abrahamb59bf652019-04-26 11:27:56 -06007# 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.
11cd "$(dirname "$0")"
12
Sean Abraham5151aff2019-07-03 16:02:36 -060013echo "Running tests"
Jack Neuse130b5a2019-07-02 15:33:56 -060014if ! go test ./...; then
15 exit 1
16fi
Sean Abrahamb59bf652019-04-26 11:27:56 -060017
Sean Abrahamd26bc8d2019-07-03 09:57:20 -060018echo "Checking that binaries compile"
Jack Neuse130b5a2019-07-02 15:33:56 -060019if ! go build ./...; then
20 exit 1
21fi
Sean Abrahamd26bc8d2019-07-03 09:57:20 -060022
Sean Abraham5151aff2019-07-03 16:02:36 -060023echo "Vetting the code"
Jack Neuse130b5a2019-07-02 15:33:56 -060024if ! go vet ./...; then
25 exit 1
26fi
Sean Abraham5151aff2019-07-03 16:02:36 -060027
Sean Abrahamd26bc8d2019-07-03 09:57:20 -060028echo "Done"