diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..08891d8 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,8 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..68e481a --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,25 @@ +name: Main + +on: + push: + branches: [main] + schedule: + - cron: "0 8,20 * * *" + +jobs: + unit-tests: + name: Unit tests + uses: apple/swift-nio/.github/workflows/unit_tests.yml@main + with: + linux_5_9_arguments_override: "--explicit-target-dependency-import-check error" + linux_5_10_arguments_override: "--explicit-target-dependency-import-check error" + linux_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable" + linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable" + linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable" + + benchmarks: + name: Benchmarks + # Workaround https://github.com/nektos/act/issues/1875 + uses: apple/swift-nio/.github/workflows/benchmarks.yml@main + with: + benchmark_package_path: "Benchmarks" diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..72a9228 --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,34 @@ +name: PR + +on: + pull_request: + types: [opened, reopened, synchronize] + +jobs: + soundness: + name: Soundness + uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main + with: + license_header_check_project_name: "Swift Distributed Tracing" + + # FIXME: We cannot use -warnings-as-errors because we inherit from a deprecated type in the Tracer type, + # and we need to keep supporting the old type still. This was introduced as we dropped Swift 5.6 and added 5.9/5.10. + unit-tests: + name: Unit tests + uses: apple/swift-nio/.github/workflows/unit_tests.yml@main + with: + linux_5_9_arguments_override: "--explicit-target-dependency-import-check error" + linux_5_10_arguments_override: "--explicit-target-dependency-import-check error" + linux_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable" + linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable" + linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable" + + benchmarks: + name: Benchmarks + uses: apple/swift-nio/.github/workflows/benchmarks.yml@main + with: + benchmark_package_path: "Benchmarks" + + cxx-interop: + name: Cxx interop + uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main diff --git a/.github/workflows/pull_request_label.yml b/.github/workflows/pull_request_label.yml new file mode 100644 index 0000000..86f199f --- /dev/null +++ b/.github/workflows/pull_request_label.yml @@ -0,0 +1,18 @@ +name: PR label + +on: + pull_request: + types: [labeled, unlabeled, opened, reopened, synchronize] + +jobs: + semver-label-check: + name: Semantic Version label check + runs-on: ubuntu-latest + timeout-minutes: 1 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + persist-credentials: false + - name: Check for Semantic Version label + uses: apple/swift-nio/.github/actions/pull_request_semver_label_checker@main diff --git a/.licenseignore b/.licenseignore new file mode 100644 index 0000000..9c91245 --- /dev/null +++ b/.licenseignore @@ -0,0 +1,36 @@ +.gitignore +**/.gitignore +.licenseignore +.gitattributes +.git-blame-ignore-revs +.mailfilter +.mailmap +.spi.yml +.swift-format +.editorconfig +.github/* +*.md +*.txt +*.yml +*.yaml +*.json +Package.swift +**/Package.swift +Package@-*.swift +**/Package@-*.swift +Package.resolved +**/Package.resolved +Makefile +*.modulemap +**/*.modulemap +**/*.docc/* +*.xcprivacy +**/*.xcprivacy +*.symlink +**/*.symlink +Dockerfile +**/Dockerfile +Snippets/* +dev/git.commit.template +.unacceptablelanguageignore +.dockerignore diff --git a/.swift-format b/.swift-format new file mode 100644 index 0000000..7e8ae73 --- /dev/null +++ b/.swift-format @@ -0,0 +1,68 @@ +{ + "version" : 1, + "indentation" : { + "spaces" : 4 + }, + "tabWidth" : 4, + "fileScopedDeclarationPrivacy" : { + "accessLevel" : "private" + }, + "spacesAroundRangeFormationOperators" : false, + "indentConditionalCompilationBlocks" : false, + "indentSwitchCaseLabels" : false, + "lineBreakAroundMultilineExpressionChainComponents" : false, + "lineBreakBeforeControlFlowKeywords" : false, + "lineBreakBeforeEachArgument" : true, + "lineBreakBeforeEachGenericRequirement" : true, + "lineLength" : 120, + "maximumBlankLines" : 1, + "respectsExistingLineBreaks" : true, + "prioritizeKeepingFunctionOutputTogether" : true, + "noAssignmentInExpressions" : { + "allowedFunctions" : [ + "XCTAssertNoThrow", + "XCTAssertThrowsError" + ] + }, + "rules" : { + "AllPublicDeclarationsHaveDocumentation" : false, + "AlwaysUseLiteralForEmptyCollectionInit" : false, + "AlwaysUseLowerCamelCase" : false, + "AmbiguousTrailingClosureOverload" : true, + "BeginDocumentationCommentWithOneLineSummary" : false, + "DoNotUseSemicolons" : true, + "DontRepeatTypeInStaticProperties" : true, + "FileScopedDeclarationPrivacy" : true, + "FullyIndirectEnum" : true, + "GroupNumericLiterals" : true, + "IdentifiersMustBeASCII" : true, + "NeverForceUnwrap" : false, + "NeverUseForceTry" : false, + "NeverUseImplicitlyUnwrappedOptionals" : false, + "NoAccessLevelOnExtensionDeclaration" : true, + "NoAssignmentInExpressions" : true, + "NoBlockComments" : true, + "NoCasesWithOnlyFallthrough" : true, + "NoEmptyTrailingClosureParentheses" : true, + "NoLabelsInCasePatterns" : true, + "NoLeadingUnderscores" : false, + "NoParensAroundConditions" : true, + "NoVoidReturnOnFunctionSignature" : true, + "OmitExplicitReturns" : true, + "OneCasePerLine" : true, + "OneVariableDeclarationPerLine" : true, + "OnlyOneTrailingClosureArgument" : true, + "OrderedImports" : true, + "ReplaceForEachWithForLoop" : true, + "ReturnVoidInsteadOfEmptyTuple" : true, + "UseEarlyExits" : false, + "UseExplicitNilCheckInConditions" : false, + "UseLetInEveryBoundCaseVariable" : false, + "UseShorthandTypeNames" : true, + "UseSingleLinePropertyGetter" : false, + "UseSynthesizedInitializer" : false, + "UseTripleSlashForDocumentationComments" : true, + "UseWhereClausesInForLoops" : false, + "ValidateDocumentationComments" : false + } +} diff --git a/.swiftformat b/.swiftformat deleted file mode 100644 index 04c2b62..0000000 --- a/.swiftformat +++ /dev/null @@ -1,19 +0,0 @@ -# file options - ---swiftversion 5.2 ---exclude .build ---exclude Tests/LinuxMain.swift ---exclude **/*Tests+XCTest.swift - -# format options - ---ifdef no-indent ---patternlet inline ---self insert ---stripunusedargs closure-only ---wraparguments before-first ---extensionacl on-declarations - -# rules - ---disable blankLinesAroundMark diff --git a/Benchmarks/.gitkeep b/Benchmarks/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Benchmarks/Benchmarks/TracingBenchmarks/AtrributeDSLBenchmark.swift b/Benchmarks/Benchmarks/TracingBenchmarks/AtrributeDSLBenchmark.swift index ac4d38b..345a3ba 100644 --- a/Benchmarks/Benchmarks/TracingBenchmarks/AtrributeDSLBenchmark.swift +++ b/Benchmarks/Benchmarks/TracingBenchmarks/AtrributeDSLBenchmark.swift @@ -2,26 +2,26 @@ // // This source file is part of the Swift Distributed Tracing open source project // -// Copyright (c) 2020-2023 Apple Inc. and the Swift Distributed Tracing project -// authors +// Copyright (c) 2020-2023 Apple Inc. and the Swift Distributed Tracing project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information +// See CONTRIBUTORS.txt for the list of Swift Distributed Tracing project authors // // SPDX-License-Identifier: Apache-2.0 // //===----------------------------------------------------------------------===// import Benchmark -import Tracing +import Tracing let benchmarks = { let defaultMetrics: [BenchmarkMetric] = [ - .mallocCountTotal, + .mallocCountTotal ] Benchmark( - "NoopTracing.startSpan/endSpan", + "NoopTracing.startSpan_endSpan", configuration: .init( metrics: defaultMetrics, timeUnits: .nanoseconds, diff --git a/Benchmarks/Package.resolved b/Benchmarks/Package.resolved index f606143..853efce 100644 --- a/Benchmarks/Package.resolved +++ b/Benchmarks/Package.resolved @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/ordo-one/package-benchmark.git", "state" : { - "revision" : "ddf6c1ae01e139120bcdb917ece52819ee69d47a", - "version" : "1.22.1" + "revision" : "d4909695344b6e1ef88f0a711df6ab8708dd135d", + "version" : "1.27.3" } }, { @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-argument-parser", "state" : { - "revision" : "c8ed701b513cf5177118a175d85fbbbcd707ab41", - "version" : "1.3.0" + "revision" : "41982a3656a71c768319979febd796c6fd111d5c", + "version" : "1.5.0" } }, { @@ -59,8 +59,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-service-context.git", "state" : { - "revision" : "ce0141c8f123132dbd02fd45fea448018762df1b", - "version" : "1.0.0" + "revision" : "0c62c5b4601d6c125050b5c3a97f20cce881d32b", + "version" : "1.1.0" } }, { @@ -68,8 +68,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-system", "state" : { - "revision" : "025bcb1165deab2e20d4eaba79967ce73013f496", - "version" : "1.2.1" + "revision" : "c8a44d836fe7913603e246acab7c528c2e780168", + "version" : "1.4.0" } }, { diff --git a/Benchmarks/Package.swift b/Benchmarks/Package.swift index db61de8..b541486 100644 --- a/Benchmarks/Package.swift +++ b/Benchmarks/Package.swift @@ -1,13 +1,13 @@ // swift-tools-version: 5.9 //===----------------------------------------------------------------------===// // -// This source file is part of the SwiftCertificates open source project +// This source file is part of the Swift Distributed Tracing open source project // -// Copyright (c) 2023 Apple Inc. and the SwiftCertificates project authors +// Copyright (c) 2023 Apple Inc. and the Swift Distributed Tracing project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information -// See CONTRIBUTORS.txt for the list of SwiftCertificates project authors +// See CONTRIBUTORS.txt for the list of Swift Distributed Tracing project authors // // SPDX-License-Identifier: Apache-2.0 // @@ -18,7 +18,7 @@ import PackageDescription let package = Package( name: "benchmarks", platforms: [ - .macOS("14"), + .macOS("14") ], dependencies: [ .package(path: "../"), @@ -35,6 +35,6 @@ let package = Package( plugins: [ .plugin(name: "BenchmarkPlugin", package: "package-benchmark") ] - ), + ) ] -) \ No newline at end of file +) diff --git a/Benchmarks/Thresholds/5.10/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes.http.status_code_=_200.p90.json b/Benchmarks/Thresholds/5.10/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes.http.status_code_=_200.p90.json new file mode 100644 index 0000000..282dc64 --- /dev/null +++ b/Benchmarks/Thresholds/5.10/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes.http.status_code_=_200.p90.json @@ -0,0 +1,3 @@ +{ + "mallocCountTotal" : 2 +} \ No newline at end of file diff --git a/Benchmarks/Thresholds/5.10/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes['http.status_code']_=_200.p90.json b/Benchmarks/Thresholds/5.10/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes['http.status_code']_=_200.p90.json new file mode 100644 index 0000000..557fc88 --- /dev/null +++ b/Benchmarks/Thresholds/5.10/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes['http.status_code']_=_200.p90.json @@ -0,0 +1,3 @@ +{ + "mallocCountTotal" : 1 +} \ No newline at end of file diff --git a/Benchmarks/Thresholds/5.10/TracingBenchmarks.NoopTracing.startSpan_endSpan.p90.json b/Benchmarks/Thresholds/5.10/TracingBenchmarks.NoopTracing.startSpan_endSpan.p90.json new file mode 100644 index 0000000..9f9de44 --- /dev/null +++ b/Benchmarks/Thresholds/5.10/TracingBenchmarks.NoopTracing.startSpan_endSpan.p90.json @@ -0,0 +1,3 @@ +{ + "mallocCountTotal" : 0 +} \ No newline at end of file diff --git a/Benchmarks/Thresholds/5.9/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes.http.status_code_=_200.p90.json b/Benchmarks/Thresholds/5.9/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes.http.status_code_=_200.p90.json new file mode 100644 index 0000000..a072cdd --- /dev/null +++ b/Benchmarks/Thresholds/5.9/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes.http.status_code_=_200.p90.json @@ -0,0 +1,3 @@ +{ + "mallocCountTotal" : 3 +} \ No newline at end of file diff --git a/Benchmarks/Thresholds/5.9/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes['http.status_code']_=_200.p90.json b/Benchmarks/Thresholds/5.9/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes['http.status_code']_=_200.p90.json new file mode 100644 index 0000000..557fc88 --- /dev/null +++ b/Benchmarks/Thresholds/5.9/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes['http.status_code']_=_200.p90.json @@ -0,0 +1,3 @@ +{ + "mallocCountTotal" : 1 +} \ No newline at end of file diff --git a/Benchmarks/Thresholds/5.9/TracingBenchmarks.NoopTracing.startSpan_endSpan.p90.json b/Benchmarks/Thresholds/5.9/TracingBenchmarks.NoopTracing.startSpan_endSpan.p90.json new file mode 100644 index 0000000..9f9de44 --- /dev/null +++ b/Benchmarks/Thresholds/5.9/TracingBenchmarks.NoopTracing.startSpan_endSpan.p90.json @@ -0,0 +1,3 @@ +{ + "mallocCountTotal" : 0 +} \ No newline at end of file diff --git a/Benchmarks/Thresholds/6.0/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes.http.status_code_=_200.p90.json b/Benchmarks/Thresholds/6.0/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes.http.status_code_=_200.p90.json new file mode 100644 index 0000000..282dc64 --- /dev/null +++ b/Benchmarks/Thresholds/6.0/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes.http.status_code_=_200.p90.json @@ -0,0 +1,3 @@ +{ + "mallocCountTotal" : 2 +} \ No newline at end of file diff --git a/Benchmarks/Thresholds/6.0/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes['http.status_code']_=_200.p90.json b/Benchmarks/Thresholds/6.0/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes['http.status_code']_=_200.p90.json new file mode 100644 index 0000000..557fc88 --- /dev/null +++ b/Benchmarks/Thresholds/6.0/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes['http.status_code']_=_200.p90.json @@ -0,0 +1,3 @@ +{ + "mallocCountTotal" : 1 +} \ No newline at end of file diff --git a/Benchmarks/Thresholds/6.0/TracingBenchmarks.NoopTracing.startSpan_endSpan.p90.json b/Benchmarks/Thresholds/6.0/TracingBenchmarks.NoopTracing.startSpan_endSpan.p90.json new file mode 100644 index 0000000..9f9de44 --- /dev/null +++ b/Benchmarks/Thresholds/6.0/TracingBenchmarks.NoopTracing.startSpan_endSpan.p90.json @@ -0,0 +1,3 @@ +{ + "mallocCountTotal" : 0 +} \ No newline at end of file diff --git a/Benchmarks/Thresholds/nightly-6.0/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes.http.status_code_=_200.p90.json b/Benchmarks/Thresholds/nightly-6.0/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes.http.status_code_=_200.p90.json new file mode 100644 index 0000000..282dc64 --- /dev/null +++ b/Benchmarks/Thresholds/nightly-6.0/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes.http.status_code_=_200.p90.json @@ -0,0 +1,3 @@ +{ + "mallocCountTotal" : 2 +} \ No newline at end of file diff --git a/Benchmarks/Thresholds/nightly-6.0/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes['http.status_code']_=_200.p90.json b/Benchmarks/Thresholds/nightly-6.0/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes['http.status_code']_=_200.p90.json new file mode 100644 index 0000000..557fc88 --- /dev/null +++ b/Benchmarks/Thresholds/nightly-6.0/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes['http.status_code']_=_200.p90.json @@ -0,0 +1,3 @@ +{ + "mallocCountTotal" : 1 +} \ No newline at end of file diff --git a/Benchmarks/Thresholds/nightly-6.0/TracingBenchmarks.NoopTracing.startSpan_endSpan.p90.json b/Benchmarks/Thresholds/nightly-6.0/TracingBenchmarks.NoopTracing.startSpan_endSpan.p90.json new file mode 100644 index 0000000..9f9de44 --- /dev/null +++ b/Benchmarks/Thresholds/nightly-6.0/TracingBenchmarks.NoopTracing.startSpan_endSpan.p90.json @@ -0,0 +1,3 @@ +{ + "mallocCountTotal" : 0 +} \ No newline at end of file diff --git a/Benchmarks/Thresholds/nightly-main/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes.http.status_code_=_200.p90.json b/Benchmarks/Thresholds/nightly-main/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes.http.status_code_=_200.p90.json new file mode 100644 index 0000000..282dc64 --- /dev/null +++ b/Benchmarks/Thresholds/nightly-main/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes.http.status_code_=_200.p90.json @@ -0,0 +1,3 @@ +{ + "mallocCountTotal" : 2 +} \ No newline at end of file diff --git a/Benchmarks/Thresholds/nightly-main/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes['http.status_code']_=_200.p90.json b/Benchmarks/Thresholds/nightly-main/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes['http.status_code']_=_200.p90.json new file mode 100644 index 0000000..557fc88 --- /dev/null +++ b/Benchmarks/Thresholds/nightly-main/TracingBenchmarks.NoopTracing.attribute:_set,_span.attributes['http.status_code']_=_200.p90.json @@ -0,0 +1,3 @@ +{ + "mallocCountTotal" : 1 +} \ No newline at end of file diff --git a/Benchmarks/Thresholds/nightly-main/TracingBenchmarks.NoopTracing.startSpan_endSpan.p90.json b/Benchmarks/Thresholds/nightly-main/TracingBenchmarks.NoopTracing.startSpan_endSpan.p90.json new file mode 100644 index 0000000..9f9de44 --- /dev/null +++ b/Benchmarks/Thresholds/nightly-main/TracingBenchmarks.NoopTracing.startSpan_endSpan.p90.json @@ -0,0 +1,3 @@ +{ + "mallocCountTotal" : 0 +} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 76a7f7f..8a13769 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,30 +54,10 @@ We require that your commit messages match our template. The easiest way to do t git config commit.template dev/git.commit.template -### Run `./scripts/soundness.sh` +### Run CI checks locally -The scripts directory contains a [soundness.sh script](https://github.com/apple/swift-distributed-tracing/blob/main/scripts/soundness.sh) -that enforces additional checks, like license headers and formatting style. - -Please make sure to `./scripts/soundness.sh` before pushing a change upstream, otherwise it is likely the PR validation will fail -on minor changes such as a missing `self.` or similar formatting issues. - -> The script also executes the above mentioned `generate_linux_tests.rb`. -For frequent contributors, we recommend adding the script as a [git pre-push hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks), which you can do via executing the following command in the project root directory: - - ```bash - cat << EOF > .git/hooks/pre-push - #!/bin/bash - if [[ -f "scripts/soundness.sh" ]]; then - scripts/soundness.sh - fi - EOF - ``` - -Which makes the script execute, and only allow the `git push` to complete if the check has passed. - -In the case of formatting issues, you can then `git add` the formatting changes, and attempt the push again. +You can run the Github Actions workflows locally using [act](https://github.com/nektos/act). For detailed steps on how to do this please see [https://github.com/swiftlang/github-workflows?tab=readme-ov-file#running-workflows-locally](https://github.com/swiftlang/github-workflows?tab=readme-ov-file#running-workflows-locally). ## How to contribute your work -Please open a pull request at https://github.com/apple/swift-distributed-tracing. Make sure the CI passes, and then wait for code review. \ No newline at end of file +Please open a pull request at https://github.com/apple/swift-distributed-tracing. Make sure the CI passes, and then wait for code review. diff --git a/Docs/SwiftDistributedTracing/empty.swift b/Docs/SwiftDistributedTracing/empty.swift index 10626c5..55af18e 100644 --- a/Docs/SwiftDistributedTracing/empty.swift +++ b/Docs/SwiftDistributedTracing/empty.swift @@ -2,11 +2,11 @@ // // This source file is part of the Swift Distributed Tracing open source project // -// Copyright (c) 2020-2021 Apple Inc. and the Swift Distributed Tracing project -// authors +// Copyright (c) 2020-2021 Apple Inc. and the Swift Distributed Tracing project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information +// See CONTRIBUTORS.txt for the list of Swift Distributed Tracing project authors // // SPDX-License-Identifier: Apache-2.0 // diff --git a/IntegrationTests/allocation-counter-tests-framework/run-allocation-counter.sh b/IntegrationTests/allocation-counter-tests-framework/run-allocation-counter.sh deleted file mode 100755 index d8ceb74..0000000 --- a/IntegrationTests/allocation-counter-tests-framework/run-allocation-counter.sh +++ /dev/null @@ -1,305 +0,0 @@ -#!/bin/bash -##===----------------------------------------------------------------------===## -## -## This source file is part of the Swift Distributed Tracing open source project -## -## Copyright (c) 2020-2021 Apple Inc. and the Swift Distributed Tracing project -## authors -## Licensed under Apache License v2.0 -## -## See LICENSE.txt for license information -## -## SPDX-License-Identifier: Apache-2.0 -## -##===----------------------------------------------------------------------===## - -##===----------------------------------------------------------------------===## -## -## This source file is part of the SwiftNIO open source project -## -## Copyright (c) 2019 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 -## -##===----------------------------------------------------------------------===## - -set -eu -here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -build_opts=( -c release ) - -function die() { - echo >&2 "ERROR: $*" - exit 1 -} - -function make_git_commit_all() { - git init > /dev/null - if [[ "$(git config user.email)" == "" ]]; then - git config --local user.email does@really-not.matter - git config --local user.name 'Does Not Matter' - fi - git add . > /dev/null - git commit -m 'everything' > /dev/null -} - -# -function hooked_package_swift_start() { - local extra_dependencies_file=$1 - local swiftpm_pkg_name=$2 - shift 2 - - cat <<"EOF" -// swift-tools-version:5.0 -import PackageDescription - -let package = Package( - name: "allocation-counter-tests", - products: [ -EOF - for f in "$@"; do - local module - module=$(module_name_from_path "$f") - echo ".executable(name: \"$module\", targets: [\"bootstrap_$module\"])," - done - cat < -function hooked_package_swift_target() { - local target_name="$1" - shift - local deps="" - for dep in "$@"; do - deps="$deps \"$dep\"," - done - cat < Package.swift <