Skip to content

Commit e40db8b

Browse files
committed
Revert "Skipping the JVM tests on macOS terminal since unreliable (crashes in JVM create)"
This reverts commit 6f6c350.
1 parent 5ed0063 commit e40db8b

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

Tests/JExtractSwiftTests/VariableImportTests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ final class VariableImportTests {
4141
)
4242
st.log.logLevel = .error
4343

44-
try st.analyze(swiftInterfacePath: "/fake/Fake.swiftinterface", text: class_interfaceFile)
44+
try await st.analyze(swiftInterfacePath: "/fake/Fake.swiftinterface", text: class_interfaceFile)
4545

4646
let identifier = "counterInt"
4747
let varDecl: ImportedVariable? =
@@ -59,6 +59,7 @@ final class VariableImportTests {
5959
}
6060

6161
assertOutput(
62+
dump: true,
6263
output,
6364
expected:
6465
"""

Tests/JavaKitTests/BasicRuntimeTests.swift

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,13 @@ import JavaKitNetwork
1717
import JavaKitVM
1818
import Testing
1919

20-
#if os(Linux)
21-
import Glibc
22-
#else
23-
import Darwin
24-
#endif
25-
2620
@MainActor
2721
let jvm = try! JavaVirtualMachine(vmOptions: [])
2822

2923
@Suite
3024
@MainActor
3125
struct BasicRuntimeTests {
32-
@Test("Object management", .disabled(if: isMacOSTerminal || isLinux, "JVM creation fails occasionally in terminal on macOS, and some issues on Linux"))
26+
@Test("Object management", .disabled(if: isLinux, "Attempts to refcount a null pointer on Linux"))
3327
func javaObjectManagement() throws {
3428
let sneakyJavaThis: jobject
3529
do {
@@ -55,7 +49,7 @@ struct BasicRuntimeTests {
5549
#expect(url.javaHolder === urlAgain.javaHolder)
5650
}
5751

58-
@Test("Java exceptions", .disabled(if: isMacOSTerminal || isLinux, "JVM creation fails occasionally in terminal on macOS, and some issues on Linux"))
52+
@Test("Java exceptions", .disabled(if: isLinux, "Attempts to refcount a null pointer on Linux"))
5953
func javaExceptionsInSwift() throws {
6054
do {
6155
_ = try URL("bad url", environment: jvm.environment)
@@ -64,13 +58,13 @@ struct BasicRuntimeTests {
6458
}
6559
}
6660

67-
@Test("Static methods", .disabled(if: isMacOSTerminal || isLinux, "JVM creation fails occasionally in terminal on macOS, and some issues on Linux"))
61+
@Test("Static methods", .disabled(if: isMacOS, "Fails on macOS command line"))
6862
func staticMethods() throws {
6963
let urlConnectionClass = try JavaClass<URLConnection>(in: jvm.environment)
7064
#expect(urlConnectionClass.getDefaultAllowUserInteraction() == false)
7165
}
7266

73-
@Test("Class instance lookup", .disabled(if: isMacOSTerminal || isLinux, "JVM creation fails occasionally in terminal on macOS, and some issues on Linux"))
67+
@Test("Class instance lookup")
7468
func classInstanceLookup() throws {
7569
do {
7670
_ = try JavaClass<Nonexistent>(in: jvm.environment)
@@ -92,11 +86,6 @@ var isLinux: Bool {
9286
#endif
9387
}
9488

95-
/// Whether we're running on MacOS in an interactive terminal session.
96-
var isMacOSTerminal: Bool {
97-
isMacOS && isatty(STDOUT_FILENO) == 1
98-
}
99-
10089
/// Whether we're running on MacOS.
10190
var isMacOS: Bool {
10291
#if os(macOS)

0 commit comments

Comments
 (0)