mirror of
https://github.com/apple/swift-nio-http2
synced 2026-11-24 04:38:00 +00:00
Motivation: Without knowing where an error was thrown it can be unnecessarily difficult to work out the reasons an application ended up in an error state. Modifications: - Add a 'file' string to each of the 'NIOHTTP2Errors' denoting the file and line where an error was created - Add static methods to create errors to 'NIOHTTP2Errors' defaulting file and line, this is unfortunately necessary as defaulting file and line in the `init` makes the defaulted and non-defaulted errors indistinguishable, and the compiler will pick the one with fewest defaulted values. - Add equatable conformance manually so as to ignore 'file' - Add backing storage to errors which no longer be stored in an existential container - Add 'CustomStringConvertible' conformance to the errors using backing storage so that the 'file' is actually visible when converting the error - Deprecate the old `init`s - Fix all deprecation warnings Result: - NIOHTTP2Errors carry a 'file' with them indicating where they were created
68 lines
2.9 KiB
Swift
68 lines
2.9 KiB
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the SwiftNIO open source project
|
|
//
|
|
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors
|
|
// Licensed under Apache License v2.0
|
|
//
|
|
// See LICENSE.txt for license information
|
|
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// LinuxMain.swift
|
|
//
|
|
import XCTest
|
|
|
|
///
|
|
/// NOTE: This file was generated by generate_linux_tests.rb
|
|
///
|
|
/// Do NOT edit this file directly as it will be regenerated automatically when needed.
|
|
///
|
|
|
|
#if os(Linux) || os(FreeBSD)
|
|
@testable import NIOHPACKTests
|
|
@testable import NIOHTTP2Tests
|
|
|
|
// This protocol is necessary to we can call the 'run' method (on an existential of this protocol)
|
|
// without the compiler noticing that we're calling a deprecated function.
|
|
// This hack exists so we can deprecate individual tests which test deprecated functionality without
|
|
// getting a compiler warning...
|
|
protocol LinuxMainRunner { func run() }
|
|
class LinuxMainRunnerImpl: LinuxMainRunner {
|
|
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings")
|
|
func run() {
|
|
XCTMain([
|
|
testCase(CompoundOutboundBufferTest.allTests),
|
|
testCase(ConcurrentStreamBufferTests.allTests),
|
|
testCase(ConfiguringPipelineTests.allTests),
|
|
testCase(ConfiguringPipelineWithFramePayloadStreamsTests.allTests),
|
|
testCase(ConnectionStateMachineTests.allTests),
|
|
testCase(ControlFrameBufferTests.allTests),
|
|
testCase(HPACKCodingTests.allTests),
|
|
testCase(HPACKIntegrationTests.allTests),
|
|
testCase(HPACKRegressionTests.allTests),
|
|
testCase(HTTP2ErrorTests.allTests),
|
|
testCase(HTTP2FrameParserTests.allTests),
|
|
testCase(HTTP2FramePayloadStreamMultiplexerTests.allTests),
|
|
testCase(HTTP2FramePayloadToHTTP1CodecTests.allTests),
|
|
testCase(HTTP2StreamMultiplexerTests.allTests),
|
|
testCase(HTTP2ToHTTP1CodecTests.allTests),
|
|
testCase(HeaderTableTests.allTests),
|
|
testCase(HuffmanCodingTests.allTests),
|
|
testCase(InboundWindowManagerTests.allTests),
|
|
testCase(IntegerCodingTests.allTests),
|
|
testCase(OutboundFlowControlBufferTests.allTests),
|
|
testCase(ReentrancyTests.allTests),
|
|
testCase(SimpleClientServerFramePayloadStreamTests.allTests),
|
|
testCase(SimpleClientServerTests.allTests),
|
|
testCase(StreamChannelFlowControllerTests.allTests),
|
|
testCase(StreamIDTests.allTests),
|
|
])
|
|
}
|
|
}
|
|
(LinuxMainRunnerImpl() as LinuxMainRunner).run()
|
|
#endif
|