summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-04-26 13:00:16 +0000
committerKitware Robot <kwrobot@kitware.com>2017-04-26 09:00:20 -0400
commit380232e10519d97a382bb50a048baa3044d3d170 (patch)
treeade861e05f688d575f3789a5104abd49b41e611a /Tests
parentf03bbc3970ce71ca4dd11b26ffab02e9ac62b7fe (diff)
parentbfa92e5725121d2c770fa6f0f47383c0436d768a (diff)
downloadcmake-380232e10519d97a382bb50a048baa3044d3d170.tar.gz
Merge topic 'xctest_static_framework'
bfa92e57 XCTest: Add support for static frameworks Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !732
Diffstat (limited to 'Tests')
-rw-r--r--Tests/XCTest/CMakeLists.txt16
-rw-r--r--Tests/XCTest/StaticLibExample/StaticLibExample.c6
-rw-r--r--Tests/XCTest/StaticLibExample/StaticLibExample.h1
-rw-r--r--Tests/XCTest/StaticLibExampleTests/Info.plist24
-rw-r--r--Tests/XCTest/StaticLibExampleTests/StaticLibExampleTests.m16
5 files changed, 63 insertions, 0 deletions
diff --git a/Tests/XCTest/CMakeLists.txt b/Tests/XCTest/CMakeLists.txt
index e8666231b0..d40c40e2ab 100644
--- a/Tests/XCTest/CMakeLists.txt
+++ b/Tests/XCTest/CMakeLists.txt
@@ -55,3 +55,19 @@ xctest_add_bundle(CocoaExampleTests CocoaExample
CocoaExampleTests/CocoaExampleTests.m)
xctest_add_test(XCTest.CocoaExample CocoaExampleTests)
+
+# Static lib
+
+add_library(StaticLibExample STATIC
+ StaticLibExample/StaticLibExample.h
+ StaticLibExample/StaticLibExample.c
+)
+
+target_include_directories(StaticLibExample PUBLIC .)
+
+# XCTest for Static lib
+
+xctest_add_bundle(StaticLibExampleTests StaticLibExample
+ StaticLibExampleTests/StaticLibExampleTests.m)
+
+xctest_add_test(XCTest.StaticLibExample StaticLibExampleTests)
diff --git a/Tests/XCTest/StaticLibExample/StaticLibExample.c b/Tests/XCTest/StaticLibExample/StaticLibExample.c
new file mode 100644
index 0000000000..b198f80f3d
--- /dev/null
+++ b/Tests/XCTest/StaticLibExample/StaticLibExample.c
@@ -0,0 +1,6 @@
+#include "StaticLibExample.h"
+
+int FourtyFour()
+{
+ return 44;
+}
diff --git a/Tests/XCTest/StaticLibExample/StaticLibExample.h b/Tests/XCTest/StaticLibExample/StaticLibExample.h
new file mode 100644
index 0000000000..147a909aa9
--- /dev/null
+++ b/Tests/XCTest/StaticLibExample/StaticLibExample.h
@@ -0,0 +1 @@
+int FourtyFour();
diff --git a/Tests/XCTest/StaticLibExampleTests/Info.plist b/Tests/XCTest/StaticLibExampleTests/Info.plist
new file mode 100644
index 0000000000..6ad9a27b57
--- /dev/null
+++ b/Tests/XCTest/StaticLibExampleTests/Info.plist
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>StaticLibExampleTests</string>
+ <key>CFBundleIdentifier</key>
+ <string>org.cmake.StaticLibExampleTests</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>StaticLibExampleTests</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+</dict>
+</plist>
diff --git a/Tests/XCTest/StaticLibExampleTests/StaticLibExampleTests.m b/Tests/XCTest/StaticLibExampleTests/StaticLibExampleTests.m
new file mode 100644
index 0000000000..5f8a769f5a
--- /dev/null
+++ b/Tests/XCTest/StaticLibExampleTests/StaticLibExampleTests.m
@@ -0,0 +1,16 @@
+#import <XCTest/XCTest.h>
+
+#import "StaticLibExample/StaticLibExample.h"
+
+@interface StaticLibExampleTests : XCTestCase
+
+@end
+
+@implementation StaticLibExampleTests
+
+- (void)testFourtyFour {
+ // This is an example of a functional test case.
+ XCTAssertEqual(44, FourtyFour());
+}
+
+@end