Skip to content

Commit 721cb77

Browse files
committed
move loglevel to warning in tests, no need for much output in tests
1 parent 4adde8e commit 721cb77

File tree

5 files changed

+25
-24
lines changed

5 files changed

+25
-24
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ endif
3939

4040
SAMPLES_DIR := "Samples"
4141

42-
4342
all: generate-all
4443

4544
$(BUILD_DIR)/debug/libJavaKit.$(LIB_SUFFIX) $(BUILD_DIR)/debug/Java2Swift:

Sources/JExtractSwift/Swift2JavaTranslator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import SwiftSyntax
2222
public final class Swift2JavaTranslator {
2323
static let SWIFT_INTERFACE_SUFFIX = ".swiftinterface"
2424

25-
public var log = Logger(label: "translator", logLevel: .info)
25+
package var log = Logger(label: "translator", logLevel: .info)
2626

2727
// ==== Input configuration
2828
let swiftModuleName: String

Tests/JExtractSwiftTests/FuncImportTests.swift

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,13 @@ final class MethodImportTests {
6262
}
6363
"""
6464

65-
@Test func method_helloWorld() async throws {
65+
@Test
66+
func method_helloWorld() async throws {
6667
let st = Swift2JavaTranslator(
6768
javaPackage: "com.example.swift",
6869
swiftModuleName: "__FakeModule"
6970
)
70-
st.log.logLevel = .info
71+
st.log.logLevel = .error
7172

7273
try await st.analyze(swiftInterfacePath: "/fake/Fake.swiftinterface", text: class_interfaceFile)
7374

@@ -101,12 +102,13 @@ final class MethodImportTests {
101102
)
102103
}
103104

104-
@Test func method_globalTakeInt() async throws {
105+
@Test
106+
func method_globalTakeInt() async throws {
105107
let st = Swift2JavaTranslator(
106108
javaPackage: "com.example.swift",
107109
swiftModuleName: "__FakeModule"
108110
)
109-
st.log.logLevel = .info
111+
st.log.logLevel = .error
110112

111113
try await st.analyze(swiftInterfacePath: "/fake/__FakeModule/SwiftFile.swiftinterface", text: class_interfaceFile)
112114

@@ -142,12 +144,13 @@ final class MethodImportTests {
142144
)
143145
}
144146

145-
@Test func method_globalTakeIntLongString() async throws {
147+
@Test
148+
func method_globalTakeIntLongString() async throws {
146149
let st = Swift2JavaTranslator(
147150
javaPackage: "com.example.swift",
148151
swiftModuleName: "__FakeModule"
149152
)
150-
st.log.logLevel = .info
153+
st.log.logLevel = .error
151154

152155
try await st.analyze(swiftInterfacePath: "/fake/__FakeModule/SwiftFile.swiftinterface", text: class_interfaceFile)
153156

@@ -183,12 +186,13 @@ final class MethodImportTests {
183186
)
184187
}
185188

186-
@Test func method_class_helloMemberFunction_self_memorySegment() async throws {
189+
@Test
190+
func method_class_helloMemberFunction_self_memorySegment() async throws {
187191
let st = Swift2JavaTranslator(
188192
javaPackage: "com.example.swift",
189193
swiftModuleName: "__FakeModule"
190194
)
191-
st.log.logLevel = .info
195+
st.log.logLevel = .error
192196

193197
try await st.analyze(swiftInterfacePath: "/fake/__FakeModule/SwiftFile.swiftinterface", text: class_interfaceFile)
194198

@@ -224,12 +228,13 @@ final class MethodImportTests {
224228
)
225229
}
226230

227-
@Test func method_class_helloMemberFunction_self_wrapper() async throws {
231+
@Test
232+
func method_class_helloMemberFunction_self_wrapper() async throws {
228233
let st = Swift2JavaTranslator(
229234
javaPackage: "com.example.swift",
230235
swiftModuleName: "__FakeModule"
231236
)
232-
st.log.logLevel = .info
237+
st.log.logLevel = .error
233238

234239
try await st.analyze(swiftInterfacePath: "/fake/__FakeModule/SwiftFile.swiftinterface", text: class_interfaceFile)
235240

@@ -265,6 +270,7 @@ final class MethodImportTests {
265270
)
266271
}
267272

273+
@Test
268274
func test_method_class_helloMemberFunction_self_wrapper() async throws {
269275
let st = Swift2JavaTranslator(
270276
javaPackage: "com.example.swift",
@@ -306,7 +312,8 @@ final class MethodImportTests {
306312
)
307313
}
308314

309-
@Test func method_class_helloMemberFunction_wrapper() async throws {
315+
@Test
316+
func method_class_helloMemberFunction_wrapper() async throws {
310317
let st = Swift2JavaTranslator(
311318
javaPackage: "com.example.swift",
312319
swiftModuleName: "__FakeModule"
@@ -339,7 +346,8 @@ final class MethodImportTests {
339346
)
340347
}
341348

342-
@Test func method_class_makeInt_wrapper() async throws {
349+
@Test
350+
func method_class_makeInt_wrapper() async throws {
343351
let st = Swift2JavaTranslator(
344352
javaPackage: "com.example.swift",
345353
swiftModuleName: "__FakeModule"
@@ -372,7 +380,8 @@ final class MethodImportTests {
372380
)
373381
}
374382

375-
@Test func class_constructor() async throws {
383+
@Test
384+
func class_constructor() async throws {
376385
let st = Swift2JavaTranslator(
377386
javaPackage: "com.example.swift",
378387
swiftModuleName: "__FakeModule"

Tests/JExtractSwiftTests/FunctionDescriptorImportTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ final class FunctionDescriptorTests {
5252
_ methodIdentifier: String,
5353
javaPackage: String = "com.example.swift",
5454
swiftModuleName: String = "SwiftModule",
55-
logLevel: Logger.Level = .trace,
55+
logLevel: Logger.Level = .warning,
5656
body: (String) async throws -> ()
5757
) async throws {
5858
let st = Swift2JavaTranslator(

Tests/JavaKitTests/BasicRuntimeTests.swift

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,8 @@ let jvm = try! JavaVirtualMachine(vmOptions: [])
2424
@Suite
2525
@MainActor
2626
struct BasicRuntimeTests {
27-
#if os(Linux)
28-
@Test("Object management", .disabled("Attempts to refcount a null pointer on Linux"))
29-
#else
27+
3028
@Test("Object management")
31-
#endif
3229
func javaObjectManagement() throws {
3330
let sneakyJavaThis: jobject
3431
do {
@@ -54,11 +51,7 @@ struct BasicRuntimeTests {
5451
#expect(url.javaHolder === urlAgain.javaHolder)
5552
}
5653

57-
#if os(Linux)
58-
@Test("Java exceptions", .disabled("Attempts to refcount a null pointer on Linux"))
59-
#else
6054
@Test("Java exceptions")
61-
#endif
6255
func javaExceptionsInSwift() async throws {
6356
do {
6457
_ = try URL("bad url", environment: jvm.environment)

0 commit comments

Comments
 (0)