aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper/iwyu_flag_test.go
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-09-21 22:05:43 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-09-21 22:05:43 +0000
commit73fde5d5e2d64f4806fef172dbc064a8e5228694 (patch)
tree3e4cabab5a57ae288c245cff9a1a6ff7926a3207 /compiler_wrapper/iwyu_flag_test.go
parent40214b48188358a80b7478bfff21d4814dd9177c (diff)
parent0348d10214299073ea59bda4987dd8813a9e7812 (diff)
downloadtoolchain-utils-73fde5d5e2d64f4806fef172dbc064a8e5228694.tar.gz
Change-Id: Ia39ecafdc4b00a0b2505b638c14b80c02e34d4b6
Diffstat (limited to 'compiler_wrapper/iwyu_flag_test.go')
-rw-r--r--compiler_wrapper/iwyu_flag_test.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler_wrapper/iwyu_flag_test.go b/compiler_wrapper/iwyu_flag_test.go
index 76135944..e2db3b48 100644
--- a/compiler_wrapper/iwyu_flag_test.go
+++ b/compiler_wrapper/iwyu_flag_test.go
@@ -84,7 +84,7 @@ func TestUseIWYUBasedOnFileExtension(t *testing.T) {
ctx.cmdCount = 0
ctx.must(callCompiler(ctx, ctx.cfg,
ctx.newCommand(clangX86_64, tt.args...)))
- if ctx.cmdCount > 1 && !tt.iwyu {
+ if ctx.cmdCount == 2 && !tt.iwyu {
t.Errorf("expected a call to iwyu but got none for args %s", tt.args)
}
if ctx.cmdCount == 1 && tt.iwyu {
@@ -129,7 +129,8 @@ func TestIWYUFiltersIWYUFlags(t *testing.T) {
func withIWYUTestContext(t *testing.T, work func(ctx *testContext)) {
withTestContext(t, func(ctx *testContext) {
- ctx.env = []string{"WITH_IWYU=1"}
+ artifactDir := t.TempDir()
+ ctx.env = []string{"WITH_IWYU=1", "CROS_ARTIFACTS_TMP_DIR=" + artifactDir}
work(ctx)
})
}