]> granicus.if.org Git - clang/commitdiff
Add files that I forgot to svn add in 201578.
authorDmitri Gribenko <gribozavr@gmail.com>
Tue, 18 Feb 2014 15:29:17 +0000 (15:29 +0000)
committerDmitri Gribenko <gribozavr@gmail.com>
Tue, 18 Feb 2014 15:29:17 +0000 (15:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201579 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/libclang/CMakeLists.txt [new file with mode: 0644]
unittests/libclang/LibclangTest.cpp [new file with mode: 0644]
unittests/libclang/Makefile [new file with mode: 0644]

diff --git a/unittests/libclang/CMakeLists.txt b/unittests/libclang/CMakeLists.txt
new file mode 100644 (file)
index 0000000..1cdc45e
--- /dev/null
@@ -0,0 +1,7 @@
+add_clang_unittest(libclangTests
+  LibclangTest.cpp
+  )
+
+target_link_libraries(libclangTests
+  libclang
+  )
diff --git a/unittests/libclang/LibclangTest.cpp b/unittests/libclang/LibclangTest.cpp
new file mode 100644 (file)
index 0000000..7048af9
--- /dev/null
@@ -0,0 +1,17 @@
+//===- unittests/libclang/LibclangTest.cpp --- libclang tests -------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang-c/Index.h"
+#include "gtest/gtest.h"
+
+TEST(libclang, TestInvalidArgs) {
+  EXPECT_EQ(CXError_InvalidArguments,
+            clang_parseTranslationUnit2(0, 0, 0, 0, 0, 0, 0, 0));
+}
+
diff --git a/unittests/libclang/Makefile b/unittests/libclang/Makefile
new file mode 100644 (file)
index 0000000..7b14c82
--- /dev/null
@@ -0,0 +1,27 @@
+##===- unittests/libclang/Makefile -------------------------*- Makefile -*-===##
+#
+#                     The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+CLANG_LEVEL = ../..
+TESTNAME = libclang
+LINK_LIBS_IN_SHARED := 1
+
+include $(CLANG_LEVEL)/../../Makefile.config
+LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
+
+# Note that 'USEDLIBS' must include all of the core clang libraries
+# when -static is given to linker on cygming.
+USEDLIBS = clang.a \
+          clangIndex.a clangFormat.a clangRewriteCore.a \
+          clangFrontend.a clangDriver.a \
+          clangTooling.a \
+          clangSerialization.a clangParse.a clangSema.a \
+          clangAnalysis.a clangEdit.a clangAST.a clangLex.a \
+          clangBasic.a
+
+include $(CLANG_LEVEL)/unittests/Makefile