def test_find(self): # Unknown tool self.assertIsNone(xcrun.find('a-tool-that-isnt-on-osx', sdk='macosx', toolchain='default')) # Avaiable tool self.assertTrue(xcrun.find('clang', sdk='macosx', toolchain='default').endswith('/clang'))
def test_find(self): # Unknown tool self.assertIsNone(xcrun.find('a-tool-that-isnt-on-osx', sdk='macosx', toolchain='default')) # Available tool self.assertTrue(xcrun.find('clang', sdk='macosx', toolchain='default').endswith('/clang'))
def test_when_tool_found_returns_path(self): self.assertTrue( xcrun.find(toolchain='default', tool='clang').endswith('/clang'))
def test_when_tool_not_found_returns_none(self): self.assertIsNone( xcrun.find(toolchain='default', tool='a-tool-that-isnt-on-osx'))
def test_when_tool_found_returns_path(self): self.assertTrue(xcrun.find( toolchain='default', tool='clang').endswith('/clang'))
def test_when_tool_not_found_returns_none(self): self.assertIsNone(xcrun.find( toolchain='default', tool='a-tool-that-isnt-on-osx'))
import os import pipes import sys from multiprocessing import Process # hack to import SwiftBuildSupport and swift_build_support parent_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..') sys.path.append(parent_dir) support_dir = os.path.join(parent_dir, 'swift_build_support') sys.path.append(support_dir) from swift_build_support import xcrun # noqa (E402) from SwiftBuildSupport import check_output, check_call # noqa (E402) # FIXME: This doesn't work on non-Darwin platforms. LLVM_PROFDATA_PATH = xcrun.find('default', 'llvm-profdata') _profdata_help = check_output([LLVM_PROFDATA_PATH, 'merge', '-help']) LLVM_PROFDATA_SUPPORTS_SPARSE = 'sparse' in _profdata_help class ProfdataMergerProcess(Process): def __init__(self, config, file_queue): super(ProfdataMergerProcess, self).__init__() self.config = config self.file_queue = file_queue self.filename_buffer = [] self.profdata_path = os.path.join(config.tmp_dir, "%s.profdata" % self.name) self.profdata_tmp_path = self.profdata_path + ".copy" def report(self, msg, level=logging.INFO):
import pipes import sys from multiprocessing import Process # hack to import SwiftBuildSupport and swift_build_support parent_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..') sys.path.append(parent_dir) support_dir = os.path.join(parent_dir, 'swift_build_support') sys.path.append(support_dir) from swift_build_support import xcrun # noqa (E402) from SwiftBuildSupport import check_output, check_call # noqa (E402) # FIXME: This doesn't work on non-Darwin platforms. LLVM_PROFDATA_PATH = xcrun.find('default', 'llvm-profdata') _profdata_help = check_output([LLVM_PROFDATA_PATH, 'merge', '-help']) LLVM_PROFDATA_SUPPORTS_SPARSE = 'sparse' in _profdata_help class ProfdataMergerProcess(Process): def __init__(self, config, file_queue): super(ProfdataMergerProcess, self).__init__() self.config = config self.file_queue = file_queue self.filename_buffer = [] self.profdata_path = os.path.join(config.tmp_dir, "%s.profdata" % self.name) self.profdata_tmp_path = self.profdata_path + ".copy" def report(self, msg, level=logging.INFO):
def test_find(self): # Unknown tool self.assertIsNone(xcrun.find("a-tool-that-isnt-on-osx", sdk="macosx", toolchain="default")) # Avaiable tool self.assertTrue(xcrun.find("clang", sdk="macosx", toolchain="default").endswith("/clang"))