From 8930aa53f3a316055e9dda4c534528ae0795e753 Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Thu, 30 May 2019 06:05:58 -0700 Subject: [PATCH] Adding a basic sanity testing tool to run during 'build'. The tool just runs 'go vet' for now; could do more later (like actually run the examples and compare to some expected output) --- tools/build | 1 + tools/test | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100755 tools/test diff --git a/tools/build b/tools/build index 829edcb..3c07db8 100755 --- a/tools/build +++ b/tools/build @@ -2,6 +2,7 @@ set -e +tools/test tools/format tools/measure tools/generate diff --git a/tools/test b/tools/test new file mode 100755 index 0000000..c0c9c55 --- /dev/null +++ b/tools/test @@ -0,0 +1,10 @@ +#!/bin/bash + +# Sanity testing of the examples. + +set -eo pipefail + +# go vet will attempt to build each example, making sure it compiles. It will +# also report known issues with the code. Disabling the -unreachable check +# because it will fire false positives for some examples demonstrating panics. +go vet -unreachable=false ./examples/...