diff options
Diffstat (limited to 'compiler_wrapper/android_config_test.go')
-rw-r--r-- | compiler_wrapper/android_config_test.go | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/compiler_wrapper/android_config_test.go b/compiler_wrapper/android_config_test.go index 74881a02..6d51bfe9 100644 --- a/compiler_wrapper/android_config_test.go +++ b/compiler_wrapper/android_config_test.go @@ -26,6 +26,7 @@ func TestAndroidConfig(t *testing.T) { runGoldenRecords(ctx, androidGoldenDir, []goldenFile{ createAndroidClangPathGoldenInputs(ctx), createBisectGoldenInputs(filepath.Join(ctx.tempDir, "clang")), + createAndroidCompileWithFallbackGoldenInputs(ctx), }) }) } @@ -74,3 +75,44 @@ func createAndroidClangPathGoldenInputs(ctx *testContext) goldenFile { }, } } + +func createAndroidCompileWithFallbackGoldenInputs(ctx *testContext) goldenFile { + env := []string{ + "ANDROID_LLVM_PREBUILT_COMPILER_PATH=fallback_compiler", + "ANDROID_LLVM_STDERR_REDIRECT=" + filepath.Join(ctx.tempDir, "fallback_stderr"), + "ANDROID_LLVM_FALLBACK_DISABLED_WARNINGS=-a -b", + } + defaultPath := filepath.Join(ctx.tempDir, "clang") + return goldenFile{ + Name: "compile_with_fallback.json", + Records: []goldenRecord{ + { + WrapperCmd: newGoldenCmd(defaultPath, mainCc), + Env: env, + Cmds: okResults, + }, + { + WrapperCmd: newGoldenCmd(defaultPath, mainCc), + Env: env, + Cmds: []commandResult{ + { + ExitCode: 1, + }, + okResult, + }, + }, + { + WrapperCmd: newGoldenCmd(defaultPath, mainCc), + Env: env, + Cmds: []commandResult{ + { + ExitCode: 1, + }, + { + ExitCode: 1, + }, + }, + }, + }, + } +} |