mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-13 18:49:38 -06:00
committed by
Brad King
parent
b4d3cdc8c5
commit
bfa92e5725
@@ -123,6 +123,10 @@ function(xctest_add_bundle target testee)
|
|||||||
# testee is a Framework
|
# testee is a Framework
|
||||||
target_link_libraries(${target} PRIVATE ${testee})
|
target_link_libraries(${target} PRIVATE ${testee})
|
||||||
|
|
||||||
|
elseif(_testee_type STREQUAL "STATIC_LIBRARY")
|
||||||
|
# testee is a static library
|
||||||
|
target_link_libraries(${target} PRIVATE ${testee})
|
||||||
|
|
||||||
elseif(_testee_type STREQUAL "EXECUTABLE" AND _testee_macosx_bundle)
|
elseif(_testee_type STREQUAL "EXECUTABLE" AND _testee_macosx_bundle)
|
||||||
# testee is an App Bundle
|
# testee is an App Bundle
|
||||||
add_dependencies(${target} ${testee})
|
add_dependencies(${target} ${testee})
|
||||||
|
|||||||
@@ -55,3 +55,19 @@ xctest_add_bundle(CocoaExampleTests CocoaExample
|
|||||||
CocoaExampleTests/CocoaExampleTests.m)
|
CocoaExampleTests/CocoaExampleTests.m)
|
||||||
|
|
||||||
xctest_add_test(XCTest.CocoaExample CocoaExampleTests)
|
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)
|
||||||
|
|||||||
6
Tests/XCTest/StaticLibExample/StaticLibExample.c
Normal file
6
Tests/XCTest/StaticLibExample/StaticLibExample.c
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#include "StaticLibExample.h"
|
||||||
|
|
||||||
|
int FourtyFour()
|
||||||
|
{
|
||||||
|
return 44;
|
||||||
|
}
|
||||||
1
Tests/XCTest/StaticLibExample/StaticLibExample.h
Normal file
1
Tests/XCTest/StaticLibExample/StaticLibExample.h
Normal file
@@ -0,0 +1 @@
|
|||||||
|
int FourtyFour();
|
||||||
24
Tests/XCTest/StaticLibExampleTests/Info.plist
Normal file
24
Tests/XCTest/StaticLibExampleTests/Info.plist
Normal file
@@ -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>
|
||||||
16
Tests/XCTest/StaticLibExampleTests/StaticLibExampleTests.m
Normal file
16
Tests/XCTest/StaticLibExampleTests/StaticLibExampleTests.m
Normal file
@@ -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
|
||||||
Reference in New Issue
Block a user