summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2019-03-19 15:38:26 +0000
committerAdrian Prantl <aprantl@apple.com>2019-03-19 15:38:26 +0000
commitda8c0e4a3c0d91f5870f6f14237c81f3f143b84d (patch)
treef44aaa5a431cc070e26af073cff771d6d3fa20fe /lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import
parentaf40d4371d89d9c4a9be2e4bef3266577bd9ff3f (diff)
downloadbcm5719-llvm-da8c0e4a3c0d91f5870f6f14237c81f3f143b84d.tar.gz
bcm5719-llvm-da8c0e4a3c0d91f5870f6f14237c81f3f143b84d.zip
Improve error handling for Clang module imports.
rdar://problem/48883558 Differential Revision: https://reviews.llvm.org/D59524 llvm-svn: 356462
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/Inputs/Bar.h (renamed from lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/Bar.h)0
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/Inputs/Foo.h (renamed from lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/Foo.h)0
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/Inputs/module.modulemap (renamed from lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/module.modulemap)0
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/Makefile3
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/TestCXXModulesImport.py27
5 files changed, 22 insertions, 8 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/Bar.h b/lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/Inputs/Bar.h
index 3d9a88c024d..3d9a88c024d 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/Bar.h
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/Inputs/Bar.h
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/Foo.h b/lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/Inputs/Foo.h
index 1fe02e89786..1fe02e89786 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/Foo.h
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/Inputs/Foo.h
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/module.modulemap b/lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/Inputs/module.modulemap
index 4221d0f9134..4221d0f9134 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/module.modulemap
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/Inputs/module.modulemap
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/Makefile b/lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/Makefile
index 796b4dc5ef3..2b8f23bcec7 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/Makefile
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/Makefile
@@ -1,6 +1,5 @@
LEVEL = ../../../make
CXX_SOURCES := main.cpp
-
-CFLAGS += $(MANDATORY_MODULE_BUILD_CFLAGS)
+CFLAGS_EXTRAS = $(MANDATORY_MODULE_BUILD_CFLAGS) -I$(BUILDDIR)/include
include $(LEVEL)/Makefile.rules
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/TestCXXModulesImport.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/TestCXXModulesImport.py
index 74ac4005673..cee551d2bc8 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/TestCXXModulesImport.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/modules-import/TestCXXModulesImport.py
@@ -2,13 +2,9 @@
from __future__ import print_function
-
-from distutils.version import StrictVersion
import unittest2
-import os
-import time
import lldb
-import platform
+import shutil
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
@@ -19,13 +15,32 @@ class CXXModulesImportTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ def build(self):
+ include = self.getBuildArtifact('include')
+ lldbutil.mkdir_p(include)
+ for f in ['Foo.h', 'Bar.h', 'module.modulemap']:
+ shutil.copyfile(self.getSourcePath(os.path.join('Inputs', f)),
+ os.path.join(include, f))
+ super(CXXModulesImportTestCase, self).build()
+
@skipUnlessDarwin
@skipIf(macos_version=["<", "10.12"])
def test_expr(self):
self.build()
- exe = self.getBuildArtifact("a.out")
target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(
self, 'break here', lldb.SBFileSpec('main.cpp'))
self.expect("expr -l Objective-C++ -- @import Bar")
self.expect("expr -- Bar()", substrs = ["success"])
+ self.expect("expr -l Objective-C++ -- @import THIS_MODULE_DOES_NOT_EXIST",
+ error=True)
+
+ @skipUnlessDarwin
+ @skipIf(macos_version=["<", "10.12"])
+ def test_expr_failing_import(self):
+ self.build()
+ shutil.rmtree(self.getBuildArtifact('include'))
+ target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(
+ self, 'break here', lldb.SBFileSpec('main.cpp'))
+
+ self.expect("expr -l Objective-C++ -- @import Bar", error=True)
OpenPOWER on IntegriCloud