diff options
Diffstat (limited to 'compiler_wrapper')
-rw-r--r-- | compiler_wrapper/compiler_wrapper.go | 8 | ||||
-rw-r--r-- | compiler_wrapper/compiler_wrapper_test.go | 13 | ||||
-rw-r--r-- | compiler_wrapper/config.go | 4 |
3 files changed, 23 insertions, 2 deletions
diff --git a/compiler_wrapper/compiler_wrapper.go b/compiler_wrapper/compiler_wrapper.go index a7b87dc0..4c3db14a 100644 --- a/compiler_wrapper/compiler_wrapper.go +++ b/compiler_wrapper/compiler_wrapper.go @@ -239,9 +239,13 @@ func printCompilerError(writer io.Writer, compilerErr error) { if _, ok := compilerErr.(userError); ok { fmt.Fprintf(writer, "%s\n", compilerErr) } else { + emailAccount := "chromeos-toolchain" + if isAndroidConfig() { + emailAccount = "android-llvm" + } fmt.Fprintf(writer, - "Internal error. Please report to chromeos-toolchain@google.com.\n%s\n", - compilerErr) + "Internal error. Please report to %s@google.com.\n%s\n", + emailAccount, compilerErr) } } diff --git a/compiler_wrapper/compiler_wrapper_test.go b/compiler_wrapper/compiler_wrapper_test.go index a132ec5c..52b92f56 100644 --- a/compiler_wrapper/compiler_wrapper_test.go +++ b/compiler_wrapper/compiler_wrapper_test.go @@ -149,6 +149,19 @@ func TestPrintOtherCompilerError(t *testing.T) { } } +func TestPrintOtherCompilerErrorForAndroidLLVM(t *testing.T) { + buffer := bytes.Buffer{} + + oldConfigName := ConfigName + defer func() { ConfigName = oldConfigName }() + + ConfigName = "android" + printCompilerError(&buffer, errors.New("abcd")) + if buffer.String() != "Internal error. Please report to android-llvm@google.com.\nabcd\n" { + t.Errorf("Unexpected string. Got: %s", buffer.String()) + } +} + func TestCalculateAndroidWrapperPath(t *testing.T) { t.Parallel() diff --git a/compiler_wrapper/config.go b/compiler_wrapper/config.go index e82e6b3d..a122b5a2 100644 --- a/compiler_wrapper/config.go +++ b/compiler_wrapper/config.go @@ -70,6 +70,10 @@ func getRealConfig() (*config, error) { return config, nil } +func isAndroidConfig() bool { + return ConfigName == "android" +} + func getConfig(configName string, useCCache bool, useLlvmNext bool, version string) (*config, error) { cfg := config{} switch configName { |