---
title: XCTSourceCodeContext
framework: xctest
role: symbol
role_heading: Class
path: xctest/xctsourcecodecontext
---

# XCTSourceCodeContext

An object that contains call stack and source code location details to provide context for a point of execution in a test.

## Declaration

```swift
class XCTSourceCodeContext
```

## Topics

### Initializers

- [init(callStack:location:)](xctest/xctsourcecodecontext/init(callstack:location:).md)
- [init(callStackAddresses:location:)](xctest/xctsourcecodecontext/init(callstackaddresses:location:).md)
- [init(location:)](xctest/xctsourcecodecontext/init(location:).md)
- [init()](xctest/xctsourcecodecontext/init().md)

### Context Information

- [callStack](xctest/xctsourcecodecontext/callstack.md)
- [location](xctest/xctsourcecodecontext/location.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)

## See Also

### Test Failures

- [XCTIssue](xctest/xctissue-swift.struct.md)
- [XCTIssueReference](xctest/xctissuereference.md)
- [XCTMutableIssue](xctest/xctmutableissue.md)
- [XCTSourceCodeFrame](xctest/xctsourcecodeframe.md)
- [XCTSourceCodeLocation](xctest/xctsourcecodelocation.md)
- [XCTSourceCodeSymbolInfo](xctest/xctsourcecodesymbolinfo.md)
