make sure gsanity-check returns an informative exit code, so we can rely on it in tests.

This commit is contained in:
Ian A. Mason 2017-07-13 08:57:15 -07:00
parent f66fd9f0fc
commit 37af8fee67
2 changed files with 6 additions and 1 deletions

View File

@ -11,6 +11,9 @@ clean:
go clean go clean
rm -f gclang gclang++ get-bc rm -f gclang gclang++ get-bc
fmt:
gofmt -s -w shared/*.go cmd/*/*.go
uninstall: uninstall:
rm -f $(GOROOT)/bin/gclang rm -f $(GOROOT)/bin/gclang
rm -f $(GOROOT)/bin/gclang++ rm -f $(GOROOT)/bin/gclang++

View File

@ -110,6 +110,7 @@ func checkCompilers() bool {
LogWrite("The CXX compiler %s is:\n\n\t%s\n\n", cxx, extractLine(cxxVersion, 0)) 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 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. // 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) { func checkExecutable(cmdExecName string, varg string) (success bool, output string, err error) {
cmd := exec.Command(cmdExecName, varg) 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)) LogWrite("The bitcode archiver %s is:\n\n\t%s\n\n", archiverName, extractLine(archiverVersion, 1))
} }
return true return linkerOK && archiverOK
} }
func checkStore() { func checkStore() {