Files
swift-mirror/test/SourceKit/Misc/no-driver-outputs.swift
Ben Langmuir ffc990f999 [driver/sourcekit] Avoid creating temporary output files in TMPDIR
When producing frontend arguments for sourcekitd, force the output mode
to -typecheck so that we do not create any temporary output files in the
driver. Previously, any sourcekitd operation that created a compiler
invocation would create 0-sized .o file inside $TMPDIR that would never
be cleaned up.

The new swift-driver project handles temporaries much better as
VirtualPath, and should not need this approach.

rdar://62366123
2020-05-18 16:52:41 -07:00

30 lines
1.3 KiB
Swift

// REQUIRES: shell
// RUN: %empty-directory(%t)
// RUN: env TMPDIR=%t __XPC_TMPDIR=%t %sourcekitd-test -req=syntax-map %s
// RUN: ls %t/ | count 0
// RUN: %empty-directory(%t)
// RUN: env TMPDIR=%t __XPC_TMPDIR=%t %sourcekitd-test -req=syntax-map %s -- %s
// RUN: ls %t/ | count 0
// RUN: %empty-directory(%t)
// RUN: env TMPDIR=%t __XPC_TMPDIR=%t %sourcekitd-test -req=syntax-map %s -- %s -c -o %t/foo.o
// RUN: ls %t/ | count 0
// RUN: %empty-directory(%t)
// RUN: env TMPDIR=%t __XPC_TMPDIR=%t %sourcekitd-test -req=sema %s -- %s
// RUN: ls %t/ | count 0
// RUN: %empty-directory(%t)
// RUN: env TMPDIR=%t __XPC_TMPDIR=%t %sourcekitd-test -req=sema %s -- %s -c -o %t/foo.o
// RUN: ls %t/ | count 0
// RUN: %empty-directory(%t)
// RUN: env TMPDIR=%t __XPC_TMPDIR=%t %sourcekitd-test -req=sema %s -- %s -emit-module -module-name main -emit-module-path %t/main.swiftmodule -emit-module-interface -enable-library-evolution -emit-module-interface-path %t/main.swiftinterface -emit-objc-header -emit-objc-header-path %t/main.h -c -o %t/foo.o
// RUN: ls %t/ | count 0
// RUN: %empty-directory(%t)
// RUN: env TMPDIR=%t __XPC_TMPDIR=%t %sourcekitd-test -req=sema %s -- %s -emit-module -module-name main -emit-module-path %t/main.swiftmodule -emit-executable -o %t/foo
// RUN: ls %t/ | count 0