Skip to content

Commit b8c9558

Browse files
authored
Add Cxx test module support (#141)
1 parent 38bf2ad commit b8c9558

File tree

10 files changed

+31
-30
lines changed

10 files changed

+31
-30
lines changed

Package.resolved

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ let openGraphSPITestTarget = Target.testTarget(
178178
cSettings: sharedCSettings + [
179179
.headerSearchPath("../../Sources/OpenGraph_SPI"),
180180
],
181-
swiftSettings: sharedSwiftSettings,
182-
linkerSettings: [.linkedFramework("XCTest")]
181+
swiftSettings: sharedSwiftSettings + [.interoperabilityMode(.Cxx)]
183182
)
184183
let openGraphShimsTestTarget = Target.testTarget(
185184
name: "OpenGraphShimsTests",

Sources/OpenGraph_SPI/Data/ptr.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#define ptr_hpp
1010

1111
#include "OGBase.h"
12-
#include "table.hpp"
12+
#include "OpenGraphCxx/table.hpp"
1313
#include <bitset>
1414
#include "page_const.hpp"
1515

Sources/OpenGraph_SPI/Data/table.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// Status: WIP
77
// Modified from https://github.com/jcmosc/Compute/blob/0a6b21a4cdeb9bbdd95e7e914c4e18bed37a2456/Sources/ComputeCxx/Data/Table.cpp [MIT License]
88

9-
#include "table.hpp"
9+
#include <OpenGraphCxx/table.hpp>
1010
#include "page.hpp"
1111
#include "page_const.hpp"
1212
#include "zone.hpp"

Sources/OpenGraph_SPI/Data/zone.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// OpenGraph_SPI
44

55
#include "zone.hpp"
6-
#include "table.hpp"
6+
#include <OpenGraphCxx/table.hpp>
77
#include "page.hpp"
88
#include "../Util/assert.hpp"
99
#if OG_TARGET_OS_DARWIN
File renamed without changes.
File renamed without changes.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module OpenGraph_SPI {
2+
header "OpenGraph-umbrella.h"
3+
export *
4+
}
5+
6+
// TODO: Change to module OpenGraphCxx and OpenGraphCxx.Internal
7+
module OpenGraph_SPI.Cxx {
8+
requires cplusplus
9+
umbrella "OpenGraphCxx"
10+
export *
11+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//
2+
// OpenGraph_SPITests.swift
3+
// OpenGraph
4+
5+
import OpenGraph_SPI.Cxx
6+
import Testing
7+
8+
struct OpenGraph_SPITests {
9+
#if canImport(Darwin) // table() is not implemented on Linux yet.
10+
@Test
11+
func table() {
12+
OG.data.table.ensure_shared()
13+
}
14+
#endif
15+
}

Tests/OpenGraph_SPITests/table_test_case.mm

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)