Skip to content

Commit adf9d59

Browse files
committed
Check value of __clang_major__
1 parent 279629f commit adf9d59

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

Sources/Testing/Events/Recorder/Event.HumanReadableOutputRecorder.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// See https://swift.org/CONTRIBUTORS.txt for Swift project authors
99
//
1010

11+
private import _TestingInternals
12+
1113
extension Event {
1214
/// A type which handles ``Event`` instances and outputs representations of
1315
/// them as human-readable messages.
@@ -356,6 +358,7 @@ extension Event.HumanReadableOutputRecorder {
356358

357359
case .runStarted:
358360
var comments = [Comment]()
361+
comments.append("Clang Major: \(clangMajor())")
359362
if verbosity > 0 {
360363
if let swiftStandardLibraryVersion {
361364
comments.append("Swift Standard Library Version: \(swiftStandardLibraryVersion)")

Sources/_TestingInternals/Versions.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
#include <algorithm>
1515
#include <iterator>
1616

17+
int clangMajor(void) {
18+
return __clang_major__;
19+
}
20+
1721
const char *swt_getTestingLibraryVersion(void) {
1822
#if defined(SWT_TESTING_LIBRARY_VERSION)
1923
// The current environment explicitly specifies a version string to return.

Sources/_TestingInternals/include/Versions.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ static inline uint64_t swt_getSwiftCompilerVersion(void) {
3030
#endif
3131
}
3232

33+
SWT_EXTERN int clangMajor(void);
34+
3335
/// Get the human-readable version of the testing library.
3436
///
3537
/// - Returns: A human-readable string describing the version of the testing

0 commit comments

Comments
 (0)