Esempio n. 1
0
 def do_repl_test(self):
     sdk_root = swift.getSwiftSDKRoot()
     build_dir = self.getBuildDir()
     repl_args = [
         lldbtest_config.lldbExec, "-x",
         "--repl=-enable-objc-interop -sdk %s -L%s -I%s" %
         (sdk_root, build_dir, build_dir)
     ]
     repl_proc = subprocess.Popen(repl_args,
                                  stdin=subprocess.PIPE,
                                  stdout=subprocess.PIPE,
                                  cwd=build_dir)
     input_str = "import Wrapper\ncall_cpp()\n:quit"
     (stdoutdata,
      stderrdata) = repl_proc.communicate(input=input_str.encode())
     stdoutdata = stdoutdata.decode("utf-8") if stdoutdata else None
     stderrdata = stderrdata.decode("utf-8") if stderrdata else None
     self.assertTrue(
         "I called it successfully" in stdoutdata,
         "Didn't call call_cpp successfully: out: \n%s\nerr: %s" %
         (stdoutdata, stderrdata))
Esempio n. 2
0
def getCCSpec(compiler):
    """
    Helper function to return the key-value string to specify the compiler
    used for the make system.
    """

    lldbLib = os.environ["LLDB_LIB_DIR"] if "LLDB_LIB_DIR" in os.environ else None

    cc = compiler if compiler else None
    if not cc and "CC" in os.environ:
        cc = os.environ["CC"]

    swiftcc = swift.getSwiftCompiler()

    # Note the leading space character.
    if cc:
        if swiftcc:
            return (" CC=" + cc + " SWIFTCC=" + swiftcc + " SWIFTLIBS=\"" + swift.getSwiftLibraryPath() +
                "\" SWIFTSDKROOT=\"" + swift.getSwiftSDKRoot() + "\"")
        else:
            return "CC=\"{0!s}\"".format(cc)
    return ""
Esempio n. 3
0
def getCCSpec(compiler):
    """
    Helper function to return the key-value string to specify the compiler
    used for the make system.
    """

    lldbLib = os.environ["LLDB_LIB_DIR"] if "LLDB_LIB_DIR" in os.environ else None

    cc = compiler if compiler else None
    if not cc and "CC" in os.environ:
        cc = os.environ["CC"]

    swiftcc = swift.getSwiftCompiler()

    # Note the leading space character.
    if cc:
        if swiftcc:
            return (" CC=" + cc + " SWIFTCC=" + swiftcc + " SWIFTLIBS=\"" + swift.getSwiftLibraryPath() +
                "\" SWIFTSDKROOT=\"" + swift.getSwiftSDKRoot() + "\"")
        else:
            return "CC=\"%s\"" % cc
    return ""
Esempio n. 4
0
 def launchArgs(self):
     return '-x "--repl=-enable-objc-interop -sdk {0!s} -color-diagnostics"'.format(
         (swift.getSwiftSDKRoot()))
Esempio n. 5
0
 def launchArgs(self):
     return '-x "--repl=-enable-objc-interop -sdk %s"' % (swift.getSwiftSDKRoot())
 def launchArgs(self):
     return '-x "--repl=-enable-objc-interop -sdk %s"' % (
         swift.getSwiftSDKRoot())
Esempio n. 7
0
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.txt for license information
# See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
#
# ------------------------------------------------------------------------------

import argparse
import os
import sys
import commands
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'plugins'))

import swift

parser = argparse.ArgumentParser()
parser.add_argument('-l', action='store_true')
parser.add_argument('-s', action='store_true')

args = parser.parse_args()

if (args.l):
    print swift.getSwiftLibraryPath()
elif (args.s):
    print swift.getSwiftSDKRoot()
else:
    print swift.getSwiftCompiler()
Esempio n. 8
0
 def launchArgs(self):
     return '-x "--repl=-enable-objc-interop -sdk {0!s} -color-diagnostics"'.format((swift.getSwiftSDKRoot()))