From 37af8fee6721fa32f2c1babe0da50311a47bff71 Mon Sep 17 00:00:00 2001 From: "Ian A. Mason" Date: Thu, 13 Jul 2017 08:57:15 -0700 Subject: [PATCH] make sure gsanity-check returns an informative exit code, so we can rely on it in tests. --- Makefile | 3 +++ shared/sanity.go | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4d4f244..df5f5b5 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,9 @@ clean: go clean rm -f gclang gclang++ get-bc +fmt: + gofmt -s -w shared/*.go cmd/*/*.go + uninstall: rm -f $(GOROOT)/bin/gclang rm -f $(GOROOT)/bin/gclang++ diff --git a/shared/sanity.go b/shared/sanity.go index be3c12a..62f0a4a 100644 --- a/shared/sanity.go +++ b/shared/sanity.go @@ -110,6 +110,7 @@ func checkCompilers() bool { LogWrite("The CXX compiler %s is:\n\n\t%s\n\n", cxx, extractLine(cxxVersion, 0)) } + //FIXME: why "or" rather than "and"? return ccOK || cxxOK } @@ -130,6 +131,7 @@ func extractLine(version string, n int) string { } +// FIXME: this and execCmd in utils.go could be one routine, if that seems reasonable, or is it overboard? // Executes a command then returns true for success, false if there was an error, err is either nil or the error. func checkExecutable(cmdExecName string, varg string) (success bool, output string, err error) { cmd := exec.Command(cmdExecName, varg) @@ -175,7 +177,7 @@ func checkAuxiliaries() bool { LogWrite("The bitcode archiver %s is:\n\n\t%s\n\n", archiverName, extractLine(archiverVersion, 1)) } - return true + return linkerOK && archiverOK } func checkStore() {