mirror of
https://github.com/reactos/CMake.git
synced 2024-11-24 12:09:48 +00:00
Merge topic 'xctest_static_framework'
bfa92e57
XCTest: Add support for static frameworks
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !732
This commit is contained in:
commit
380232e105
@ -123,6 +123,10 @@ function(xctest_add_bundle target testee)
|
||||
# testee is a Framework
|
||||
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)
|
||||
# testee is an App Bundle
|
||||
add_dependencies(${target} ${testee})
|
||||
|
@ -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)
|
||||
|
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
|
Loading…
Reference in New Issue
Block a user