diff --git a/.gitignore b/.gitignore index 6b77e62bab..15b8c8b6dd 100644 --- a/.gitignore +++ b/.gitignore @@ -11,8 +11,6 @@ *.userosscache *.sln.docstates -toolsrc/out* -toolsrc/CMakeSettings.json # fuzzing sync_dir* @@ -30,8 +28,6 @@ bld/ [Bb]in/ [Oo]bj/ [Ll]og/ -# VS Code build -toolsrc/build # Ignore the executable /vcpkg /vcpkg.exe @@ -290,11 +286,6 @@ __pycache__/ /installed*/ /packages/ /scripts/buildsystems/tmp/ -/toolsrc/build.rel/ -/toolsrc/windows-bootstrap/msbuild.x86.debug/ -/toolsrc/windows-bootstrap/msbuild.x86.release/ -/toolsrc/windows-bootstrap/msbuild.x64.debug/ -/toolsrc/windows-bootstrap/msbuild.x64.release/ #ignore custom triplets /triplets/* #add vcpkg-designed triplets back in diff --git a/docs/about/privacy.md b/docs/about/privacy.md index 15ef69d763..5efecb6790 100644 --- a/docs/about/privacy.md +++ b/docs/about/privacy.md @@ -41,7 +41,7 @@ We collect various telemetry events such as the command line used, the time of i You can see the telemetry events any command by appending `--printmetrics` after the vcpkg command line. -In the source code (included in `toolsrc\`), you can search for calls to the functions `track_property()`, `track_feature()`, `track_metric()`, and `track_buildtime()` +In the source code (included at https://github.com/microsoft/vcpkg-tool/ ), you can search for calls to the functions `track_property()`, `track_feature()`, `track_metric()`, and `track_buildtime()` to see every specific data point we collect. ## Avoid inadvertent disclosure information diff --git a/docs/tool-maintainers/benchmarking.md b/docs/tool-maintainers/benchmarking.md deleted file mode 100644 index e0295be50b..0000000000 --- a/docs/tool-maintainers/benchmarking.md +++ /dev/null @@ -1,195 +0,0 @@ -# Benchmarking - -Benchmarking new code against old code is extremely important whenever making -large changes to how something works. If you are attempting to make something -faster, and you end up slowing it down, you'll never know if you don't -benchmark! We have benchmarks in the `toolsrc/src/vcpkg-test` directory, just -like the tests -- they're treated as a special kind of test. - -## Running Benchmarks - -Unlike normal tests, benchmarks are hidden behind a special define -- `CATCH_CONFIG_ENABLE_BENCHMARKING` -- so that you never try to run benchmarks -unless you specifically want to. This is because benchmarks actually take quite -a long time! However, if you want to run benchmarks (and I recommend running -only specific benchmarks at a time), you can do so by passing the -`VCPKG_ENABLE_BENCHMARKING` option at cmake configure time. - -```sh -$ cmake -B toolsrc/out -S toolsrc -G Ninja \ - -DCMAKE_BUILD_TYPE=Release \ - -DVCPKG_BUILD_BENCHMARKING=On - --- The C compiler identification is MSVC 19.22.27905.0 --- The CXX compiler identification is MSVC 19.22.27905.0 --- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.22.27905/bin/Hostx64/x64/cl.exe --- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.22.27905/bin/Hostx64/x64/cl.exe -- works --- Detecting C compiler ABI info --- Detecting C compiler ABI info - done --- Detecting C compile features --- Detecting C compile features - done --- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.22.27905/bin/Hostx64/x64/cl.exe --- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.22.27905/bin/Hostx64/x64/cl.exe -- works --- Detecting CXX compiler ABI info --- Detecting CXX compiler ABI info - done --- Detecting CXX compile features --- Detecting CXX compile features - done --- Looking for pthread.h --- Looking for pthread.h - not found --- Found Threads: TRUE --- Configuring done --- Generating done --- Build files have been written to: C:/Users/t-nimaz/src/vcpkg/toolsrc/out - -$ cmake --build toolsrc/out - -[0/2] Re-checking globbed directories... -[80/80] Linking CXX executable vcpkg-test.exe -``` - -You can then run benchmarks easily with the following command (which run the -files benchmarks): - -```sh -$ ./toolsrc/out/vcpkg-test [!benchmark][file] -``` - -You can switch out `[file]` for a different set -- `[hash]`, for example. - -## Writing Benchmarks - -First, before anything else, I recommend reading the -[benchmarking documentation] at Catch2's repository. - -Now, after that, let's say that you wanted to benchmark, say, our ASCII -case-insensitive string compare against your new implementation. We place -benchmarks for code in the same file as their tests, so open -`vcpkg-test/strings.cpp`, and add the following at the bottom: - -```cpp -#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING) -TEST_CASE ("case insensitive ascii equals: benchmark", "[strings][!benchmark]") -{ - BENCHMARK("qwertyuiop") { - return vcpkg::Strings::case_insensitive_ascii_equals("qwertyuiop", "QWERTYUIOP"); - }; -} -#endif -``` - -Remember the `;` at the end of the benchmark -- it's not required for -`TEST_CASE`s, but is for `BENCHMARK`s. - -Now, let's rebuild and run: - -```sh -$ cmake --build toolsrc/out -[0/2] Re-checking globbed directories... -[2/2] Linking CXX executable vcpkg-test.exe -$ ./toolsrc/out/vcpkg-test [strings][!benchmark] -Filters: [strings][!benchmark] - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -vcpkg-test.exe is a Catch v2.9.1 host application. -Run with -? for options - -------------------------------------------------------------------------------- -case insensitive ascii equals: benchmark -------------------------------------------------------------------------------- -C:\Users\t-nimaz\src\vcpkg\toolsrc\src\vcpkg-test\strings.cpp(36) -............................................................................... - -benchmark name samples iterations estimated - mean low mean high mean - std dev low std dev high std dev -------------------------------------------------------------------------------- -qwertyuiop 100 2088 3.9672 ms - 25 ns 24 ns 26 ns - 6 ns 5 ns 8 ns - - -=============================================================================== -test cases: 1 | 1 passed -assertions: - none - -``` - -You've now written your first benchmark! - -But wait. This seems kind of silly. Benchmarking the comparison of literal -strings is great and all, but could we make it a little more realistic? - -This is where `BENCHMARK_ADVANCED` comes in. `BENCHMARK_ADVANCED` allows one to -write a benchmark that has a little setup to it without screwing up the numbers. -Let's try it now: - -```cpp -TEST_CASE ("case insensitive ascii equals: benchmark", "[strings][!benchmark]") -{ - BENCHMARK_ADVANCED("equal strings")(Catch::Benchmark::Chronometer meter) - { - std::vector strings; - strings.resize(meter.runs()); - std::mt19937_64 urbg; - std::uniform_int_distribution data_generator; - - std::generate(strings.begin(), strings.end(), [&] { - std::string result; - for (std::size_t i = 0; i < 1000; ++i) - { - result += vcpkg::Strings::b32_encode(data_generator(urbg)); - } - - return result; - }); - - meter.measure( - [&](int run) { return vcpkg::Strings::case_insensitive_ascii_equals(strings[run], strings[run]); }); - }; -} -``` - -Then, run it again! - -```sh -$ cmake --build toolsrc/out -[0/2] Re-checking globbed directories... -[2/2] Linking CXX executable vcpkg-test.exe -$ toolsrc/out/vcpkg-test [strings][!benchmark] -Filters: [strings][!benchmark] - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -vcpkg-test.exe is a Catch v2.9.1 host application. -Run with -? for options - -------------------------------------------------------------------------------- -case insensitive ascii equals: benchmark -------------------------------------------------------------------------------- -C:\Users\t-nimaz\src\vcpkg\toolsrc\src\vcpkg-test\strings.cpp(36) -............................................................................... - -benchmark name samples iterations estimated - mean low mean high mean - std dev low std dev high std dev -------------------------------------------------------------------------------- -equal strings 100 2 5.4806 ms - 22.098 us 21.569 us 23.295 us - 3.842 us 2.115 us 7.41 us - - -=============================================================================== -test cases: 1 | 1 passed -assertions: - none - -``` - -And now you have a working benchmark to test the speed of the existing code, and -of new code! - -If you're writing a lot of benchmarks that follow the same sort of pattern, with -some differences in constants, look into `vcpkg-test/files.cpp`'s benchmarks -- -there are a lot of things one can do to make writing new benchmarks really easy. - -If you wish to add a benchmark for a piece of code that has not yet been tested, -please read the [testing documentation], and please write some unit tests. -The speed of your code isn't very important if it doesn't work at all! - -[benchmarking documentation]: https://github.com/catchorg/Catch2/blob/master/docs/benchmarks.md#top -[testing documentation]: ./testing.md#adding-new-test-files diff --git a/docs/tool-maintainers/layout.md b/docs/tool-maintainers/layout.md deleted file mode 100644 index ca9fa5c6ae..0000000000 --- a/docs/tool-maintainers/layout.md +++ /dev/null @@ -1,74 +0,0 @@ -# Layout of the vcpkg source tree - -All vcpkg sources and build systems are in `toolsrc`. If you'd like to -contribute to the vcpkg tool itself, most of your time will be spent in here. - -## Build Files - -These are the files used to build and configure the project. In order to build -with CMake, the only files you should be interested in are `CMakeLists.txt`, and -`.clang-format`; in order to build with msbuild or the Visual Studio IDE, you -will be interested in `dirs.proj` or `vcpkg.sln`. However, if you add or remove -files, you will need to edit the MSBuild project files in the `vcpkg*` -directories no matter what system you use. - -### Top Level - -We have six files in this directory -- one `.clang-format` file, one -`CMakeLists.txt` file, three Visual Studio files, and `VERSION.txt`. - - - `.clang-format`: This is where we store the formatting settings of the - project. If you want to format the project, you can use the `format` target - with the CMake build system. - - `CMakeLists.txt`: This is where the CMake build system definition lives. If - you want to modify how one builds the project, or add a target, you can do - it here. - - `VERSION.txt`: This is a file which tells `vcpkg` to tell the user to - rebuild. If this version is different from the version when the user built - the binary (for example, after a `git pull` or a `vcpkg update`), then - `vcpkg` will print a message to re-bootstrap. This is updated whenever major - changes are made to the `vcpkg` tool. - - The Visual Studio files: - - `vcpkg.natvis`: NATVIS files allow one to visualize objects of user - defined type in the debugger -- this one contains the definitions for - `vcpkg`'s types. - - `dirs.proj`: This is how one builds with `msbuild` without calling into - the IDE. - - `vcpkg.sln`: The solution file is how one opens the project in the VS IDE. - -## Source Files - -If you're modifying the project, it's likely that these are the directories that -you're going to deal with. - -### `include` - -There's one file in here -- `pch.h`. This contains most of the C++ standard -library, and acts as a [precompiled header]. You can read more at the link. - -There are three directories: - - - `catch2` -- This contains the single-header library [catch2]. We use this - library for both [testing] and [benchmarking]. - - `vcpkg` -- This contains the header files for the `vcpkg` project. All of - the interfaces for building, installing, and generally "port stuff" live - here. - - `vcpkg/base` -- This contains the interfaces for the - "vcpkg standard library" -- file handling, hashing, strings, - `Span`, printing, etc. - - `vcpkg-test` -- This contains the interfaces for any common utilities - required by the tests. - -### `src` - -The source files live here. `pch.cpp` is the source file for the -[precompiled header]; `vcpkg.cpp` is where the `vcpkg` binary lives. - -The interesting files live in the `vcpkg` and `vcpkg-test` directories. In -`vcpkg`, you have the implementation for the interfaces that live in -`include/vcpkg`; and in `vcpkg-test`, you have the tests and benchmarks. - -[precompiled header]: https://en.wikipedia.org/wiki/Precompiled_header -[catch2]: https://github.com/catchorg/Catch2 -[testing]: ./testing.md -[benchmarking]: ./benchmarking.md diff --git a/docs/tool-maintainers/testing.md b/docs/tool-maintainers/testing.md deleted file mode 100644 index a9e866d9e8..0000000000 --- a/docs/tool-maintainers/testing.md +++ /dev/null @@ -1,152 +0,0 @@ -# Testing - -Testing vcpkg is important whenever one makes changes to the tool itself, and -writing new tests and keeping them up to date is also very important. If one's -code is subtly broken, we'd rather find it out right away than a few weeks down -the line when someone complains! - -## Running Tests - -Before anything else, we should know whether you can actually run the tests! -All you should need is a way to build vcpkg -- anything will do! All you have to -do is follow the guide 😄 - -With `$VCPKG_DIRECTORY` being the directory where you have cloned vcpkg, create -a build directory in `$VCPKG_DIRECTORY/toolsrc` (commonly named `out`), and -`cd` into it. Make sure to clean it out if it already exists! - -```sh -$ cmake .. -DCMAKE_BUILD_TYPE=Debug -G Ninja -$ cmake --build . -$ ./vcpkg-test # ./vcpkg-test [$SPECIFIC_TEST] for a specific set of tests -$ # i.e., ./vcpkg-test [arguments] -``` - -If you make any modifications to `vcpkg`, you'll have to do the -`cmake --build .` step again. - -## Writing Tests - -In your journey to write new tests, and to modify existing tests, reading the -[Catch2 documentation] will be very helpful! Come back after reading those 😀 - -You'll want to place your tests in one of the existing files, or, if it doesn't -belong in any of those, in a [new file](#adding-new-test-files). - -The layout of these tests is as follows: - -```cpp -// ... includes - -TEST_CASE("Name of test", "[filename without the .cpp]") { - // setup and the like - REQUIRE(some boolean expression); -} - -// etc. -``` - -You want to give these test cases good, descriptive, unique names, like -`SourceParagraph construct minimum` -- it doesn't need to be extremely clear -english, and shorthand is good, but make sure it's clear what the test is from -the name. For the latter parameter, known as "tags", you should at least put the -name of the file which the test case is in -- e.g., in `arguments.cpp`, you'd -tag all of the test cases with `[arguments]`. - -If you wish to add helper functions, make sure to place them in an anonymous -namespace -- this will ensure that they don't trample over anybody else's -space. Additionally, there are a few helper functions that live in -`` and `src/vcpkg-test/util.cpp` -- make sure to look into -them so that you're not rewriting functionality. - -That should be all you need to know to start writing your own tests! -Remember to check out the [Catch2 documentation] -if you'd like to get more advanced with your tests, -and good luck on your testing journey! - -## Adding New Test Files - -Adding new test files should be easy and straightforward. All it requires is -creating a new source file in `toolsrc/src/vcpkg-test`. - -### Example - -Let's try writing a new test file called `example` (very creative, I know). - -First, we should create a file, `example.cpp`, in `toolsrc/src/vcpkg-test`: - -```cpp -// vcpkg-test/example.cpp -#include -``` - -This is the minimum file needed for tests; let's rebuild! - -```sh -$ cmake --build . -[80/80] Linking CXX executable vcpkg.exe -``` - -Okay, now let's make sure this worked; add a test case to `example.cpp`: - -```cpp -TEST_CASE("Example 1 - fail", "[example]") { - REQUIRE(false); -} -``` - -Now build the tests again, and run them: - -```sh -$ cmake --build . -[2/2] Linking CXX executable vcpkg-test.exe -$ ./vcpkg-test - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -vcpkg-test.exe is a Catch v2.9.1 host application. -Run with -? for options - -------------------------------------------------------------------------------- -Example 1 - fail -------------------------------------------------------------------------------- -$VCPKG_DIRECTORY/toolsrc/src/vcpkg-test/example.cpp(3) -............................................................................... - -$VCPKG_DIRECTORY/toolsrc/src/vcpkg-test/example.cpp(14): FAILED: - REQUIRE( false ) - -=============================================================================== -test cases: 102 | 101 passed | 1 failed -assertions: 3611 | 3610 passed | 1 failed -``` - -Hopefully, that worked! It should compile correctly, and have one failing test. -Now let's try a more complex test, after deleting the old one; - -```cpp -// add #include to the top of the file -namespace Strings = vcpkg::Strings; - -TEST_CASE("Example 2 - success", "[example]") { - std::string hello = "Hello"; - REQUIRE(Strings::case_insensitive_ascii_equals(hello, "hELLo")); - REQUIRE_FALSE(Strings::case_insensitive_ascii_starts_with(hello, "E")); -} -``` - -Now compile and build the tests, and this time let's only run our example tests: - -```sh -$ cmake --build . -[2/2] Linking CXX executable vcpkg-test.exe -$ ./vcpkg-test [example] -Filters: [example] -=============================================================================== -All tests passed (2 assertions in 1 test case) -``` - -Hopefully you have one test running and succeeding! If you have that, you have -succeeded at adding a new file to vcpkg's tests. Congratulations! Have fun on -the rest of your journey 🐱‍👤😁 - -[Catch2 documentation]: https://github.com/catchorg/Catch2/blob/master/docs/tutorial.md#top diff --git a/scripts/Generate-SpdxLicenseList.ps1 b/scripts/Generate-SpdxLicenseList.ps1 deleted file mode 100644 index 8af5fd4de0..0000000000 --- a/scripts/Generate-SpdxLicenseList.ps1 +++ /dev/null @@ -1,63 +0,0 @@ -<# -#> -[CmdletBinding(PositionalBinding=$False)] -Param( - [Parameter(Mandatory=$True)] - [string]$Commit, - - [Parameter()] - [string]$GithubRepository = "spdx/license-list-data", - - [Parameter()] - [string]$LicensesOutFile = "$PSScriptRoot/../toolsrc/src/vcpkg/spdx-licenses.inc", - - [Parameter()] - [string]$ExceptionsOutFile = "$PSScriptRoot/../toolsrc/src/vcpkg/spdx-exceptions.inc" -) - -function Transform-JsonFile { - [CmdletBinding()] - Param( - [string]$Uri, - [string]$OutFile, - [string]$OuterName, - [string]$Id - ) - - $req = Invoke-WebRequest -Uri $Uri - - if ($req.StatusCode -ne 200) - { - Write-Error "Failed to GET $Uri" - throw - } - - $json = $req.Content | ConvertFrom-Json -Depth 10 - Write-Verbose "Writing output to $OutFile" - - $fileContent = @( - "// Data downloaded from $Uri", - "// Generated by scripts/Generate-SpdxLicenseList.ps1", - "{") - $json.$OuterName | ForEach-Object { - $fileContent += " `"$($_.$Id)`"," - } - $fileContent += "}" - - $fileContent -join "`n" | Out-File -FilePath $OutFile -Encoding 'utf8' -} - -$baseUrl = "https://raw.githubusercontent.com/$GithubRepository/$Commit/json" -Write-Verbose "Getting json files from $baseUrl" - -Transform-JsonFile ` - -Uri "$baseUrl/licenses.json" ` - -OutFile $LicensesOutFile ` - -OuterName 'licenses' ` - -Id 'licenseId' - -Transform-JsonFile ` - -Uri "$baseUrl/exceptions.json" ` - -OutFile $ExceptionsOutFile ` - -OuterName 'exceptions' ` - -Id 'licenseExceptionId' diff --git a/scripts/azure-pipelines/Create-FormatDiff.ps1 b/scripts/azure-pipelines/Create-PRDiff.ps1 similarity index 100% rename from scripts/azure-pipelines/Create-FormatDiff.ps1 rename to scripts/azure-pipelines/Create-PRDiff.ps1 diff --git a/scripts/azure-pipelines/Format-CxxCode.ps1 b/scripts/azure-pipelines/Format-CxxCode.ps1 deleted file mode 100644 index 2653562a7e..0000000000 --- a/scripts/azure-pipelines/Format-CxxCode.ps1 +++ /dev/null @@ -1,50 +0,0 @@ -[CmdletBinding()] -Param( - [Parameter(Mandatory=$True)] - [string]$Root -) - -$Root = Resolve-Path -LiteralPath $Root - -$clangFormat = Get-Command 'clang-format' -ErrorAction 'SilentlyContinue' -if ($null -ne $clangFormat) -{ - $clangFormat = $clangFormat.Source -} - -if ($IsWindows) -{ - if ([String]::IsNullOrEmpty($clangFormat) -or -not (Test-Path $clangFormat)) - { - $clangFormat = 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\Llvm\x64\bin\clang-format.exe' - } - if (-not (Test-Path $clangFormat)) - { - $clangFormat = 'C:\Program Files\LLVM\bin\clang-format.exe' - } -} - -if ([String]::IsNullOrEmpty($clangFormat) -or -not (Test-Path $clangFormat)) -{ - Write-Error 'clang-format not found; is it installed?' - throw -} - -$toolsrc = Get-Item "$Root/toolsrc" -Push-Location $toolsrc - -try -{ - $files = Get-ChildItem -Recurse -LiteralPath "$toolsrc/src" -Filter '*.cpp' - $files += Get-ChildItem -Recurse -LiteralPath "$toolsrc/src" -Filter '*.c' - $files += Get-ChildItem -Recurse -LiteralPath "$toolsrc/include/vcpkg" -Filter '*.h' - $files += Get-ChildItem -Recurse -LiteralPath "$toolsrc/include/vcpkg-test" -Filter '*.h' - $files += Get-Item "$toolsrc/include/pch.h" - $fileNames = $files.FullName - - & $clangFormat -style=file -i @fileNames -} -finally -{ - Pop-Location -} diff --git a/scripts/azure-pipelines/azure-pipelines.yml b/scripts/azure-pipelines/azure-pipelines.yml index 7fce6a5c19..27db6a93d9 100644 --- a/scripts/azure-pipelines/azure-pipelines.yml +++ b/scripts/azure-pipelines/azure-pipelines.yml @@ -20,12 +20,6 @@ stages: - name: DiffFile value: $(Build.ArtifactStagingDirectory)\format.diff steps: - - task: Powershell@2 - displayName: 'Format C++' - inputs: - filePath: 'scripts/azure-pipelines/Format-CxxCode.ps1' - arguments: '-Root .' - pwsh: true - task: Powershell@2 displayName: 'Generate Documentation' inputs: @@ -33,18 +27,18 @@ stages: arguments: '-VcpkgRoot . -WarningAction Stop' pwsh: true - script: .\bootstrap-vcpkg.bat - displayName: 'Build vcpkg' - - script: '.\vcpkg format-manifest --all' + displayName: 'Bootstrap vcpkg' + - script: '.\vcpkg.exe format-manifest --all' displayName: 'Format Manifests' - task: Powershell@2 displayName: 'Create Diff' inputs: - filePath: scripts/azure-pipelines/Create-FormatDiff.ps1 + filePath: scripts/azure-pipelines/Create-PRDiff.ps1 arguments: '-DiffFile $(DiffFile)' pwsh: true - task: PublishBuildArtifacts@1 condition: failed() - displayName: 'Publish C++ Diff' + displayName: 'Publish Format and Documentation Diff' inputs: PathtoPublish: '$(DiffFile)' ArtifactName: 'format.diff' diff --git a/scripts/azure-pipelines/end-to-end-tests-dir/backcompat-helpers.ps1 b/scripts/azure-pipelines/end-to-end-tests-dir/backcompat-helpers.ps1 deleted file mode 100644 index 704b527523..0000000000 --- a/scripts/azure-pipelines/end-to-end-tests-dir/backcompat-helpers.ps1 +++ /dev/null @@ -1,24 +0,0 @@ -. $PSScriptRoot/../end-to-end-tests-prelude.ps1 - -# Test that prohibiting backcompat features actually prohibits -$backcompatFeaturePorts = @('vcpkg-uses-test-cmake', 'vcpkg-uses-vcpkg-common-functions') -foreach ($backcompatFeaturePort in $backcompatFeaturePorts) { - $succeedArgs = $commonArgs + @('install',$backcompatFeaturePort,'--no-binarycaching') - $failArgs = $succeedArgs + @('--x-prohibit-backcompat-features') - $CurrentTest = "Should fail: ./vcpkg $($failArgs -join ' ')" - Run-Vcpkg @failArgs - if ($LastExitCode -ne 0) { - Write-Host "... failed (this is good!)." - } else { - throw $CurrentTest - } - - # Install failed when prohibiting backcompat features, so it should succeed if we allow them - $CurrentTest = "Should succeeed: ./vcpkg $($succeedArgs -join ' ')" - Run-Vcpkg @succeedArgs - if ($LastExitCode -ne 0) { - throw $CurrentTest - } else { - Write-Host "... succeeded." - } -} diff --git a/scripts/azure-pipelines/end-to-end-tests-dir/binarycaching.ps1 b/scripts/azure-pipelines/end-to-end-tests-dir/binarycaching.ps1 deleted file mode 100644 index e4ee6e6984..0000000000 --- a/scripts/azure-pipelines/end-to-end-tests-dir/binarycaching.ps1 +++ /dev/null @@ -1,86 +0,0 @@ -if ($IsLinux) { - # The tests below need a mono installation not currently available on the Linux agents. - return -} - -. $PSScriptRoot/../end-to-end-tests-prelude.ps1 - -# Test simple installation -Run-Vcpkg -TestArgs ($commonArgs + @("install", "rapidjson", "--binarycaching", "--x-binarysource=clear;files,$ArchiveRoot,write;nuget,$NuGetRoot,readwrite")) -Throw-IfFailed -Require-FileExists "$installRoot/$Triplet/include/rapidjson/rapidjson.h" - -# Test simple removal -Run-Vcpkg -TestArgs ($commonArgs + @("remove", "rapidjson")) -Throw-IfFailed -Require-FileNotExists "$installRoot/$Triplet/include/rapidjson/rapidjson.h" - -# Test restoring from files archive -Remove-Item -Recurse -Force $installRoot -Remove-Item -Recurse -Force $buildtreesRoot -Run-Vcpkg -TestArgs ($commonArgs + @("install","rapidjson","--binarycaching","--x-binarysource=clear;files,$ArchiveRoot,read")) -Throw-IfFailed -Require-FileExists "$installRoot/$Triplet/include/rapidjson/rapidjson.h" -Require-FileNotExists "$buildtreesRoot/rapidjson/src" -Require-FileExists "$buildtreesRoot/detect_compiler" - -# Test --no-binarycaching -Remove-Item -Recurse -Force $installRoot -Remove-Item -Recurse -Force $buildtreesRoot -Run-Vcpkg -TestArgs ($commonArgs + @("install","rapidjson","--no-binarycaching","--x-binarysource=clear;files,$ArchiveRoot,read")) -Throw-IfFailed -Require-FileExists "$installRoot/$Triplet/include/rapidjson/rapidjson.h" -Require-FileExists "$buildtreesRoot/rapidjson/src" -Require-FileExists "$buildtreesRoot/detect_compiler" - -# Test --editable -Remove-Item -Recurse -Force $installRoot -Remove-Item -Recurse -Force $buildtreesRoot -Run-Vcpkg -TestArgs ($commonArgs + @("install","rapidjson","--editable","--x-binarysource=clear;files,$ArchiveRoot,read")) -Throw-IfFailed -Require-FileExists "$installRoot/$Triplet/include/rapidjson/rapidjson.h" -Require-FileExists "$buildtreesRoot/rapidjson/src" -Require-FileNotExists "$buildtreesRoot/detect_compiler" - -# Test restoring from nuget -Remove-Item -Recurse -Force $installRoot -Remove-Item -Recurse -Force $buildtreesRoot -Run-Vcpkg -TestArgs ($commonArgs + @("install", "rapidjson", "--binarycaching", "--x-binarysource=clear;nuget,$NuGetRoot")) -Throw-IfFailed -Require-FileExists "$installRoot/$Triplet/include/rapidjson/rapidjson.h" -Require-FileNotExists "$buildtreesRoot/rapidjson/src" - -# Test four-phase flow -Remove-Item -Recurse -Force $installRoot -ErrorAction SilentlyContinue -Run-Vcpkg -TestArgs ($commonArgs + @("install", "rapidjson", "--dry-run", "--x-write-nuget-packages-config=$TestingRoot/packages.config")) -Throw-IfFailed -Require-FileNotExists "$installRoot/$Triplet/include/rapidjson/rapidjson.h" -Require-FileNotExists "$buildtreesRoot/rapidjson/src" -Require-FileExists "$TestingRoot/packages.config" -if ($IsLinux -or $IsMacOS) { - mono $(./vcpkg fetch nuget) restore $TestingRoot/packages.config -OutputDirectory "$NuGetRoot2" -Source "$NuGetRoot" -} else { - & $(./vcpkg fetch nuget) restore $TestingRoot/packages.config -OutputDirectory "$NuGetRoot2" -Source "$NuGetRoot" -} -Throw-IfFailed -Remove-Item -Recurse -Force $NuGetRoot -ErrorAction SilentlyContinue -mkdir $NuGetRoot -Run-Vcpkg -TestArgs ($commonArgs + @("install", "rapidjson", "tinyxml", "--binarycaching", "--x-binarysource=clear;nuget,$NuGetRoot2;nuget,$NuGetRoot,write")) -Throw-IfFailed -Require-FileExists "$installRoot/$Triplet/include/rapidjson/rapidjson.h" -Require-FileExists "$installRoot/$Triplet/include/tinyxml.h" -Require-FileNotExists "$buildtreesRoot/rapidjson/src" -Require-FileExists "$buildtreesRoot/tinyxml/src" -if ((Get-ChildItem $NuGetRoot -Filter '*.nupkg' | Measure-Object).Count -ne 1) { - throw "In '$CurrentTest': did not create exactly 1 NuGet package" -} - -# Test export -$CurrentTest = 'Exporting' -Require-FileNotExists "$TestingRoot/vcpkg-export-output" -Require-FileNotExists "$TestingRoot/vcpkg-export.1.0.0.nupkg" -Require-FileNotExists "$TestingRoot/vcpkg-export-output.zip" -Run-Vcpkg -TestArgs ($commonArgs + @("export", "rapidjson", "tinyxml", "--nuget", "--nuget-id=vcpkg-export", "--nuget-version=1.0.0", "--output=vcpkg-export-output", "--raw", "--zip", "--output-dir=$TestingRoot")) -Require-FileExists "$TestingRoot/vcpkg-export-output" -Require-FileExists "$TestingRoot/vcpkg-export.1.0.0.nupkg" -Require-FileExists "$TestingRoot/vcpkg-export-output.zip" diff --git a/scripts/azure-pipelines/end-to-end-tests-dir/build-missing.ps1 b/scripts/azure-pipelines/end-to-end-tests-dir/build-missing.ps1 deleted file mode 100644 index 5f318e6af9..0000000000 --- a/scripts/azure-pipelines/end-to-end-tests-dir/build-missing.ps1 +++ /dev/null @@ -1,18 +0,0 @@ -. $PSScriptRoot/../end-to-end-tests-prelude.ps1 - -$CurrentTest = "Build Missing tests" - -Run-Vcpkg -TestArgs ($commonArgs + @("install", "rapidjson", "--only-binarycaching","--x-binarysource=clear;files,$ArchiveRoot,read")) -Throw-IfNotFailed -Require-FileNotExists "$installRoot/$Triplet/include/rapidjson/rapidjson.h" - -# Create the rapidjson archive -Remove-Item -Recurse -Force $installRoot -Run-Vcpkg -TestArgs ($commonArgs + @("install", "rapidjson","--x-binarysource=clear;files,$ArchiveRoot,write")) -Throw-IfFailed -Require-FileExists "$installRoot/$Triplet/include/rapidjson/rapidjson.h" - -Remove-Item -Recurse -Force $installRoot -Run-Vcpkg -TestArgs ($commonArgs + @("install", "rapidjson", "--only-binarycaching","--x-binarysource=clear;files,$ArchiveRoot,read")) -Throw-IfFailed -Require-FileExists "$installRoot/$Triplet/include/rapidjson/rapidjson.h" diff --git a/scripts/azure-pipelines/end-to-end-tests-dir/cli.ps1 b/scripts/azure-pipelines/end-to-end-tests-dir/cli.ps1 deleted file mode 100644 index 47f624fa8f..0000000000 --- a/scripts/azure-pipelines/end-to-end-tests-dir/cli.ps1 +++ /dev/null @@ -1,11 +0,0 @@ -. $PSScriptRoot/../end-to-end-tests-prelude.ps1 - -# Test bad command lines -Run-Vcpkg -TestArgs ($commonArgs + @("install", "zlib", "--vcpkg-rootttttt", "C:\")) -Throw-IfNotFailed - -Run-Vcpkg -TestArgs ($commonArgs + @("install", "zlib", "--vcpkg-rootttttt=C:\")) -Throw-IfNotFailed - -Run-Vcpkg -TestArgs ($commonArgs + @("install", "zlib", "--fast")) # NB: --fast is not a switch -Throw-IfNotFailed diff --git a/scripts/azure-pipelines/end-to-end-tests-dir/create.ps1 b/scripts/azure-pipelines/end-to-end-tests-dir/create.ps1 deleted file mode 100644 index 9d59da5396..0000000000 --- a/scripts/azure-pipelines/end-to-end-tests-dir/create.ps1 +++ /dev/null @@ -1,10 +0,0 @@ -. $PSScriptRoot/../end-to-end-tests-prelude.ps1 - -# Test vcpkg create -$Script:CurrentTest = "create zlib" -Write-Host $Script:CurrentTest -./vcpkg --x-builtin-ports-root=$TestingRoot/ports create zlib https://github.com/madler/zlib/archive/v1.2.11.tar.gz zlib-1.2.11.tar.gz -Throw-IfFailed - -Require-FileExists "$TestingRoot/ports/zlib/portfile.cmake" -Require-FileExists "$TestingRoot/ports/zlib/vcpkg.json" diff --git a/scripts/azure-pipelines/end-to-end-tests-dir/disable-metrics.ps1 b/scripts/azure-pipelines/end-to-end-tests-dir/disable-metrics.ps1 deleted file mode 100644 index 5ad7616b48..0000000000 --- a/scripts/azure-pipelines/end-to-end-tests-dir/disable-metrics.ps1 +++ /dev/null @@ -1,67 +0,0 @@ -. $PSScriptRoot/../end-to-end-tests-prelude.ps1 - -# Test that metrics are on by default -$metricsTagName = 'vcpkg.disable-metrics' -$metricsAreDisabledMessage = 'Warning: passed --sendmetrics, but metrics are disabled.' - -function Test-Metrics-Enabled() { - Param( - [Parameter(ValueFromRemainingArguments)] - [string[]]$TestArgs - ) - - $actualArgs = @('version', '--sendmetrics') - if ($TestArgs.Length -ne 0) { - $actualArgs += $TestArgs - } - - $vcpkgOutput = Run-Vcpkg $actualArgs - if ($vcpkgOutput -contains $metricsAreDisabledMessage) { - Write-Host 'Metrics are disabled' - return $false - } - - Write-Host 'Metrics are enabled' - return $true -} - -# By default, metrics are enabled. -Require-FileNotExists $metricsTagName -if (-Not (Test-Metrics-Enabled)) { - throw "Metrics were not on by default." -} - -if (Test-Metrics-Enabled '--disable-metrics') { - throw "Metrics were not disabled by switch." -} - -$env:VCPKG_DISABLE_METRICS = 'ON' -try { - if (Test-Metrics-Enabled) { - throw "Environment variable did not disable metrics." - } - - # Also test that you get no message without --sendmetrics - $vcpkgOutput = Run-Vcpkg list - if ($vcpkgOutput -contains $metricsAreDisabledMessage) { - throw "Disabled metrics emit message even without --sendmetrics" - } - - if (-Not (Test-Metrics-Enabled '--no-disable-metrics')) { - throw "Environment variable to disable metrics could not be overridden by switch." - } -} finally { - Remove-Item env:VCPKG_DISABLE_METRICS -} - -# If the disable-metrics tag file exists, metrics are disabled even if attempted to be enabled on -# the command line. -Set-Content -Path $metricsTagName -Value "" -try { - if (Test-Metrics-Enabled '--disable-metrics') { - throw "Metrics were not force-disabled by the disable-metrics tag file." - } -} -finally { - Remove-Item $metricsTagName -} diff --git a/scripts/azure-pipelines/end-to-end-tests-dir/env-passthrough.ps1 b/scripts/azure-pipelines/end-to-end-tests-dir/env-passthrough.ps1 deleted file mode 100644 index 6de1335d7c..0000000000 --- a/scripts/azure-pipelines/end-to-end-tests-dir/env-passthrough.ps1 +++ /dev/null @@ -1,21 +0,0 @@ -if (-not $IsLinux -and -not $IsMacOS) { - . $PSScriptRoot/../end-to-end-tests-prelude.ps1 - - $env:_VCPKG_TEST_TRACKED = "a" - $env:_VCPKG_TEST_UNTRACKED = "b" - - $x = ./vcpkg "--overlay-triplets=$PSScriptRoot/../../testing/env-passthrough" env "echo %_VCPKG_TEST_TRACKED% %_VCPKG_TEST_TRACKED2% %_VCPKG_TEST_UNTRACKED% %_VCPKG_TEST_UNTRACKED2%" - if ($x -ne "%_VCPKG_TEST_TRACKED% %_VCPKG_TEST_TRACKED2% %_VCPKG_TEST_UNTRACKED% %_VCPKG_TEST_UNTRACKED2%") - { - throw "env should have cleaned the environment ($x)" - } - - $y = ./vcpkg "--overlay-triplets=$PSScriptRoot/../../testing/env-passthrough" env --triplet passthrough "echo %_VCPKG_TEST_TRACKED% %_VCPKG_TEST_TRACKED2% %_VCPKG_TEST_UNTRACKED% %_VCPKG_TEST_UNTRACKED2%" - if ($y -ne "a %_VCPKG_TEST_TRACKED2% b %_VCPKG_TEST_UNTRACKED2%") - { - throw "env should have kept the environment ($y)" - } - - rm env:_VCPKG_TEST_TRACKED - rm env:_VCPKG_TEST_UNTRACKED -} \ No newline at end of file diff --git a/scripts/azure-pipelines/end-to-end-tests-dir/integrate-install.ps1 b/scripts/azure-pipelines/end-to-end-tests-dir/integrate-install.ps1 deleted file mode 100644 index 38362ba8cb..0000000000 --- a/scripts/azure-pipelines/end-to-end-tests-dir/integrate-install.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -if (-not $IsLinux -and -not $IsMacOS) { - . $PSScriptRoot/../end-to-end-tests-prelude.ps1 - - # Test msbuild props and targets - $Script:CurrentTest = "zlib:x86-windows-static msbuild scripts\testing\integrate-install\..." - Write-Host $Script:CurrentTest - ./vcpkg $commonArgs install zlib:x86-windows-static --x-binarysource=clear - Throw-IfFailed - foreach ($project in @("VcpkgTriplet", "VcpkgTriplet2", "VcpkgUseStatic", "VcpkgUseStatic2")) { - $Script:CurrentTest = "msbuild scripts\testing\integrate-install\$project.vcxproj" - ./vcpkg $commonArgs env "msbuild scripts\testing\integrate-install\$project.vcxproj /p:VcpkgRoot=$TestingRoot /p:IntDir=$TestingRoot\int\ /p:OutDir=$TestingRoot\out\ " - Throw-IfFailed - Remove-Item -Recurse -Force $TestingRoot\int - Remove-Item -Recurse -Force $TestingRoot\out - } - $Script:CurrentTest = "zlib:x86-windows msbuild scripts\testing\integrate-install\..." - Write-Host $Script:CurrentTest - ./vcpkg $commonArgs install zlib:x86-windows --x-binarysource=clear - Throw-IfFailed - foreach ($project in @("Project1", "NoProps")) { - $Script:CurrentTest = "msbuild scripts\testing\integrate-install\$project.vcxproj" - Write-Host $Script:CurrentTest - ./vcpkg $commonArgs env "msbuild scripts\testing\integrate-install\$project.vcxproj /p:VcpkgRoot=$TestingRoot /p:IntDir=$TestingRoot\int\ /p:OutDir=$TestingRoot\out\ " - Throw-IfFailed - Remove-Item -Recurse -Force $TestingRoot\int - Remove-Item -Recurse -Force $TestingRoot\out - } -} diff --git a/scripts/azure-pipelines/end-to-end-tests-dir/registries.ps1 b/scripts/azure-pipelines/end-to-end-tests-dir/registries.ps1 deleted file mode 100644 index bdeeb0a15b..0000000000 --- a/scripts/azure-pipelines/end-to-end-tests-dir/registries.ps1 +++ /dev/null @@ -1,192 +0,0 @@ -. "$PSScriptRoot/../end-to-end-tests-prelude.ps1" - - -$builtinRegistryArgs = $commonArgs + @("--x-builtin-registry-versions-dir=$PSScriptRoot/../../e2e_ports/versions") - -Run-Vcpkg install @builtinRegistryArgs 'vcpkg-internal-e2e-test-port' -Throw-IfNotFailed - -# We should not look into the versions directory unless we have a baseline, -# even if we pass the registries feature flag -Run-Vcpkg install @builtinRegistryArgs --feature-flags=registries 'vcpkg-internal-e2e-test-port' -Throw-IfNotFailed - -Run-Vcpkg install @builtinRegistryArgs --feature-flags=registries 'zlib' -Throw-IfFailed - -Write-Trace "Test git and filesystem registries" -Refresh-TestRoot -$filesystemRegistry = "$TestingRoot/filesystem-registry" -$gitRegistryUpstream = "$TestingRoot/git-registry-upstream" - -# build a filesystem registry -Write-Trace "build a filesystem registry" -New-Item -Path $filesystemRegistry -ItemType Directory -$filesystemRegistry = (Get-Item $filesystemRegistry).FullName - -Copy-Item -Recurse ` - -LiteralPath "$PSScriptRoot/../../e2e_ports/vcpkg-internal-e2e-test-port" ` - -Destination "$filesystemRegistry" -New-Item ` - -Path "$filesystemRegistry/versions" ` - -ItemType Directory -Copy-Item ` - -LiteralPath "$PSScriptRoot/../../e2e_ports/versions/baseline.json" ` - -Destination "$filesystemRegistry/versions/baseline.json" -New-Item ` - -Path "$filesystemRegistry/versions/v-" ` - -ItemType Directory - -$vcpkgInternalE2eTestPortJson = @{ - "versions" = @( - @{ - "version-string" = "1.0.0"; - "path" = "$/vcpkg-internal-e2e-test-port" - } - ) -} -New-Item ` - -Path "$filesystemRegistry/versions/v-/vcpkg-internal-e2e-test-port.json" ` - -ItemType File ` - -Value (ConvertTo-Json -Depth 5 -InputObject $vcpkgInternalE2eTestPortJson) - - -# build a git registry -Write-Trace "build a git registry" -New-Item -Path $gitRegistryUpstream -ItemType Directory -$gitRegistryUpstream = (Get-Item $gitRegistryUpstream).FullName - -Push-Location $gitRegistryUpstream -try -{ - $gitConfigOptions = @( - '-c', 'user.name=Nobody', - '-c', 'user.email=nobody@example.com', - '-c', 'core.autocrlf=false' - ) - - $CurrentTest = 'git init .' - git @gitConfigOptions init . - Throw-IfFailed - Copy-Item -Recurse -LiteralPath "$PSScriptRoot/../../e2e_ports/vcpkg-internal-e2e-test-port" -Destination . - New-Item -Path './vcpkg-internal-e2e-test-port/foobar' -Value 'this is just to get a distinct git tree' - - $CurrentTest = 'git add -A' - git @gitConfigOptions add -A - Throw-IfFailed - $CurrentTest = 'git commit' - git @gitConfigOptions commit -m 'initial commit' - Throw-IfFailed - - $vcpkgInternalE2eTestPortGitTree = git rev-parse 'HEAD:vcpkg-internal-e2e-test-port' - $vcpkgInternalE2eTestPortVersionsJson = @{ - "versions" = @( - @{ - "version-string" = "1.0.0"; - "git-tree" = $vcpkgInternalE2eTestPortGitTree - } - ) - } - $vcpkgBaseline = @{ - "default" = @{ - "vcpkg-internal-e2e-test-port" = @{ - "baseline" = "1.0.0" - } - } - } - - New-Item -Path './versions' -ItemType Directory - New-Item -Path './versions/v-' -ItemType Directory - - New-Item -Path './versions/baseline.json' -Value (ConvertTo-Json -Depth 5 -InputObject $vcpkgBaseline) - New-Item -Path './versions/v-/vcpkg-internal-e2e-test-port.json' -Value (ConvertTo-Json -Depth 5 -InputObject $vcpkgInternalE2eTestPortVersionsJson) - - $CurrentTest = 'git add -A' - git @gitConfigOptions add -A - Throw-IfFailed - $CurrentTest = 'git commit' - git @gitConfigOptions commit --amend --no-edit - Throw-IfFailed -} -finally -{ - Pop-Location -} - -# actually test the registries -Write-Trace "actually test the registries" -$vcpkgJson = @{ - "name" = "manifest-test"; - "version-string" = "1.0.0"; - "dependencies" = @( - "vcpkg-internal-e2e-test-port" - ) -} - -# test the filesystem registry -Write-Trace "test the filesystem registry" -$manifestDir = "$TestingRoot/filesystem-registry-test-manifest-dir" - -New-Item -Path $manifestDir -ItemType Directory -$manifestDir = (Get-Item $manifestDir).FullName - -Push-Location $manifestDir -try -{ - New-Item -Path 'vcpkg.json' -ItemType File ` - -Value (ConvertTo-Json -Depth 5 -InputObject $vcpkgJson) - - $vcpkgConfigurationJson = @{ - "default-registry" = $null; - "registries" = @( - @{ - "kind" = "filesystem"; - "path" = $filesystemRegistry; - "packages" = @( "vcpkg-internal-e2e-test-port" ) - } - ) - } - New-Item -Path 'vcpkg-configuration.json' -ItemType File ` - -Value (ConvertTo-Json -Depth 5 -InputObject $vcpkgConfigurationJson) - - Run-Vcpkg install @builtinRegistryArgs '--feature-flags=registries,manifests' - Throw-IfFailed -} -finally -{ - Pop-Location -} - -# test the git registry -Write-Trace "test the git registry" -$manifestDir = "$TestingRoot/git-registry-test-manifest-dir" - -New-Item -Path $manifestDir -ItemType Directory -$manifestDir = (Get-Item $manifestDir).FullName - -Push-Location $manifestDir -try -{ - New-Item -Path 'vcpkg.json' -ItemType File ` - -Value (ConvertTo-Json -Depth 5 -InputObject $vcpkgJson) - - $vcpkgConfigurationJson = @{ - "default-registry" = $null; - "registries" = @( - @{ - "kind" = "git"; - "repository" = $gitRegistryUpstream; - "packages" = @( "vcpkg-internal-e2e-test-port" ) - } - ) - } - New-Item -Path 'vcpkg-configuration.json' -ItemType File ` - -Value (ConvertTo-Json -Depth 5 -InputObject $vcpkgConfigurationJson) - - Run-Vcpkg install @builtinRegistryArgs '--feature-flags=registries,manifests' - Throw-IfFailed -} -finally -{ - Pop-Location -} diff --git a/scripts/azure-pipelines/end-to-end-tests-dir/spaces.ps1 b/scripts/azure-pipelines/end-to-end-tests-dir/spaces.ps1 deleted file mode 100644 index b7aaf6462c..0000000000 --- a/scripts/azure-pipelines/end-to-end-tests-dir/spaces.ps1 +++ /dev/null @@ -1,11 +0,0 @@ -. $PSScriptRoot/../end-to-end-tests-prelude.ps1 - -##### Test spaces in the path -$Script:CurrentTest = "zlib with spaces in path" -Write-Host $Script:CurrentTest -./vcpkg install zlib "--triplet" $Triplet ` - "--no-binarycaching" ` - "--x-buildtrees-root=$TestingRoot/build Trees" ` - "--x-install-root=$TestingRoot/instalL ed" ` - "--x-packages-root=$TestingRoot/packaG es" -Throw-IfFailed diff --git a/scripts/azure-pipelines/end-to-end-tests-dir/vcpkg-minimum-required.ps1 b/scripts/azure-pipelines/end-to-end-tests-dir/vcpkg-minimum-required.ps1 deleted file mode 100644 index 8f512ae7a8..0000000000 --- a/scripts/azure-pipelines/end-to-end-tests-dir/vcpkg-minimum-required.ps1 +++ /dev/null @@ -1,22 +0,0 @@ -. $PSScriptRoot/../end-to-end-tests-prelude.ps1 - -$successCases = @('vcpkg-requires-current-date', 'vcpkg-requires-old-date') -foreach ($successCase in $successCases) { - $CurrentTest = "Should succeeed: ./vcpkg install $successCase" - Write-Host $CurrentTest - Run-Vcpkg install $successCase @commonArgs - if ($LastExitCode -ne 0) { - throw $CurrentTest - } else { - Write-Host "... succeeded." - } -} - -$CurrentTest = "Should fail: ./vcpkg install vcpkg-requires-future-date" -Write-Host $CurrentTest -Run-Vcpkg install vcpkg-requires-future-date @commonArgs -if ($LastExitCode -ne 0) { - Write-Host "... failed (this is good!)." -} else { - throw $CurrentTest -} diff --git a/scripts/azure-pipelines/end-to-end-tests-dir/versions.ps1 b/scripts/azure-pipelines/end-to-end-tests-dir/versions.ps1 deleted file mode 100644 index 7f927759f6..0000000000 --- a/scripts/azure-pipelines/end-to-end-tests-dir/versions.ps1 +++ /dev/null @@ -1,98 +0,0 @@ -. $PSScriptRoot/../end-to-end-tests-prelude.ps1 - -# Test verify versions -mkdir $VersionFilesRoot -Copy-Item -Recurse "scripts/testing/version-files/versions_incomplete" $VersionFilesRoot -$portsRedirectArgsOK = @( - "--feature-flags=versions", - "--x-builtin-ports-root=scripts/testing/version-files/ports", - "--x-builtin-registry-versions-dir=scripts/testing/version-files/versions" -) -$portsRedirectArgsIncomplete = @( - "--feature-flags=versions", - "--x-builtin-ports-root=scripts/testing/version-files/ports_incomplete", - "--x-builtin-registry-versions-dir=$VersionFilesRoot/versions_incomplete" -) -$CurrentTest = "x-verify-ci-versions (All files OK)" -Write-Host $CurrentTest -./vcpkg $portsRedirectArgsOK x-ci-verify-versions --verbose -Throw-IfFailed - -$CurrentTest = "x-verify-ci-versions (Incomplete)" -./vcpkg $portsRedirectArgsIncomplete x-ci-verify-versions --verbose -Throw-IfNotFailed - -$CurrentTest = "x-add-version cat" -# Do not fail if there's nothing to update -./vcpkg $portsRedirectArgsIncomplete x-add-version cat -Throw-IfFailed - -$CurrentTest = "x-add-version dog" -# Local version is not in baseline and versions file -./vcpkg $portsRedirectArgsIncomplete x-add-version dog -Throw-IfFailed - -$CurrentTest = "x-add-version duck" -# Missing versions file -./vcpkg $portsRedirectArgsIncomplete x-add-version duck -Throw-IfFailed - -$CurrentTest = "x-add-version ferret" -# Missing versions file and missing baseline entry -./vcpkg $portsRedirectArgsIncomplete x-add-version ferret -Throw-IfFailed - -$CurrentTest = "x-add-version fish (must fail)" -# Discrepancy between local SHA and SHA in fish.json. Requires --overwrite-version. -$out = ./vcpkg $portsRedirectArgsIncomplete x-add-version fish -Throw-IfNotFailed -$CurrentTest = "x-add-version fish --overwrite-version" -./vcpkg $portsRedirectArgsIncomplete x-add-version fish --overwrite-version -Throw-IfFailed - -$CurrentTest = "x-add-version mouse" -# Missing baseline entry -./vcpkg $portsRedirectArgsIncomplete x-add-version mouse -Throw-IfFailed -# Validate changes -./vcpkg $portsRedirectArgsIncomplete x-ci-verify-versions --verbose -Throw-IfFailed - -$CurrentTest = "default baseline" -$out = ./vcpkg $commonArgs "--feature-flags=versions" install --x-manifest-root=scripts/testing/version-files/default-baseline-1 2>&1 | Out-String -Throw-IfNotFailed -if ($out -notmatch ".*Error: while checking out baseline.*") -{ - $out - throw "Expected to fail due to missing baseline" -} - -git fetch https://github.com/vicroms/test-registries -foreach ($opt_registries in @("",",registries")) -{ - Write-Trace "testing baselines: $opt_registries" - Refresh-TestRoot - $CurrentTest = "without default baseline 2 -- enabling versions should not change behavior" - Remove-Item -Recurse $buildtreesRoot/versioning -ErrorAction SilentlyContinue - ./vcpkg $commonArgs "--feature-flags=versions$opt_registries" install ` - "--dry-run" ` - "--x-manifest-root=scripts/testing/version-files/without-default-baseline-2" ` - "--x-builtin-registry-versions-dir=scripts/testing/version-files/default-baseline-2/versions" - Throw-IfFailed - Require-FileNotExists $buildtreesRoot/versioning - - $CurrentTest = "default baseline 2" - ./vcpkg $commonArgs "--feature-flags=versions$opt_registries" install ` - "--dry-run" ` - "--x-manifest-root=scripts/testing/version-files/default-baseline-2" ` - "--x-builtin-registry-versions-dir=scripts/testing/version-files/default-baseline-2/versions" - Throw-IfFailed - Require-FileExists $buildtreesRoot/versioning - - $CurrentTest = "using version features fails without flag" - ./vcpkg $commonArgs "--feature-flags=-versions$opt_registries" install ` - "--dry-run" ` - "--x-manifest-root=scripts/testing/version-files/default-baseline-2" ` - "--x-builtin-registry-versions-dir=scripts/testing/version-files/default-baseline-2/versions" - Throw-IfNotFailed -} diff --git a/scripts/azure-pipelines/end-to-end-tests-prelude.ps1 b/scripts/azure-pipelines/end-to-end-tests-prelude.ps1 deleted file mode 100644 index 29718bf764..0000000000 --- a/scripts/azure-pipelines/end-to-end-tests-prelude.ps1 +++ /dev/null @@ -1,80 +0,0 @@ -$TestingRoot = Join-Path $WorkingRoot 'testing' -$buildtreesRoot = Join-Path $TestingRoot 'buildtrees' -$installRoot = Join-Path $TestingRoot 'installed' -$packagesRoot = Join-Path $TestingRoot 'packages' -$NuGetRoot = Join-Path $TestingRoot 'nuget' -$NuGetRoot2 = Join-Path $TestingRoot 'nuget2' -$ArchiveRoot = Join-Path $TestingRoot 'archives' -$VersionFilesRoot = Join-Path $TestingRoot 'version-test' -$commonArgs = @( - "--triplet", - $Triplet, - "--x-buildtrees-root=$buildtreesRoot", - "--x-install-root=$installRoot", - "--x-packages-root=$packagesRoot", - "--overlay-ports=$PSScriptRoot/../e2e_ports/overlays" -) -$Script:CurrentTest = 'unassigned' - -if ($IsWindows) -{ - $VcpkgExe = Get-Item './vcpkg.exe' -} -else -{ - $VcpkgExe = Get-Item './vcpkg' -} - -function Refresh-TestRoot { - Remove-Item -Recurse -Force $TestingRoot -ErrorAction SilentlyContinue - mkdir $TestingRoot | Out-Null - mkdir $NuGetRoot | Out-Null -} - -function Require-FileExists { - [CmdletBinding()] - Param( - [string]$File - ) - if (-Not (Test-Path $File)) { - throw "'$Script:CurrentTest' failed to create file '$File'" - } -} - -function Require-FileNotExists { - [CmdletBinding()] - Param( - [string]$File - ) - if (Test-Path $File) { - throw "'$Script:CurrentTest' should not have created file '$File'" - } -} - -function Throw-IfFailed { - if ($LASTEXITCODE -ne 0) { - throw "'$Script:CurrentTest' had a step with a nonzero exit code" - } -} - -function Throw-IfNotFailed { - if ($LASTEXITCODE -eq 0) { - throw "'$Script:CurrentTest' had a step with an unexpectedly zero exit code" - } -} - -function Write-Trace ([string]$text) { - Write-Host (@($MyInvocation.ScriptName, ":", $MyInvocation.ScriptLineNumber, ": ", $text) -join "") -} - -function Run-Vcpkg { - Param( - [Parameter(ValueFromRemainingArguments)] - [string[]]$TestArgs - ) - $Script:CurrentTest = "vcpkg $($testArgs -join ' ')" - Write-Host $Script:CurrentTest - & $VcpkgExe @testArgs -} - -Refresh-TestRoot diff --git a/scripts/azure-pipelines/end-to-end-tests.ps1 b/scripts/azure-pipelines/end-to-end-tests.ps1 deleted file mode 100644 index 8858b362e7..0000000000 --- a/scripts/azure-pipelines/end-to-end-tests.ps1 +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright (c) Microsoft Corporation. -# SPDX-License-Identifier: MIT -# -<# -.SYNOPSIS -End-to-End tests for the vcpkg executable. - -.DESCRIPTION -These tests cover the command line interface and broad functions of vcpkg, including `install`, `remove` and certain -binary caching scenarios. They use the vcpkg executable in the current directory. - -.PARAMETER Triplet -The triplet to use for testing purposes. - -.PARAMETER WorkingRoot -The location used as scratch space for testing. - -#> - -[CmdletBinding()] -Param( - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [string]$Triplet, - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [string]$WorkingRoot, - [Parameter(Mandatory = $false)] - [ValidateNotNullOrEmpty()] - [string]$Filter -) - -$ErrorActionPreference = "Stop" - -if (-Not (Test-Path $WorkingRoot)) { - New-Item -Path $WorkingRoot -ItemType Directory -} - -$WorkingRoot = (Get-Item $WorkingRoot).FullName - -$AllTests = Get-ChildItem $PSScriptRoot/end-to-end-tests-dir/*.ps1 -if ($Filter -ne $Null) { - $AllTests = $AllTests | ? { $_.Name -match $Filter } -} -$n = 1 -$m = $AllTests.Count - -$AllTests | % { - Write-Host "[end-to-end-tests.ps1] [$n/$m] Running suite $_" - & $_ - $n += 1 -} - -Write-Host "[end-to-end-tests.ps1] All tests passed." -$LASTEXITCODE = 0 diff --git a/scripts/azure-pipelines/linux/azure-pipelines.yml b/scripts/azure-pipelines/linux/azure-pipelines.yml index b20908f97d..df5cceda6a 100644 --- a/scripts/azure-pipelines/linux/azure-pipelines.yml +++ b/scripts/azure-pipelines/linux/azure-pipelines.yml @@ -30,20 +30,9 @@ jobs: exit 0 displayName: 'Create ${{ variables.VCPKG_DOWNLOADS }}' - task: Bash@3 - displayName: 'Build vcpkg' + displayName: 'Bootstrap vcpkg' inputs: filePath: bootstrap-vcpkg.sh - arguments: '-buildTests' - - bash: toolsrc/build.rel/vcpkg-test - displayName: 'Run vcpkg tests' - env: - VCPKG_DEBUG: 1 - - task: PowerShell@2 - displayName: 'Run vcpkg end-to-end tests' - inputs: - filePath: 'scripts/azure-pipelines/end-to-end-tests.ps1' - arguments: '-Triplet x64-linux -WorkingRoot ${{ variables.WORKING_ROOT }}' - pwsh: true - task: PowerShell@2 displayName: '*** Test Modified Ports and Prepare Test Logs ***' inputs: diff --git a/scripts/azure-pipelines/osx/azure-pipelines.yml b/scripts/azure-pipelines/osx/azure-pipelines.yml index 50bba080fb..52e974c933 100644 --- a/scripts/azure-pipelines/osx/azure-pipelines.yml +++ b/scripts/azure-pipelines/osx/azure-pipelines.yml @@ -30,17 +30,6 @@ jobs: displayName: 'Build vcpkg' inputs: filePath: bootstrap-vcpkg.sh - arguments: '-buildTests' - - bash: toolsrc/build.rel/vcpkg-test - displayName: 'Run vcpkg tests' - env: - VCPKG_DEBUG: 1 - - task: PowerShell@2 - displayName: 'Run vcpkg end-to-end tests' - inputs: - filePath: 'scripts/azure-pipelines/end-to-end-tests.ps1' - arguments: '-Triplet x64-osx -WorkingRoot ${{ variables.WORKING_ROOT }}' - pwsh: true - task: PowerShell@2 displayName: '*** Test Modified Ports and Prepare Test Logs ***' inputs: diff --git a/scripts/azure-pipelines/signing.yml b/scripts/azure-pipelines/signing.yml deleted file mode 100644 index b7a3137d99..0000000000 --- a/scripts/azure-pipelines/signing.yml +++ /dev/null @@ -1,125 +0,0 @@ -# This script is used internally to produce signed vcpkg builds. -# It uses machines / tasks that are not exposed here on GitHub, as -# the hardware on which we allow signing is restricted. - -trigger: none - -variables: - TeamName: vcpkg -jobs: - - job: windows - displayName: "Windows" - dependsOn: - pool: - name: 'VSEng-MicroBuildVS2019' - demands: - - CMAKE - steps: - - task: PoliCheck@1 - inputs: - inputType: 'Basic' - targetType: 'F' - targetArgument: '$(Build.SourcesDirectory)' - result: 'PoliCheck.xml' - - task: CmdLine@2 - displayName: "Build vcpkg with CMake" - inputs: - failOnStderr: true - script: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x86 -host_arch=x86 - cmake.exe -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=OFF -B "$(Build.StagingDirectory)" -S toolsrc - ninja.exe -C "$(Build.StagingDirectory)" - - task: MicroBuildSigningPlugin@2 - inputs: - signType: 'real' - feedSource: 'https://devdiv.pkgs.visualstudio.com/DefaultCollection/_packaging/MicroBuildToolset/nuget/v3/index.json' - - task: NuGetToolInstaller@1 - inputs: - versionSpec: 5.7 - - task: NuGetCommand@2 - displayName: 'NuGet Restore MicroBuild Signing Extension' - inputs: - command: 'restore' - restoreSolution: 'scripts/azure-pipelines/windows/signing.signproj' - feedsToUse: 'config' - restoreDirectory: '$(Build.SourcesDirectory)\scripts\azure-pipelines\packages' - - task: MSBuild@1 - displayName: 'Sign vcpkg.exe' - inputs: - solution: 'scripts\azure-pipelines\windows\signing.signproj' - msbuildArguments: '/p:OutDir=$(Build.ArtifactStagingDirectory)\ /p:IntermediateOutputPath=$(Build.StagingDirectory)\' - - task: BinSkim@3 - inputs: - InputType: 'CommandLine' - arguments: 'analyze "$(Build.StagingDirectory)\vcpkg.exe"' - - task: BinSkim@3 - inputs: - InputType: 'CommandLine' - arguments: 'analyze "$(Build.StagingDirectory)\tls12-download.exe"' - - task: PublishBuildArtifacts@1 - displayName: 'Publish vcpkg.exe' - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)\vcpkg.exe' - ArtifactName: 'Windows' - publishLocation: 'Container' - - task: PublishBuildArtifacts@1 - displayName: 'Publish vcpkg.pdb' - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)\vcpkg.pdb' - ArtifactName: 'Windows' - publishLocation: 'Container' - - task: PublishBuildArtifacts@1 - displayName: 'Publish tls12-download.exe' - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)\tls12-download.exe' - ArtifactName: 'Windows' - publishLocation: 'Container' - - task: PublishBuildArtifacts@1 - displayName: 'Publish tls12-download.pdb' - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)\tls12-download.pdb' - ArtifactName: 'Windows' - publishLocation: 'Container' - - task: MicroBuildCleanup@1 - condition: succeededOrFailed() - displayName: MicroBuild Cleanup - - job: macos_build - displayName: 'MacOS Build' - pool: - vmImage: macOS-10.15 - steps: - - task: CmdLine@2 - displayName: "Build vcpkg with CMake" - inputs: - failOnStderr: true - script: | - cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=OFF -B "$(Build.StagingDirectory)" -S toolsrc - make -j 8 -C "$(Build.StagingDirectory)" - zip "$(Build.StagingDirectory)/vcpkg.zip" "$(Build.StagingDirectory)/vcpkg" - - task: PublishBuildArtifacts@1 - displayName: "Publish Unsigned MacOS Binary" - inputs: - PathtoPublish: '$(Build.StagingDirectory)/vcpkg.zip' - ArtifactName: 'staging' - publishLocation: 'Container' - - job: macos_sign - displayName: 'MacOS Sign' - dependsOn: macos_build - pool: - name: VSEng-MicroBuildVS2019 - steps: - - checkout: none - - task: DownloadBuildArtifacts@0 - displayName: 'Download Unsigned Binary' - inputs: - artifactName: staging - - task: ms-vseng.MicroBuildTasks.7973a23b-33e3-4b00-a7d9-c06d90f8297f.MicroBuildSignMacFiles@1 - displayName: 'Sign Mac Files' - inputs: - SigningTarget: '$(Build.ArtifactStagingDirectory)\staging\vcpkg.zip' - SigningCert: 8003 - - task: PublishBuildArtifacts@1 - displayName: 'Publish Signed Binary' - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)\staging\vcpkg.zip' - ArtifactName: 'MacOS' diff --git a/scripts/azure-pipelines/windows/azure-pipelines.yml b/scripts/azure-pipelines/windows/azure-pipelines.yml index 4c46e86a77..c2d74b8bcc 100644 --- a/scripts/azure-pipelines/windows/azure-pipelines.yml +++ b/scripts/azure-pipelines/windows/azure-pipelines.yml @@ -24,34 +24,7 @@ jobs: pwsh: true # Note: D: is the Azure machines' temporary disk. - script: .\bootstrap-vcpkg.bat - displayName: 'Build vcpkg' - - task: PowerShell@2 - displayName: 'Run vcpkg end-to-end tests' - condition: eq('${{ parameters.triplet }}', 'x86-windows') - inputs: - filePath: 'scripts/azure-pipelines/end-to-end-tests.ps1' - arguments: '-Triplet ${{ parameters.triplet }} -WorkingRoot ${{ variables.WORKING_ROOT }}' - pwsh: true - - task: CmdLine@2 - displayName: "Build vcpkg with CMake, with older VS, and Run Tests" - condition: eq('${{ parameters.triplet }}', 'x86-windows') - inputs: - script: | - :: TRANSITION, get these tools on the VMs next time we roll them - .\vcpkg.exe fetch cmake - .\vcpkg.exe fetch ninja - set PATH=${{ variables.VCPKG_DOWNLOADS }}\tools\cmake-3.19.2-windows\cmake-3.19.2-win32-x86\bin;${{ variables.VCPKG_DOWNLOADS }}\tools\ninja-1.10.1-windows;%PATH% - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x86 -host_arch=x86 - rmdir /s /q build.x86.debug > nul 2> nul - cmake.exe -G Ninja -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=ON -B build.x86.debug -S toolsrc - ninja.exe -C build.x86.debug - set VCPKG_DEBUG=1 - build.x86.debug\vcpkg-test.exe - cmake -G "Visual Studio 16 2019" -A Win32 -T v140 -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=OFF -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=OFF -B build.x86.vs2015 -S toolsrc - cmake --build build.x86.vs2015 - cmake -G "Visual Studio 16 2019" -A Win32 -T v141 -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=OFF -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=OFF -B build.x86.vs2017 -S toolsrc - cmake --build build.x86.vs2017 - failOnStderr: true + displayName: 'Bootstrap vcpkg' - task: PowerShell@2 displayName: '*** Test Modified Ports and Prepare Test Logs ***' inputs: diff --git a/scripts/azure-pipelines/windows/packages.config b/scripts/azure-pipelines/windows/packages.config deleted file mode 100644 index d48977f796..0000000000 --- a/scripts/azure-pipelines/windows/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/scripts/azure-pipelines/windows/signing.signproj b/scripts/azure-pipelines/windows/signing.signproj deleted file mode 100644 index 9382e0a0e2..0000000000 --- a/scripts/azure-pipelines/windows/signing.signproj +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - Microsoft400 - - - Microsoft400 - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - - - - diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index b4c6295c08..e4153aad40 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -1,10 +1,10 @@ [CmdletBinding()] param( $badParam, - [Parameter(Mandatory=$False)][switch]$disableMetrics = $false, [Parameter(Mandatory=$False)][switch]$win64 = $false, [Parameter(Mandatory=$False)][string]$withVSPath = "", - [Parameter(Mandatory=$False)][string]$withWinSDK = "" + [Parameter(Mandatory=$False)][string]$withWinSDK = "", + [Parameter(Mandatory=$False)][switch]$disableMetrics = $false ) Set-StrictMode -Version Latest # Powershell2-compatible way of forcing named-parameters @@ -12,407 +12,48 @@ if ($badParam) { if ($disableMetrics -and $badParam -eq "1") { - Write-Warning "'disableMetrics 1' is deprecated, please change to 'disableMetrics' (without '1')" + Write-Warning "'disableMetrics 1' is deprecated, please change to 'disableMetrics' (without '1')." } else { - throw "Only named parameters are allowed" + throw "Only named parameters are allowed." } } +if ($win64) +{ + Write-Warning "-win64 no longer has any effect; ignored." +} + +if (-Not [string]::IsNullOrWhiteSpace($withVSPath)) +{ + Write-Warning "-withVSPath no longer has any effect; ignored." +} + +if (-Not [string]::IsNullOrWhiteSpace($withWinSDK)) +{ + Write-Warning "-withWinSDK no longer has any effect; ignored." +} + $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition -$withVSPath = $withVSPath -replace "\\$" # Remove potential trailing backslash - -function vcpkgHasProperty([Parameter(Mandatory=$true)][AllowNull()]$object, [Parameter(Mandatory=$true)]$propertyName) -{ - if ($null -eq $object) - { - return $false - } - - return [bool]($object.psobject.Properties | Where-Object { $_.Name -eq "$propertyName"}) -} - -function getProgramFiles32bit() -{ - $out = ${env:PROGRAMFILES(X86)} - if ($null -eq $out) - { - $out = ${env:PROGRAMFILES} - } - - if ($null -eq $out) - { - throw "Could not find [Program Files 32-bit]" - } - - return $out -} - $vcpkgRootDir = $scriptsDir while (!($vcpkgRootDir -eq "") -and !(Test-Path "$vcpkgRootDir\.vcpkg-root")) { Write-Verbose "Examining $vcpkgRootDir for .vcpkg-root" $vcpkgRootDir = Split-path $vcpkgRootDir -Parent } + Write-Verbose "Examining $vcpkgRootDir for .vcpkg-root - Found" -$vcpkgBootstrapPath = "$vcpkgRootDir\toolsrc\windows-bootstrap" +& "$scriptsDir/tls12-download.exe" github.com "/microsoft/vcpkg-tool/releases/download/2021-01-13-768d8f95c9e752603d2c5901c7a7c7fbdb08af35/vcpkg.exe" "$vcpkgRootDir/vcpkg.exe" +Write-Host "" -if (-not (Test-Path $vcpkgBootstrapPath)) +if ($LASTEXITCODE -ne 0) { - Write-Error "Unable to determine vcpkg build directory. '$vcpkgBootstrapPath' does not exist." + Write-Error "Downloading vcpkg.exe failed. Please check your internet connection, or consider downloading a recent vcpkg.exe from https://github.com/microsoft/vcpkg-tool with a browser." throw } -function getVisualStudioInstances() -{ - $programFiles = getProgramFiles32bit - $results = New-Object System.Collections.ArrayList - $vswhereExe = "$programFiles\Microsoft Visual Studio\Installer\vswhere.exe" - if (Test-Path $vswhereExe) - { - $output = & $vswhereExe -prerelease -legacy -products * -format xml - [xml]$asXml = $output - - foreach ($instance in $asXml.instances.instance) - { - $installationPath = $instance.InstallationPath -replace "\\$" # Remove potential trailing backslash - $installationVersion = $instance.InstallationVersion - - $isPrerelease = -7 - if (vcpkgHasProperty -object $instance -propertyName "isPrerelease") - { - $isPrerelease = $instance.isPrerelease - } - - if ($isPrerelease -eq 0) - { - $releaseType = "PreferenceWeight3::StableRelease" - } - elseif ($isPrerelease -eq 1) - { - $releaseType = "PreferenceWeight2::PreRelease" - } - else - { - $releaseType = "PreferenceWeight1::Legacy" - } - - # Placed like that for easy sorting according to preference - $results.Add("${releaseType}::${installationVersion}::${installationPath}") > $null - } - } - else - { - Write-Verbose "Could not locate vswhere at $vswhereExe" - } - - if ("$env:vs140comntools" -ne "") - { - $installationPath = Split-Path -Parent $(Split-Path -Parent "$env:vs140comntools") - $clExe = "$installationPath\VC\bin\cl.exe" - $vcvarsallbat = "$installationPath\VC\vcvarsall.bat" - - if ((Test-Path $clExe) -And (Test-Path $vcvarsallbat)) - { - $results.Add("PreferenceWeight1::Legacy::14.0::$installationPath") > $null - } - } - - $installationPath = "$programFiles\Microsoft Visual Studio 14.0" - $clExe = "$installationPath\VC\bin\cl.exe" - $vcvarsallbat = "$installationPath\VC\vcvarsall.bat" - - if ((Test-Path $clExe) -And (Test-Path $vcvarsallbat)) - { - $results.Add("PreferenceWeight1::Legacy::14.0::$installationPath") > $null - } - - $results.Sort() - $results.Reverse() - - return $results -} - -function findAnyMSBuildWithCppPlatformToolset([string]$withVSPath) -{ - $VisualStudioInstances = getVisualStudioInstances - if ($null -eq $VisualStudioInstances) - { - throw "Could not find Visual Studio. VS2015, VS2017, or VS2019 (with C++) needs to be installed." - } - - Write-Verbose "VS Candidates:`n`r$([system.String]::Join([Environment]::NewLine, $VisualStudioInstances))" - foreach ($instanceCandidate in $VisualStudioInstances) - { - Write-Verbose "Inspecting: $instanceCandidate" - $split = $instanceCandidate -split "::" - # $preferenceWeight = $split[0] - # $releaseType = $split[1] - $version = $split[2] - $path = $split[3] - - if ($withVSPath -ne "" -and $withVSPath -ne $path) - { - Write-Verbose "Skipping: $instanceCandidate" - continue - } - - $majorVersion = $version.Substring(0,2); - if ($majorVersion -eq "16") - { - $VCFolder= "$path\VC\Tools\MSVC\" - if (Test-Path $VCFolder) - { - Write-Verbose "Picking: $instanceCandidate" - return "$path\MSBuild\Current\Bin\MSBuild.exe", "v142" - } - } - - if ($majorVersion -eq "15") - { - $VCFolder= "$path\VC\Tools\MSVC\" - if (Test-Path $VCFolder) - { - Write-Verbose "Picking: $instanceCandidate" - return "$path\MSBuild\15.0\Bin\MSBuild.exe", "v141" - } - } - - if ($majorVersion -eq "14") - { - $clExe= "$path\VC\bin\cl.exe" - if (Test-Path $clExe) - { - Write-Verbose "Picking: $instanceCandidate" - $programFilesPath = getProgramFiles32bit - return "$programFilesPath\MSBuild\14.0\Bin\MSBuild.exe", "v140" - } - } - } - - throw "Could not find MSBuild version with C++ support. VS2015, VS2017, or VS2019 (with C++) needs to be installed." -} -function getWindowsSDK( [Parameter(Mandatory=$False)][switch]$DisableWin10SDK = $False, - [Parameter(Mandatory=$False)][switch]$DisableWin81SDK = $False, - [Parameter(Mandatory=$False)][string]$withWinSDK) -{ - if ($DisableWin10SDK -and $DisableWin81SDK) - { - throw "Both Win10SDK and Win81SDK were disabled." - } - - Write-Verbose "Finding WinSDK" - - $validInstances = New-Object System.Collections.ArrayList - - # Windows 10 SDK - function CheckWindows10SDK($path) - { - if ($null -eq $path) - { - return - } - - $folder = (Join-Path $path "Include") - if (!(Test-Path $folder)) - { - Write-Verbose "$folder - Not Found" - return - } - - Write-Verbose "$folder - Found" - $win10sdkVersions = @(Get-ChildItem $folder | Where-Object {$_.Name -match "^10"} | Sort-Object) - [array]::Reverse($win10sdkVersions) # Newest SDK first - - foreach ($win10sdk in $win10sdkVersions) - { - $win10sdkV = $win10sdk.Name - $windowsheader = "$folder\$win10sdkV\um\windows.h" - if (!(Test-Path $windowsheader)) - { - Write-Verbose "$windowsheader - Not Found" - continue - } - Write-Verbose "$windowsheader - Found" - - $ddkheader = "$folder\$win10sdkV\shared\sdkddkver.h" - if (!(Test-Path $ddkheader)) - { - Write-Verbose "$ddkheader - Not Found" - continue - } - - Write-Verbose "$ddkheader - Found" - $win10sdkVersionString = $win10sdkV.ToString() - Write-Verbose "Found $win10sdkVersionString" - $validInstances.Add($win10sdkVersionString) > $null - } - } - - Write-Verbose "`n" - Write-Verbose "Looking for Windows 10 SDK" - $regkey10 = Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot10' -ErrorAction SilentlyContinue - $regkey10Wow6432 = Get-ItemProperty -Path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot10' -ErrorAction SilentlyContinue - if (vcpkgHasProperty -object $regkey10 "KitsRoot10") { CheckWindows10SDK($regkey10.KitsRoot10) } - if (vcpkgHasProperty -object $regkey10Wow6432 "KitsRoot10") { CheckWindows10SDK($regkey10Wow6432.KitsRoot10) } - CheckWindows10SDK("$env:ProgramFiles\Windows Kits\10") - CheckWindows10SDK("${env:ProgramFiles(x86)}\Windows Kits\10") - - # Windows 8.1 SDK - function CheckWindows81SDK($path) - { - if ($null -eq $path) - { - return - } - - $folder = "$path\Include" - if (!(Test-Path $folder)) - { - Write-Verbose "$folder - Not Found" - return - } - - Write-Verbose "$folder - Found" - $win81sdkVersionString = "8.1" - Write-Verbose "Found $win81sdkVersionString" - $validInstances.Add($win81sdkVersionString) > $null - } - - Write-Verbose "`n" - Write-Verbose "Looking for Windows 8.1 SDK" - $regkey81 = Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot81' -ErrorAction SilentlyContinue - $regkey81Wow6432 = Get-ItemProperty -Path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot81' -ErrorAction SilentlyContinue - if (vcpkgHasProperty -object $regkey81 "KitsRoot81") { CheckWindows81SDK($regkey81.KitsRoot81) } - if (vcpkgHasProperty -object $regkey81Wow6432 "KitsRoot81") { CheckWindows81SDK($regkey81Wow6432.KitsRoot81) } - CheckWindows81SDK("$env:ProgramFiles\Windows Kits\8.1") - CheckWindows81SDK("${env:ProgramFiles(x86)}\Windows Kits\8.1") - - Write-Verbose "`n`n`n" - Write-Verbose "The following Windows SDKs were found:" - foreach ($instance in $validInstances) - { - Write-Verbose $instance - } - - # Selecting - if ($withWinSDK -ne "") - { - foreach ($instance in $validInstances) - { - if ($instance -eq $withWinSDK) - { - return $instance - } - } - - throw "Could not find the requested Windows SDK version: $withWinSDK" - } - - foreach ($instance in $validInstances) - { - if (!$DisableWin10SDK -and $instance -match "10.") - { - return $instance - } - - if (!$DisableWin81SDK -and $instance -match "8.1") - { - return $instance - } - } - - throw "Could not detect a Windows SDK / TargetPlatformVersion" -} - -$msbuildExeWithPlatformToolset = findAnyMSBuildWithCppPlatformToolset $withVSPath -$msbuildExe = $msbuildExeWithPlatformToolset[0] -$platformToolset = $msbuildExeWithPlatformToolset[1] -$windowsSDK = getWindowsSDK -withWinSDK $withWinSDK - -$disableMetricsValue = "0" -if ($disableMetrics) -{ - $disableMetricsValue = "1" -} - -$platform = "x86" -$vcpkgReleaseDir = "$vcpkgBootstrapPath\msbuild.x86.release" -if($PSVersionTable.PSVersion.Major -le 2) -{ - $architecture=(Get-WmiObject win32_operatingsystem | Select-Object osarchitecture).osarchitecture -} -else -{ - $architecture=(Get-CimInstance win32_operatingsystem | Select-Object osarchitecture).osarchitecture -} -if ($win64) -{ - if (-not $architecture -like "*64*") - { - throw "Cannot build 64-bit on non-64-bit system" - } - - $platform = "x64" - $vcpkgReleaseDir = "$vcpkgBootstrapPath\msbuild.x64.release" -} - -if ($architecture -like "*64*") -{ - $PreferredToolArchitecture = "x64" -} -else -{ - $PreferredToolArchitecture = "x86" -} - -$arguments = ( -"`"/p:VCPKG_VERSION=unknownhash`"", -"`"/p:VCPKG_BASE_VERSION=2021-01-13`"", # Note: This duplicate date version will be short lived. See https://github.com/microsoft/vcpkg/pull/15474 -"/p:Configuration=Release", -"/p:Platform=$platform", -"/p:PlatformToolset=$platformToolset", -"/p:TargetPlatformVersion=$windowsSDK", -"/p:PreferredToolArchitecture=$PreferredToolArchitecture", -"/verbosity:minimal", -"/m", -"/nologo", -"`"$vcpkgBootstrapPath\vcpkg.vcxproj`"") -join " " - -function vcpkgInvokeCommandClean() -{ - param ( [Parameter(Mandatory=$true)][string]$executable, - [string]$arguments = "") - - Write-Verbose "Clean-Executing: ${executable} ${arguments}" - $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition - $cleanEnvScript = "$scriptsDir\cleanEnvironmentHelper.ps1" - $tripleQuotes = "`"`"`"" - $argumentsWithEscapedQuotes = $arguments -replace "`"", $tripleQuotes - $command = ". $tripleQuotes$cleanEnvScript$tripleQuotes; & $tripleQuotes$executable$tripleQuotes $argumentsWithEscapedQuotes" - $arg = "-NoProfile", "-ExecutionPolicy Bypass", "-command $command" - - $process = Start-Process -FilePath powershell.exe -ArgumentList $arg -PassThru -NoNewWindow - Wait-Process -InputObject $process - $ec = $process.ExitCode - Write-Verbose "Execution terminated with exit code $ec." - return $ec -} - -# vcpkgInvokeCommandClean cmd "/c echo %PATH%" -Write-Host "`nBuilding vcpkg.exe ...`n" -$ec = vcpkgInvokeCommandClean $msbuildExe $arguments - -if ($ec -ne 0) -{ - Write-Error "Building vcpkg.exe failed. Please ensure you have installed Visual Studio with the Desktop C++ workload and the Windows SDK for Desktop C++." - throw -} - -Write-Host "`nBuilding vcpkg.exe... done.`n" - if ($disableMetrics) { Set-Content -Value "" -Path "$vcpkgRootDir\vcpkg.disable-metrics" -Force @@ -433,9 +74,3 @@ or by setting the VCPKG_DISABLE_METRICS environment variable. Read more about vcpkg telemetry at docs/about/privacy.md "@ } - -Write-Verbose "Placing vcpkg.exe in the correct location" - -Copy-Item "$vcpkgReleaseDir\vcpkg.exe" "$vcpkgRootDir\vcpkg.exe" - -Remove-Item "$vcpkgReleaseDir" -Force -Recurse -ErrorAction SilentlyContinue diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index b7d889f9ec..2188b8af71 100644 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -276,11 +276,29 @@ else fi # Do the build -buildDir="$vcpkgRootDir/toolsrc/build.rel" -rm -rf "$buildDir" -mkdir -p "$buildDir" +vcpkgToolReleaseTag="2021-01-13-768d8f95c9e752603d2c5901c7a7c7fbdb08af35" +vcpkgToolReleaseSha="99c9949637f83bf361ee23557edc889e2865c2105c45306c39c40855a3e1440e2f6fb5ec59e95176fca61eff33929462d23c7b49feb1975f24adb8ca443a98a6" +vcpkgToolReleaseTarball="$vcpkgToolReleaseTag.tar.gz" +vcpkgToolUrl="https://github.com/microsoft/vcpkg-tool/archive/$vcpkgToolReleaseTarball" +baseBuildDir="$vcpkgRootDir/buildtrees/_vcpkg" +buildDir="$baseBuildDir/build" +tarballPath="$downloadsDir/$vcpkgToolReleaseTarball" +srcBaseDir="$baseBuildDir/src" +srcDir="$srcBaseDir/vcpkg-tool-$vcpkgToolReleaseTag" -(cd "$buildDir" && CXX="$CXX" "$cmakeExe" .. -DCMAKE_BUILD_TYPE=Release -G "Ninja" "-DCMAKE_MAKE_PROGRAM=$ninjaExe" "-DBUILD_TESTING=$vcpkgBuildTests" "-DVCPKG_DEVELOPMENT_WARNINGS=OFF" "-DVCPKG_ALLOW_APPLE_CLANG=$vcpkgAllowAppleClang") || exit 1 +if [ -e "$tarballPath" ]; then + vcpkgCheckEqualFileHash "$vcpkgToolUrl" "$tarballPath" "$vcpkgToolReleaseSha" +else + echo "Downloading vcpkg tool sources" + vcpkgDownloadFile "$vcpkgToolUrl" "$tarballPath" "$vcpkgToolReleaseSha" +fi + +echo "Building vcpkg-tool..." +rm -rf "$baseBuildDir" +mkdir -p "$buildDir" +vcpkgExtractArchive "$tarballPath" "$srcBaseDir" + +(cd "$buildDir" && CXX="$CXX" "$cmakeExe" "$srcDir" -DCMAKE_BUILD_TYPE=Release -G "Ninja" "-DCMAKE_MAKE_PROGRAM=$ninjaExe" "-DBUILD_TESTING=$vcpkgBuildTests" "-DVCPKG_DEVELOPMENT_WARNINGS=OFF" "-DVCPKG_ALLOW_APPLE_CLANG=$vcpkgAllowAppleClang") || exit 1 (cd "$buildDir" && "$cmakeExe" --build .) || exit 1 rm -rf "$vcpkgRootDir/vcpkg" diff --git a/scripts/cleanEnvironmentHelper.ps1 b/scripts/cleanEnvironmentHelper.ps1 deleted file mode 100644 index fa5fe869dd..0000000000 --- a/scripts/cleanEnvironmentHelper.ps1 +++ /dev/null @@ -1,52 +0,0 @@ -# Capture environment variables for the System and User. Also add some special/built-in variables. -# These will be used to synthesize a clean environment -$specialEnvironmentMap = @{ "SystemDrive"=$env:SystemDrive; "SystemRoot"=$env:SystemRoot; "UserProfile"=$env:UserProfile; "TMP"=$env:TMP } # These are built-in and not set in the registry -$machineEnvironmentMap = [Environment]::GetEnvironmentVariables('Machine') # HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment -$userEnvironmentMap = [Environment]::GetEnvironmentVariables('User') # HKEY_CURRENT_USER\Environment - -# Identify the keySet of environment variable names -$nameSet = ($specialEnvironmentMap.Keys + $machineEnvironmentMap.Keys + $userEnvironmentMap.Keys) | Sort-Object | Select-Object -Unique - -# Any environment variable in the $nameSet should be restored to its original value -foreach ($name in $nameSet) -{ - if ($specialEnvironmentMap.ContainsKey($name)) - { - [Environment]::SetEnvironmentVariable($name, $specialEnvironmentMap[$name], 'Process') - continue; - } - - # PATH needs to be concatenated as it has values in both machine and user environment. Any other values should be set. - if ($name -eq 'path') - { - $pathValuePartial = @() - # Machine values before user values - $pathValuePartial += $machineEnvironmentMap[$name] -split ';' - $pathValuePartial += $userEnvironmentMap[$name] -split ';' - $pathValue = $pathValuePartial -join ';' - [Environment]::SetEnvironmentVariable($name, $pathValue, 'Process') - continue; - } - - if ($userEnvironmentMap.ContainsKey($name)) - { - [Environment]::SetEnvironmentVariable($name, $userEnvironmentMap[$name], 'Process') - continue; - } - - if ($machineEnvironmentMap.ContainsKey($name)) - { - [Environment]::SetEnvironmentVariable($name, $machineEnvironmentMap[$name], 'Process') - continue; - } - - throw "Unreachable: Unknown variable $name" -} - -# Any environment variable NOT in the $nameSet should be removed -$processEnvironmentMap = [Environment]::GetEnvironmentVariables('Process') -$variablesForRemoval = $processEnvironmentMap.Keys | Where-Object {$nameSet -notcontains $_} -foreach ($name in $variablesForRemoval) -{ - [Environment]::SetEnvironmentVariable($name, $null, 'Process') -} diff --git a/scripts/e2e_ports/overlays/vcpkg-requires-current-date/portfile.cmake b/scripts/e2e_ports/overlays/vcpkg-requires-current-date/portfile.cmake deleted file mode 100644 index 68dc779a84..0000000000 --- a/scripts/e2e_ports/overlays/vcpkg-requires-current-date/portfile.cmake +++ /dev/null @@ -1,2 +0,0 @@ -vcpkg_minimum_required(VERSION ${VCPKG_BASE_VERSION}) -set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/scripts/e2e_ports/overlays/vcpkg-requires-current-date/vcpkg.json b/scripts/e2e_ports/overlays/vcpkg-requires-current-date/vcpkg.json deleted file mode 100644 index 48debf1e76..0000000000 --- a/scripts/e2e_ports/overlays/vcpkg-requires-current-date/vcpkg.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "vcpkg-requires-current-date", - "version-string": "1.0.0", - "description": "A test port that verifies that vcpkg_minimum_required is inclusive by using the current base version value.", - "homepage": "" -} diff --git a/scripts/e2e_ports/overlays/vcpkg-requires-future-date/portfile.cmake b/scripts/e2e_ports/overlays/vcpkg-requires-future-date/portfile.cmake deleted file mode 100644 index b68e53e95c..0000000000 --- a/scripts/e2e_ports/overlays/vcpkg-requires-future-date/portfile.cmake +++ /dev/null @@ -1,2 +0,0 @@ -vcpkg_minimum_required(VERSION 2999-12-31) -set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/scripts/e2e_ports/overlays/vcpkg-requires-future-date/vcpkg.json b/scripts/e2e_ports/overlays/vcpkg-requires-future-date/vcpkg.json deleted file mode 100644 index f60901998f..0000000000 --- a/scripts/e2e_ports/overlays/vcpkg-requires-future-date/vcpkg.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "vcpkg-requires-future-date", - "version-string": "1.0.0", - "description": "A test port that requires a vcpkg version from an impossibly far future.", - "homepage": "" -} diff --git a/scripts/e2e_ports/overlays/vcpkg-requires-old-date/portfile.cmake b/scripts/e2e_ports/overlays/vcpkg-requires-old-date/portfile.cmake deleted file mode 100644 index 5a4fbf4213..0000000000 --- a/scripts/e2e_ports/overlays/vcpkg-requires-old-date/portfile.cmake +++ /dev/null @@ -1,2 +0,0 @@ -vcpkg_minimum_required(VERSION 2020-01-12) -set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/scripts/e2e_ports/overlays/vcpkg-requires-old-date/vcpkg.json b/scripts/e2e_ports/overlays/vcpkg-requires-old-date/vcpkg.json deleted file mode 100644 index 31e6fb62ff..0000000000 --- a/scripts/e2e_ports/overlays/vcpkg-requires-old-date/vcpkg.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "vcpkg-requires-old-date", - "version-string": "1.0.0", - "description": "A test port that requires a vcpkg version from before vcpkg_minimum_required's introduction.", - "homepage": "" -} diff --git a/scripts/e2e_ports/overlays/vcpkg-uses-test-cmake/portfile.cmake b/scripts/e2e_ports/overlays/vcpkg-uses-test-cmake/portfile.cmake deleted file mode 100644 index 571ae3b7ab..0000000000 --- a/scripts/e2e_ports/overlays/vcpkg-uses-test-cmake/portfile.cmake +++ /dev/null @@ -1,3 +0,0 @@ -set(VCPKG_POLICY_EMPTY_PACKAGE enabled) - -vcpkg_test_cmake(args args args) diff --git a/scripts/e2e_ports/overlays/vcpkg-uses-test-cmake/vcpkg.json b/scripts/e2e_ports/overlays/vcpkg-uses-test-cmake/vcpkg.json deleted file mode 100644 index 9f34e058d6..0000000000 --- a/scripts/e2e_ports/overlays/vcpkg-uses-test-cmake/vcpkg.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "vcpkg-uses-test-cmake", - "version-string": "1.0.0", - "description": "A test port that uses the deprecated function vcpkg_test_cmake.", - "homepage": "" -} diff --git a/scripts/e2e_ports/overlays/vcpkg-uses-vcpkg-common-functions/portfile.cmake b/scripts/e2e_ports/overlays/vcpkg-uses-vcpkg-common-functions/portfile.cmake deleted file mode 100644 index 9207d30b19..0000000000 --- a/scripts/e2e_ports/overlays/vcpkg-uses-vcpkg-common-functions/portfile.cmake +++ /dev/null @@ -1,3 +0,0 @@ -set(VCPKG_POLICY_EMPTY_PACKAGE enabled) - -include(vcpkg_common_functions) diff --git a/scripts/e2e_ports/overlays/vcpkg-uses-vcpkg-common-functions/vcpkg.json b/scripts/e2e_ports/overlays/vcpkg-uses-vcpkg-common-functions/vcpkg.json deleted file mode 100644 index 7c16ffe821..0000000000 --- a/scripts/e2e_ports/overlays/vcpkg-uses-vcpkg-common-functions/vcpkg.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "vcpkg-uses-vcpkg-common-functions", - "version-string": "1.0.0", - "description": "A test port that uses the deprecated file vcpkg_common_functions.", - "homepage": "" -} diff --git a/scripts/e2e_ports/vcpkg-internal-e2e-test-port/portfile.cmake b/scripts/e2e_ports/vcpkg-internal-e2e-test-port/portfile.cmake deleted file mode 100644 index 065116c276..0000000000 --- a/scripts/e2e_ports/vcpkg-internal-e2e-test-port/portfile.cmake +++ /dev/null @@ -1 +0,0 @@ -set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/scripts/e2e_ports/vcpkg-internal-e2e-test-port/vcpkg.json b/scripts/e2e_ports/vcpkg-internal-e2e-test-port/vcpkg.json deleted file mode 100644 index a25da6d236..0000000000 --- a/scripts/e2e_ports/vcpkg-internal-e2e-test-port/vcpkg.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "vcpkg-internal-e2e-test-port", - "version-string": "1.0.0" -} diff --git a/scripts/e2e_ports/versions/baseline.json b/scripts/e2e_ports/versions/baseline.json deleted file mode 100644 index 2413f8afc6..0000000000 --- a/scripts/e2e_ports/versions/baseline.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "default": { - "vcpkg-internal-e2e-test-port": { "baseline": "1.0.0" } - } -} diff --git a/scripts/e2e_ports/versions/v-/vcpkg-internal-e2e-test-port.json b/scripts/e2e_ports/versions/v-/vcpkg-internal-e2e-test-port.json deleted file mode 100644 index ce7698ebb8..0000000000 --- a/scripts/e2e_ports/versions/v-/vcpkg-internal-e2e-test-port.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "versions": [ - { - "version-string": "1.0.0", - "git-tree": "1dc3e42a3c0cafe2884d379af4399273238b986e" - } - ] -} diff --git a/scripts/testing/env-passthrough/passthrough.cmake b/scripts/testing/env-passthrough/passthrough.cmake deleted file mode 100644 index 071b8381ea..0000000000 --- a/scripts/testing/env-passthrough/passthrough.cmake +++ /dev/null @@ -1,6 +0,0 @@ -set(VCPKG_TARGET_ARCHITECTURE x64) -set(VCPKG_CRT_LINKAGE dynamic) -set(VCPKG_LIBRARY_LINKAGE dynamic) - -set(VCPKG_ENV_PASSTHROUGH _VCPKG_TEST_TRACKED _VCPKG_TEST_TRACKED2) -set(VCPKG_ENV_PASSTHROUGH_UNTRACKED _VCPKG_TEST_UNTRACKED _VCPKG_TEST_UNTRACKED2) diff --git a/scripts/testing/integrate-install/NoProps.vcxproj b/scripts/testing/integrate-install/NoProps.vcxproj deleted file mode 100644 index 5b75d09615..0000000000 --- a/scripts/testing/integrate-install/NoProps.vcxproj +++ /dev/null @@ -1,145 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - {5AFB7AF5-D8FC-4A86-B0D2-3BBD039ED03A} - Project1 - 10.0 - - - - Application - true - v142 - Unicode - - - Application - false - v142 - true - Unicode - - - Application - true - v142 - Unicode - - - Application - false - v142 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - - - true - - - false - - - false - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - \ No newline at end of file diff --git a/scripts/testing/integrate-install/Project1.vcxproj b/scripts/testing/integrate-install/Project1.vcxproj deleted file mode 100644 index a8896fe29d..0000000000 --- a/scripts/testing/integrate-install/Project1.vcxproj +++ /dev/null @@ -1,146 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - {5AFB7AF5-D8FC-4A86-B0D2-3BBD039ED03A} - Project1 - 10.0 - - - - Application - true - v142 - Unicode - - - Application - false - v142 - true - Unicode - - - Application - true - v142 - Unicode - - - Application - false - v142 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - true - - - true - - - false - - - false - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - \ No newline at end of file diff --git a/scripts/testing/integrate-install/Source.cpp b/scripts/testing/integrate-install/Source.cpp deleted file mode 100644 index 24a84e4d7f..0000000000 --- a/scripts/testing/integrate-install/Source.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main() { - zlibVersion(); - return 0; -} \ No newline at end of file diff --git a/scripts/testing/integrate-install/VcpkgTriplet.vcxproj b/scripts/testing/integrate-install/VcpkgTriplet.vcxproj deleted file mode 100644 index 883fc8ec1a..0000000000 --- a/scripts/testing/integrate-install/VcpkgTriplet.vcxproj +++ /dev/null @@ -1,151 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - {5AFB7AF5-D8FC-4A86-B0D2-3BBD039ED03A} - VcpkgUseStatic - 10.0 - - - - Application - true - v142 - Unicode - - - Application - false - v142 - true - Unicode - - - Application - true - v142 - Unicode - - - Application - false - v142 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - true - - - true - - - false - - - false - - - x86-windows-static - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDebug - - - Console - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - - - Console - true - true - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - \ No newline at end of file diff --git a/scripts/testing/integrate-install/VcpkgTriplet2.vcxproj b/scripts/testing/integrate-install/VcpkgTriplet2.vcxproj deleted file mode 100644 index d3352e195b..0000000000 --- a/scripts/testing/integrate-install/VcpkgTriplet2.vcxproj +++ /dev/null @@ -1,149 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - {5AFB7AF5-D8FC-4A86-B0D2-3BBD039ED03A} - VcpkgUseStatic - 10.0 - x86-windows-static - - - - Application - true - v142 - Unicode - - - Application - false - v142 - true - Unicode - - - Application - true - v142 - Unicode - - - Application - false - v142 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - true - - - true - - - false - - - false - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDebug - - - Console - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - - - Console - true - true - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - \ No newline at end of file diff --git a/scripts/testing/integrate-install/VcpkgUseStatic.vcxproj b/scripts/testing/integrate-install/VcpkgUseStatic.vcxproj deleted file mode 100644 index 28c4fc7158..0000000000 --- a/scripts/testing/integrate-install/VcpkgUseStatic.vcxproj +++ /dev/null @@ -1,151 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - {5AFB7AF5-D8FC-4A86-B0D2-3BBD039ED03A} - VcpkgUseStatic - 10.0 - - - - Application - true - v142 - Unicode - - - Application - false - v142 - true - Unicode - - - Application - true - v142 - Unicode - - - Application - false - v142 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - true - - - true - - - false - - - false - - - true - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDebug - - - Console - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - - - Console - true - true - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - \ No newline at end of file diff --git a/scripts/testing/integrate-install/VcpkgUseStatic2.vcxproj b/scripts/testing/integrate-install/VcpkgUseStatic2.vcxproj deleted file mode 100644 index 98beaee4b1..0000000000 --- a/scripts/testing/integrate-install/VcpkgUseStatic2.vcxproj +++ /dev/null @@ -1,149 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - {5AFB7AF5-D8FC-4A86-B0D2-3BBD039ED03A} - VcpkgUseStatic - 10.0 - true - - - - Application - true - v142 - Unicode - - - Application - false - v142 - true - Unicode - - - Application - true - v142 - Unicode - - - Application - false - v142 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - true - - - true - - - false - - - false - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreadedDebug - - - Console - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - MultiThreaded - - - Console - true - true - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - \ No newline at end of file diff --git a/scripts/tls12-download.exe b/scripts/tls12-download.exe new file mode 100644 index 0000000000..3eff1dd4e0 Binary files /dev/null and b/scripts/tls12-download.exe differ diff --git a/toolsrc/.clang-format b/toolsrc/.clang-format deleted file mode 100644 index 374a4233e6..0000000000 --- a/toolsrc/.clang-format +++ /dev/null @@ -1,54 +0,0 @@ -BasedOnStyle: WebKit -Language: Cpp -Standard: Cpp11 - -UseTab: Never -IndentWidth: 4 -ColumnLimit: 120 -PointerAlignment: Left - -BreakBeforeBraces: Allman - -AllowShortBlocksOnASingleLine: false -AllowShortCaseLabelsOnASingleLine: true -AllowShortFunctionsOnASingleLine: All -AllowShortIfStatementsOnASingleLine: true -AllowShortLoopsOnASingleLine: false -AlwaysBreakTemplateDeclarations: true -AlignAfterOpenBracket: true -AlignOperands: true -AlignTrailingComments: true -BinPackArguments: false -BinPackParameters: false -BreakBeforeBinaryOperators: None -BreakConstructorInitializersBeforeComma: true -ConstructorInitializerAllOnOneLineOrOnePerLine: true -Cpp11BracedListStyle: true -IndentCaseLabels: true -KeepEmptyLinesAtTheStartOfBlocks: false -NamespaceIndentation: All -ForEachMacros: [TEST_CASE, SECTION] -PenaltyReturnTypeOnItsOwnLine: 1000 -SpaceAfterTemplateKeyword: false -SpaceBeforeCpp11BracedList: false -DeriveLineEnding: false -UseCRLF: false - -IncludeBlocks: Regroup -IncludeCategories: - - Regex: '^(|"pch\.h")$' - Priority: -1 - - Regex: '^$' - Priority: 1 - - Regex: '^$' - Priority: 2 - - Regex: '^$' - Priority: 3 - - Regex: '^$' - Priority: 4 - - Regex: '^$' - Priority: 5 - - Regex: '^<[a-z0-9_]*\.h>$' - Priority: 6 - - Regex: '^<[a-z0-9_]*>$' # C++ standard library - Priority: 7 diff --git a/toolsrc/CMakeLists.txt b/toolsrc/CMakeLists.txt deleted file mode 100644 index 24ab12818d..0000000000 --- a/toolsrc/CMakeLists.txt +++ /dev/null @@ -1,222 +0,0 @@ -if(WIN32) -# 3.16 for MSVC_RUNTIME_LIBRARY -cmake_minimum_required(VERSION 3.16) -else() -cmake_minimum_required(VERSION 3.14) -endif() - -project(vcpkg C CXX) -include(cmake/utilities.cmake) - -# =============== -# === Options === -# =============== - -include(CMakeDependentOption) - -option(BUILD_TESTING "Option for enabling testing" ON) -option(VCPKG_ALLOW_APPLE_CLANG "Option for allowing apple clang, even versions that we don't know will work" OFF) -option(VCPKG_DEVELOPMENT_WARNINGS "Option for turning on all warnings" ON) -option(VCPKG_WARNINGS_AS_ERRORS "Set warnings to be errors" ${VCPKG_DEVELOPMENT_WARNINGS}) -option(VCPKG_BUILD_FUZZING "Option for enabling vcpkg-fuzz support" OFF) -option(VCPKG_EMBED_GIT_SHA "Option for to fill in the Git SHA version; off by default to avoid privacy concerns out of official builds" OFF) - -CMAKE_DEPENDENT_OPTION(VCPKG_BUILD_BENCHMARKING "Option for enabling benchmarking" OFF - "BUILD_TESTING" OFF) - -if(WERROR) - message(DEPRECATION "-DWERROR is no longer a supported flag. It doesn't do anything.") -endif() -if(DEFINE_DISABLE_METRICS OR VCPKG_DISABLE_METRICS) - message(DEPRECATION "DEFINE_DISABLE_METRICS / VCPKG_DISABLE_METRICS are now handled by creating a " - "file vcpkg.disable_metrics next to the binary.") -endif() - -# ============= -# === Files === -# ============= - -file(GLOB VCPKGLIB_SOURCES CONFIGURE_DEPENDS src/vcpkg/*.cpp) -file(GLOB VCPKGLIB_BASE_SOURCES CONFIGURE_DEPENDS src/vcpkg/base/*.cpp) -file(GLOB VCPKGLIB_INCLUDES CONFIGURE_DEPENDS include/vcpkg/*.h include/vcpkg/fwd/*.h) -file(GLOB VCPKGLIB_BASE_INCLUDES CONFIGURE_DEPENDS include/vcpkg/base/*.h include/vcpkg/base/fwd/*.h) - -set(VCPKG_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/vcpkg.cpp) - -file(GLOB VCPKG_TEST_SOURCES CONFIGURE_DEPENDS src/vcpkg-test/*.cpp) -file(GLOB VCPKG_TEST_INCLUDES CONFIGURE_DEPENDS include/vcpkg-test/*.h) - -file(GLOB VCPKG_FUZZ_SOURCES CONFIGURE_DEPENDS src/vcpkg-fuzz/*.cpp) - -# ======================== -# === System detection === -# ======================== - -vcpkg_detect_compiler() -vcpkg_detect_standard_library() -vcpkg_detect_std_filesystem() - -if (VCPKG_EMBED_GIT_SHA) - find_package(Git REQUIRED) - execute_process( - COMMAND "${GIT_EXECUTABLE}" status --porcelain=v1 - WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} - OUTPUT_VARIABLE VCPKG_GIT_STATUS - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - - if (VCPKG_GIT_STATUS STREQUAL "") - execute_process( - COMMAND "${GIT_EXECUTABLE}" rev-parse HEAD - WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} - OUTPUT_VARIABLE VCPKG_VERSION - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - else() - message(WARNING "Skipping embedding SHA due to local changes.") - endif() -endif() - -if (NOT DEFINED VCPKG_VERSION OR VCPKG_VERSION STREQUAL "") - set(VCPKG_VERSION "unknownhash") -endif() - -set(VCPKG_BASE_VERSION "2021-01-13") - -set(CMAKE_CXX_EXTENSIONS OFF) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_STANDARD 17) -if(MSVC) - string(REGEX REPLACE "[-/]W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - if (CMAKE_BUILD_TYPE STREQUAL "Release") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zi /guard:cf") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DEBUG /debugtype:cv,fixup /guard:cf") - endif() -endif() - -if(APPLE) - SET(CMAKE_C_ARCHIVE_CREATE " Scr ") - SET(CMAKE_CXX_ARCHIVE_CREATE " Scr ") - SET(CMAKE_C_ARCHIVE_FINISH " -no_warning_for_no_symbols -c ") - SET(CMAKE_CXX_ARCHIVE_FINISH " -no_warning_for_no_symbols -c ") -endif() - -# =============== -# === Targets === -# =============== - -# === Target: vcpkglib === - -add_library(vcpkglib - ${VCPKGLIB_BASE_SOURCES} - ${VCPKGLIB_SOURCES} - ${VCPKGLIB_BASE_INCLUDES} - ${VCPKGLIB_INCLUDES}) -target_include_directories(vcpkglib PUBLIC include) - -vcpkg_target_add_warning_options(vcpkglib) -target_compile_definitions(vcpkglib PUBLIC - VCPKG_USE_STD_FILESYSTEM=$ - VCPKG_VERSION=${VCPKG_VERSION} - VCPKG_BASE_VERSION=${VCPKG_BASE_VERSION} - ) - -set(THREADS_PREFER_PTHREAD_FLAG ON) -find_package(Threads REQUIRED) -target_link_libraries(vcpkglib PRIVATE Threads::Threads) - -if(VCPKG_CXXFS_LIBRARY) - target_link_libraries(vcpkglib PRIVATE ${VCPKG_CXXFS_LIBRARY}) -endif() - -if(MSVC) - get_target_property(_srcs vcpkglib SOURCES) - - if(NOT CMAKE_GENERATOR MATCHES "Visual Studio .*") - set_property(SOURCE src/pch.cpp APPEND PROPERTY OBJECT_OUTPUTS "${CMAKE_CURRENT_BINARY_DIR}/pch.pch") - set_property(SOURCE ${_srcs} APPEND PROPERTY OBJECT_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pch.pch") - endif() - - set_source_files_properties(src/pch.cpp PROPERTIES COMPILE_FLAGS "/Ycpch.h") - target_sources(vcpkglib PRIVATE src/pch.cpp) - target_compile_options(vcpkglib PRIVATE /Yupch.h /FIpch.h /Zm200) -else() - target_compile_options(vcpkglib PRIVATE -include "${CMAKE_CURRENT_SOURCE_DIR}/include/pch.h") -endif() - -if (MINGW) - target_compile_definitions(vcpkglib - PUBLIC - UNICODE - _WIN32_WINNT=0x0601 - WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY=4 - __fastfail=exit) - target_link_libraries(vcpkglib PUBLIC winhttp bcrypt version ole32 uuid) -endif() - -# === Target: vcpkg === - -add_executable(vcpkg ${VCPKG_SOURCES}) -target_link_libraries(vcpkg PRIVATE vcpkglib) -vcpkg_target_add_warning_options(vcpkg) - -# === Target: vcpkg-test === - -if (BUILD_TESTING) - enable_testing() - - add_executable(vcpkg-test - ${VCPKG_TEST_SOURCES} - ${VCPKG_TEST_INCLUDES}) - target_link_libraries(vcpkg-test PRIVATE vcpkglib) - vcpkg_target_add_warning_options(vcpkg-test) - - add_test(NAME default COMMAND vcpkg-test --order rand --rng-seed time) - - if (VCPKG_BUILD_BENCHMARKING) - target_compile_options(vcpkg-test PRIVATE -DCATCH_CONFIG_ENABLE_BENCHMARKING) - endif() -endif() - -# === Target: vcpkg-fuzz === - -if(VCPKG_BUILD_FUZZING) - add_executable(vcpkg-fuzz ${VCPKG_FUZZ_SOURCES}) - target_link_libraries(vcpkg-fuzz PRIVATE vcpkglib) - vcpkg_target_add_warning_options(vcpkg-fuzz) -endif() - - -# === Target: tls12-download === - -set(TLS12_DOWNLOAD_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/tls12-download.c) -if(WIN32) - add_executable(tls12-download ${TLS12_DOWNLOAD_SOURCES}) - set_property(TARGET tls12-download PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded") - set_property(TARGET tls12-download APPEND PROPERTY LINK_OPTIONS "$,,/ENTRY:entry>") - target_link_libraries(tls12-download winhttp) -endif() - - -# === Target: format === - -find_program(CLANG_FORMAT clang-format) -if(CLANG_FORMAT) - # doing all of these formats in one line has a tendency to overflow the command line length - add_custom_target(format - COMMAND ${CLANG_FORMAT} -i -verbose ${CMAKE_CURRENT_SOURCE_DIR}/src/pch.cpp - COMMAND ${CLANG_FORMAT} -i -verbose ${VCPKGLIB_BASE_SOURCES} - COMMAND ${CLANG_FORMAT} -i -verbose ${VCPKGLIB_SOURCES} - COMMAND ${CLANG_FORMAT} -i -verbose ${CMAKE_CURRENT_SOURCE_DIR}/include/pch.h - COMMAND ${CLANG_FORMAT} -i -verbose ${VCPKGLIB_BASE_INCLUDES} - COMMAND ${CLANG_FORMAT} -i -verbose ${VCPKGLIB_INCLUDES} - - COMMAND ${CLANG_FORMAT} -i -verbose ${VCPKG_SOURCES} - - COMMAND ${CLANG_FORMAT} -i -verbose ${VCPKG_TEST_SOURCES} - COMMAND ${CLANG_FORMAT} -i -verbose ${VCPKG_TEST_INCLUDES} - - COMMAND ${CLANG_FORMAT} -i -verbose ${VCPKG_FUZZ_SOURCES} - COMMAND ${CLANG_FORMAT} -i -verbose ${TLS12_DOWNLOAD_SOURCES} - ) -endif() diff --git a/toolsrc/cmake/utilities.cmake b/toolsrc/cmake/utilities.cmake deleted file mode 100644 index 4b434a9c76..0000000000 --- a/toolsrc/cmake/utilities.cmake +++ /dev/null @@ -1,250 +0,0 @@ -# Outputs to Cache: VCPKG_COMPILER -function(vcpkg_detect_compiler) - if(NOT DEFINED CACHE{VCPKG_COMPILER}) - message(STATUS "Detecting the C++ compiler in use") - if(CMAKE_COMPILER_IS_GNUXX OR CMAKE_CXX_COMPILER_ID MATCHES "GNU") - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0) - message(FATAL_ERROR [[ -The g++ version picked up is too old; please install a newer compiler such as g++-7. -On Ubuntu try the following: - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y - sudo apt-get update -y - sudo apt-get install g++-7 -y -On CentOS try the following: - sudo yum install centos-release-scl - sudo yum install devtoolset-7 - scl enable devtoolset-7 bash -]]) - endif() - - set(COMPILER "gcc") - elseif(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") - #[[ - Note: CMAKE_SYSTEM_VERSION uses darwin versions - - Darwin 19.0.0 = macOS 10.15, iOS 13 - - Darwin 18.0.0 = macOS 10.14, iOS 12 - - Darwin 17.0.0 = macOS 10.13, iOS 11 - - Darwin 16.0.0 = macOS 10.12, iOS 10 - ]] - if(CMAKE_SYSTEM_VERSION VERSION_LESS "19.0.0" AND NOT VCPKG_ALLOW_APPLE_CLANG) - message(FATAL_ERROR [[ -Building the vcpkg tool requires support for the C++ Filesystem TS. -macOS versions below 10.15 do not have support for it with Apple Clang. -Please install gcc6 or newer from homebrew (brew install gcc). -If you would like to try anyway, pass --allowAppleClang to bootstrap.sh. -]]) - endif() - set(COMPILER "clang") - elseif(CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang") - set(COMPILER "clang") - elseif(MSVC) - set(COMPILER "msvc") - else() - message(FATAL_ERROR "Unknown compiler: ${CMAKE_CXX_COMPILER_ID}") - endif() - - set(VCPKG_COMPILER ${COMPILER} - CACHE STRING - "The compiler in use; one of gcc, clang, msvc") - message(STATUS "Detecting the C++ compiler in use - ${VCPKG_COMPILER}") - endif() -endfunction() - -# Outputs to Cache: VCPKG_STANDARD_LIBRARY -function(vcpkg_detect_standard_library) - if(NOT DEFINED CACHE{VCPKG_STANDARD_LIBRARY}) - include(CheckCXXSourceCompiles) - - message(STATUS "Detecting the C++ standard library") - - # note: since is the smallest header, generally it's used to get the standard library version - set(CMAKE_REQUIRED_QUIET ON) - check_cxx_source_compiles([[ -#include -#if !defined(__GLIBCXX__) -#error "not libstdc++" -#endif -int main() {} -]] - _VCPKG_STANDARD_LIBRARY_LIBSTDCXX) - check_cxx_source_compiles([[ -#include -#if !defined(_LIBCPP_VERSION) -#error "not libc++" -#endif -int main() {} -]] - _VCPKG_STANDARD_LIBRARY_LIBCXX) - check_cxx_source_compiles([[ -#include -#if !defined(_MSVC_STL_VERSION) && !(defined(_MSC_VER) && _MSC_VER <= 1900) -#error "not MSVC stl" -#endif -int main() {} -]] - _VCPKG_STANDARD_LIBRARY_MSVC_STL) - if(_VCPKG_STANDARD_LIBRARY_LIBSTDCXX) - set(STANDARD_LIBRARY "libstdc++") - elseif(_VCPKG_STANDARD_LIBRARY_LIBCXX) - set(STANDARD_LIBRARY "libc++") - elseif(_VCPKG_STANDARD_LIBRARY_MSVC_STL) - set(STANDARD_LIBRARY "msvc-stl") - else() - message(FATAL_ERROR "Can't find which C++ runtime is in use") - endif() - - set(VCPKG_STANDARD_LIBRARY ${STANDARD_LIBRARY} - CACHE STRING - "The C++ standard library in use; one of libstdc++, libc++, msvc-stl") - - message(STATUS "Detecting the C++ standard library - ${VCPKG_STANDARD_LIBRARY}") - endif() -endfunction() - -# Outputs to Cache: VCPKG_USE_STD_FILESYSTEM, VCPKG_CXXFS_LIBRARY -function(vcpkg_detect_std_filesystem) - vcpkg_detect_standard_library() - - if(NOT DEFINED CACHE{VCPKG_USE_STD_FILESYSTEM}) - include(CheckCXXSourceCompiles) - - message(STATUS "Detecting how to use the C++ filesystem library") - - set(CMAKE_REQUIRED_QUIET ON) - if(VCPKG_STANDARD_LIBRARY STREQUAL "libstdc++") - check_cxx_source_compiles([[ -#include -#if defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE >= 9 -#error "libstdc++ after version 9 does not require -lstdc++fs" -#endif -int main() {} -]] - _VCPKG_REQUIRE_LINK_CXXFS) - - check_cxx_source_compiles([[ -#include -#if !defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE < 8 -#error "libstdc++ before version 8 does not support " -#endif -int main() {} -]] - _VCPKG_USE_STD_FILESYSTEM) - - if(_VCPKG_REQUIRE_LINK_CXXFS) - set(_VCPKG_CXXFS_LIBRARY "stdc++fs") - endif() - elseif(VCPKG_STANDARD_LIBRARY STREQUAL "libc++") - if(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") - # AppleClang never requires (or allows) -lc++fs, even with libc++ version 8.0.0 - set(_VCPKG_CXXFS_LIBRARY OFF) - elseif(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") - # As above, not required on this platform (tested at least on 6.8) - set(_VCPKG_CXXFS_LIBRARY OFF) - else() - check_cxx_source_compiles([[ -#include -#if _LIBCPP_VERSION >= 9000 -#error "libc++ after version 9 does not require -lc++fs" -#endif -int main() {} -]] - _VCPKG_REQUIRE_LINK_CXXFS) - - if(_VCPKG_REQUIRE_LINK_CXXFS) - set(_VCPKG_CXXFS_LIBRARY "c++fs") - endif() - endif() - - # We don't support versions of libc++ < 7.0.0, and libc++ 7.0.0 has - set(_VCPKG_USE_STD_FILESYSTEM ON) - elseif(VCPKG_STANDARD_LIBRARY STREQUAL "msvc-stl") - check_cxx_source_compiles( - "#include - #if !defined(_MSVC_STL_UPDATE) || _MSVC_STL_UPDATE < 201803 - #error \"MSVC STL before 15.7 does not support \" - #endif - int main() {}" - _VCPKG_USE_STD_FILESYSTEM) - - set(_VCPKG_CXXFS_LIBRARY OFF) - endif() - - set(VCPKG_USE_STD_FILESYSTEM ${_VCPKG_USE_STD_FILESYSTEM} - CACHE BOOL - "Whether to use , as opposed to " - FORCE) - set(VCPKG_CXXFS_LIBRARY ${_VCPKG_CXXFS_LIBRARY} - CACHE STRING - "Library to link (if any) in order to use " - FORCE) - - if(VCPKG_USE_STD_FILESYSTEM) - set(msg "") - else() - set(msg "") - endif() - if(VCPKG_CXXFS_LIBRARY) - set(msg "${msg} with -l${VCPKG_CXXFS_LIBRARY}") - endif() - - message(STATUS "Detecting how to use the C++ filesystem library - ${msg}") - endif() -endfunction() - -function(vcpkg_target_add_warning_options TARGET) - if(MSVC) - # either MSVC, or clang-cl - target_compile_options(${TARGET} PRIVATE -FC) - - if (MSVC_VERSION GREATER 1900) - # Visual Studio 2017 or later - target_compile_options(${TARGET} PRIVATE -permissive- -utf-8) - endif() - - if(VCPKG_DEVELOPMENT_WARNINGS) - target_compile_options(${TARGET} PRIVATE -W4) - if(VCPKG_COMPILER STREQUAL "clang") - # -Wno-range-loop-analysis is due to an LLVM bug which will be fixed in a - # future version of clang https://reviews.llvm.org/D73007 - target_compile_options(${TARGET} PRIVATE - -Wmissing-prototypes - -Wno-missing-field-initializers - -Wno-range-loop-analysis - ) - else() - target_compile_options(${TARGET} PRIVATE -analyze) - endif() - else() - target_compile_options(${TARGET} PRIVATE -W3) - endif() - - if(VCPKG_WARNINGS_AS_ERRORS) - target_compile_options(${TARGET} PRIVATE -WX) - endif() - else() - if(VCPKG_DEVELOPMENT_WARNINGS) - target_compile_options(${TARGET} PRIVATE - -Wall -Wextra -Wpedantic - -Wno-unknown-pragmas - -Wno-missing-field-initializers - -Wno-redundant-move - ) - - # GCC and clang have different names for the same warning - if(VCPKG_COMPILER STREQUAL "gcc") - target_compile_options(${TARGET} PRIVATE - -Wmissing-declarations - ) - elseif(VCPKG_COMPILER STREQUAL "clang") - target_compile_options(${TARGET} PRIVATE - -Wmissing-prototypes - -Wno-range-loop-analysis - ) - endif() - endif() - - if(VCPKG_WARNINGS_AS_ERRORS) - target_compile_options(${TARGET} PRIVATE -Werror) - endif() - endif() -endfunction() diff --git a/toolsrc/include/catch2/catch.hpp b/toolsrc/include/catch2/catch.hpp deleted file mode 100644 index f471a2ec68..0000000000 --- a/toolsrc/include/catch2/catch.hpp +++ /dev/null @@ -1,16865 +0,0 @@ -/* - * Catch v2.9.1 - * Generated: 2019-06-17 11:59:24.363643 - * ---------------------------------------------------------- - * This file has been merged from multiple headers. Please don't edit it directly - * Copyright (c) 2019 Two Blue Cubes Ltd. All rights reserved. - * - * Distributed under the Boost Software License, Version 1.0. (See accompanying - * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - */ -#ifndef TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED -#define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED -// start catch.hpp - - -#define CATCH_VERSION_MAJOR 2 -#define CATCH_VERSION_MINOR 9 -#define CATCH_VERSION_PATCH 1 - -#ifdef __clang__ -# pragma clang system_header -#elif defined __GNUC__ -# pragma GCC system_header -#endif - -// start catch_suppress_warnings.h - -#ifdef __clang__ -# ifdef __ICC // icpc defines the __clang__ macro -# pragma warning(push) -# pragma warning(disable: 161 1682) -# else // __ICC -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wpadded" -# pragma clang diagnostic ignored "-Wswitch-enum" -# pragma clang diagnostic ignored "-Wcovered-switch-default" -# endif -#elif defined __GNUC__ - // Because REQUIREs trigger GCC's -Wparentheses, and because still - // supported version of g++ have only buggy support for _Pragmas, - // Wparentheses have to be suppressed globally. -# pragma GCC diagnostic ignored "-Wparentheses" // See #674 for details - -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wunused-variable" -# pragma GCC diagnostic ignored "-Wpadded" -#endif -// end catch_suppress_warnings.h -#if defined(CATCH_CONFIG_MAIN) || defined(CATCH_CONFIG_RUNNER) -# define CATCH_IMPL -# define CATCH_CONFIG_ALL_PARTS -#endif - -// In the impl file, we want to have access to all parts of the headers -// Can also be used to sanely support PCHs -#if defined(CATCH_CONFIG_ALL_PARTS) -# define CATCH_CONFIG_EXTERNAL_INTERFACES -# if defined(CATCH_CONFIG_DISABLE_MATCHERS) -# undef CATCH_CONFIG_DISABLE_MATCHERS -# endif -# if !defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER) -# define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER -# endif -#endif - -#if !defined(CATCH_CONFIG_IMPL_ONLY) -// start catch_platform.h - -#ifdef __APPLE__ -# include -# if TARGET_OS_OSX == 1 -# define CATCH_PLATFORM_MAC -# elif TARGET_OS_IPHONE == 1 -# define CATCH_PLATFORM_IPHONE -# endif - -#elif defined(linux) || defined(__linux) || defined(__linux__) -# define CATCH_PLATFORM_LINUX - -#elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || defined(__MINGW32__) -# define CATCH_PLATFORM_WINDOWS -#endif - -// end catch_platform.h - -#ifdef CATCH_IMPL -# ifndef CLARA_CONFIG_MAIN -# define CLARA_CONFIG_MAIN_NOT_DEFINED -# define CLARA_CONFIG_MAIN -# endif -#endif - -// start catch_user_interfaces.h - -namespace Catch { - unsigned int rngSeed(); -} - -// end catch_user_interfaces.h -// start catch_tag_alias_autoregistrar.h - -// start catch_common.h - -// start catch_compiler_capabilities.h - -// Detect a number of compiler features - by compiler -// The following features are defined: -// -// CATCH_CONFIG_COUNTER : is the __COUNTER__ macro supported? -// CATCH_CONFIG_WINDOWS_SEH : is Windows SEH supported? -// CATCH_CONFIG_POSIX_SIGNALS : are POSIX signals supported? -// CATCH_CONFIG_DISABLE_EXCEPTIONS : Are exceptions enabled? -// **************** -// Note to maintainers: if new toggles are added please document them -// in configuration.md, too -// **************** - -// In general each macro has a _NO_ form -// (e.g. CATCH_CONFIG_NO_POSIX_SIGNALS) which disables the feature. -// Many features, at point of detection, define an _INTERNAL_ macro, so they -// can be combined, en-mass, with the _NO_ forms later. - -#ifdef __cplusplus - -# if (__cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L) -# define CATCH_CPP14_OR_GREATER -# endif - -# if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) -# define CATCH_CPP17_OR_GREATER -# endif - -#endif - -#if defined(CATCH_CPP17_OR_GREATER) -# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS -#endif - -#ifdef __clang__ - -# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ - _Pragma( "clang diagnostic push" ) \ - _Pragma( "clang diagnostic ignored \"-Wexit-time-destructors\"" ) \ - _Pragma( "clang diagnostic ignored \"-Wglobal-constructors\"") -# define CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS \ - _Pragma( "clang diagnostic pop" ) - -# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \ - _Pragma( "clang diagnostic push" ) \ - _Pragma( "clang diagnostic ignored \"-Wparentheses\"" ) -# define CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS \ - _Pragma( "clang diagnostic pop" ) - -# define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS \ - _Pragma( "clang diagnostic push" ) \ - _Pragma( "clang diagnostic ignored \"-Wunused-variable\"" ) -# define CATCH_INTERNAL_UNSUPPRESS_UNUSED_WARNINGS \ - _Pragma( "clang diagnostic pop" ) - -# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \ - _Pragma( "clang diagnostic push" ) \ - _Pragma( "clang diagnostic ignored \"-Wgnu-zero-variadic-macro-arguments\"" ) -# define CATCH_INTERNAL_UNSUPPRESS_ZERO_VARIADIC_WARNINGS \ - _Pragma( "clang diagnostic pop" ) - -#endif // __clang__ - -//////////////////////////////////////////////////////////////////////////////// -// Assume that non-Windows platforms support posix signals by default -#if !defined(CATCH_PLATFORM_WINDOWS) - #define CATCH_INTERNAL_CONFIG_POSIX_SIGNALS -#endif - -//////////////////////////////////////////////////////////////////////////////// -// We know some environments not to support full POSIX signals -#if defined(__CYGWIN__) || defined(__QNX__) || defined(__EMSCRIPTEN__) || defined(__DJGPP__) - #define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS -#endif - -#ifdef __OS400__ -# define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS -# define CATCH_CONFIG_COLOUR_NONE -#endif - -//////////////////////////////////////////////////////////////////////////////// -// Android somehow still does not support std::to_string -#if defined(__ANDROID__) -# define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING -#endif - -//////////////////////////////////////////////////////////////////////////////// -// Not all Windows environments support SEH properly -#if defined(__MINGW32__) -# define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH -#endif - -//////////////////////////////////////////////////////////////////////////////// -// PS4 -#if defined(__ORBIS__) -# define CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE -#endif - -//////////////////////////////////////////////////////////////////////////////// -// Cygwin -#ifdef __CYGWIN__ - -// Required for some versions of Cygwin to declare gettimeofday -// see: http://stackoverflow.com/questions/36901803/gettimeofday-not-declared-in-this-scope-cygwin -# define _BSD_SOURCE -// some versions of cygwin (most) do not support std::to_string. Use the libstd check. -// https://gcc.gnu.org/onlinedocs/gcc-4.8.2/libstdc++/api/a01053_source.html line 2812-2813 -# if !((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) \ - && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF)) - -# define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING - -# endif -#endif // __CYGWIN__ - -//////////////////////////////////////////////////////////////////////////////// -// Visual C++ -#ifdef _MSC_VER - -# if _MSC_VER >= 1900 // Visual Studio 2015 or newer -# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS -# endif - -// Universal Windows platform does not support SEH -// Or console colours (or console at all...) -# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) -# define CATCH_CONFIG_COLOUR_NONE -# else -# define CATCH_INTERNAL_CONFIG_WINDOWS_SEH -# endif - -// MSVC traditional preprocessor needs some workaround for __VA_ARGS__ -// _MSVC_TRADITIONAL == 0 means new conformant preprocessor -// _MSVC_TRADITIONAL == 1 means old traditional non-conformant preprocessor -# if !defined(_MSVC_TRADITIONAL) || (defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL) -# define CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR -# endif -#endif // _MSC_VER - -#if defined(_REENTRANT) || defined(_MSC_VER) -// Enable async processing, as -pthread is specified or no additional linking is required -# define CATCH_INTERNAL_CONFIG_USE_ASYNC -#endif // _MSC_VER - -//////////////////////////////////////////////////////////////////////////////// -// Check if we are compiled with -fno-exceptions or equivalent -#if defined(__EXCEPTIONS) || defined(__cpp_exceptions) || defined(_CPPUNWIND) -# define CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED -#endif - -//////////////////////////////////////////////////////////////////////////////// -// DJGPP -#ifdef __DJGPP__ -# define CATCH_INTERNAL_CONFIG_NO_WCHAR -#endif // __DJGPP__ - -//////////////////////////////////////////////////////////////////////////////// -// Embarcadero C++Build -#if defined(__BORLANDC__) - #define CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN -#endif - -//////////////////////////////////////////////////////////////////////////////// - -// Use of __COUNTER__ is suppressed during code analysis in -// CLion/AppCode 2017.2.x and former, because __COUNTER__ is not properly -// handled by it. -// Otherwise all supported compilers support COUNTER macro, -// but user still might want to turn it off -#if ( !defined(__JETBRAINS_IDE__) || __JETBRAINS_IDE__ >= 20170300L ) - #define CATCH_INTERNAL_CONFIG_COUNTER -#endif - -//////////////////////////////////////////////////////////////////////////////// -// Check if string_view is available and usable -// The check is split apart to work around v140 (VS2015) preprocessor issue... -#if defined(__has_include) -#if __has_include() && defined(CATCH_CPP17_OR_GREATER) -# define CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW -#endif -#endif - -//////////////////////////////////////////////////////////////////////////////// -// Check if optional is available and usable -#if defined(__has_include) -# if __has_include() && defined(CATCH_CPP17_OR_GREATER) -# define CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL -# endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) -#endif // __has_include - -//////////////////////////////////////////////////////////////////////////////// -// Check if variant is available and usable -#if defined(__has_include) -# if __has_include() && defined(CATCH_CPP17_OR_GREATER) -# if defined(__clang__) && (__clang_major__ < 8) - // work around clang bug with libstdc++ https://bugs.llvm.org/show_bug.cgi?id=31852 - // fix should be in clang 8, workaround in libstdc++ 8.2 -# include -# if defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9) -# define CATCH_CONFIG_NO_CPP17_VARIANT -# else -# define CATCH_INTERNAL_CONFIG_CPP17_VARIANT -# endif // defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9) -# else -# define CATCH_INTERNAL_CONFIG_CPP17_VARIANT -# endif // defined(__clang__) && (__clang_major__ < 8) -# endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) -#endif // __has_include - -#if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER) -# define CATCH_CONFIG_COUNTER -#endif -#if defined(CATCH_INTERNAL_CONFIG_WINDOWS_SEH) && !defined(CATCH_CONFIG_NO_WINDOWS_SEH) && !defined(CATCH_CONFIG_WINDOWS_SEH) && !defined(CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH) -# define CATCH_CONFIG_WINDOWS_SEH -#endif -// This is set by default, because we assume that unix compilers are posix-signal-compatible by default. -#if defined(CATCH_INTERNAL_CONFIG_POSIX_SIGNALS) && !defined(CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_POSIX_SIGNALS) -# define CATCH_CONFIG_POSIX_SIGNALS -#endif -// This is set by default, because we assume that compilers with no wchar_t support are just rare exceptions. -#if !defined(CATCH_INTERNAL_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_WCHAR) -# define CATCH_CONFIG_WCHAR -#endif - -#if !defined(CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_CPP11_TO_STRING) -# define CATCH_CONFIG_CPP11_TO_STRING -#endif - -#if defined(CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_NO_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_CPP17_OPTIONAL) -# define CATCH_CONFIG_CPP17_OPTIONAL -#endif - -#if defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) -# define CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS -#endif - -#if defined(CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_NO_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_CPP17_STRING_VIEW) -# define CATCH_CONFIG_CPP17_STRING_VIEW -#endif - -#if defined(CATCH_INTERNAL_CONFIG_CPP17_VARIANT) && !defined(CATCH_CONFIG_NO_CPP17_VARIANT) && !defined(CATCH_CONFIG_CPP17_VARIANT) -# define CATCH_CONFIG_CPP17_VARIANT -#endif - -#if defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT) -# define CATCH_INTERNAL_CONFIG_NEW_CAPTURE -#endif - -#if defined(CATCH_INTERNAL_CONFIG_NEW_CAPTURE) && !defined(CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NEW_CAPTURE) -# define CATCH_CONFIG_NEW_CAPTURE -#endif - -#if !defined(CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED) && !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) -# define CATCH_CONFIG_DISABLE_EXCEPTIONS -#endif - -#if defined(CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_NO_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_POLYFILL_ISNAN) -# define CATCH_CONFIG_POLYFILL_ISNAN -#endif - -#if defined(CATCH_INTERNAL_CONFIG_USE_ASYNC) && !defined(CATCH_CONFIG_NO_USE_ASYNC) && !defined(CATCH_CONFIG_USE_ASYNC) -# define CATCH_CONFIG_USE_ASYNC -#endif - -#if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS) -# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS -# define CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS -#endif -#if !defined(CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS) -# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS -# define CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS -#endif -#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS) -# define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS -# define CATCH_INTERNAL_UNSUPPRESS_UNUSED_WARNINGS -#endif -#if !defined(CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS) -# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS -# define CATCH_INTERNAL_UNSUPPRESS_ZERO_VARIADIC_WARNINGS -#endif - -#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) -#define CATCH_TRY if ((true)) -#define CATCH_CATCH_ALL if ((false)) -#define CATCH_CATCH_ANON(type) if ((false)) -#else -#define CATCH_TRY try -#define CATCH_CATCH_ALL catch (...) -#define CATCH_CATCH_ANON(type) catch (type) -#endif - -#if defined(CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_NO_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) -#define CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR -#endif - -// end catch_compiler_capabilities.h -#define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line -#define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) -#ifdef CATCH_CONFIG_COUNTER -# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __COUNTER__ ) -#else -# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ ) -#endif - -#include -#include -#include - -// We need a dummy global operator<< so we can bring it into Catch namespace later -struct Catch_global_namespace_dummy {}; -std::ostream& operator<<(std::ostream&, Catch_global_namespace_dummy); - -namespace Catch { - - struct CaseSensitive { enum Choice { - Yes, - No - }; }; - - class NonCopyable { - NonCopyable( NonCopyable const& ) = delete; - NonCopyable( NonCopyable && ) = delete; - NonCopyable& operator = ( NonCopyable const& ) = delete; - NonCopyable& operator = ( NonCopyable && ) = delete; - - protected: - NonCopyable(); - virtual ~NonCopyable(); - }; - - struct SourceLineInfo { - - SourceLineInfo() = delete; - SourceLineInfo( char const* _file, std::size_t _line ) noexcept - : file( _file ), - line( _line ) - {} - - SourceLineInfo( SourceLineInfo const& other ) = default; - SourceLineInfo& operator = ( SourceLineInfo const& ) = default; - SourceLineInfo( SourceLineInfo&& ) noexcept = default; - SourceLineInfo& operator = ( SourceLineInfo&& ) noexcept = default; - - bool empty() const noexcept; - bool operator == ( SourceLineInfo const& other ) const noexcept; - bool operator < ( SourceLineInfo const& other ) const noexcept; - - char const* file; - std::size_t line; - }; - - std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ); - - // Bring in operator<< from global namespace into Catch namespace - // This is necessary because the overload of operator<< above makes - // lookup stop at namespace Catch - using ::operator<<; - - // Use this in variadic streaming macros to allow - // >> +StreamEndStop - // as well as - // >> stuff +StreamEndStop - struct StreamEndStop { - std::string operator+() const; - }; - template - T const& operator + ( T const& value, StreamEndStop ) { - return value; - } -} - -#define CATCH_INTERNAL_LINEINFO \ - ::Catch::SourceLineInfo( __FILE__, static_cast( __LINE__ ) ) - -// end catch_common.h -namespace Catch { - - struct RegistrarForTagAliases { - RegistrarForTagAliases( char const* alias, char const* tag, SourceLineInfo const& lineInfo ); - }; - -} // end namespace Catch - -#define CATCH_REGISTER_TAG_ALIAS( alias, spec ) \ - CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ - namespace{ Catch::RegistrarForTagAliases INTERNAL_CATCH_UNIQUE_NAME( AutoRegisterTagAlias )( alias, spec, CATCH_INTERNAL_LINEINFO ); } \ - CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS - -// end catch_tag_alias_autoregistrar.h -// start catch_test_registry.h - -// start catch_interfaces_testcase.h - -#include - -namespace Catch { - - class TestSpec; - - struct ITestInvoker { - virtual void invoke () const = 0; - virtual ~ITestInvoker(); - }; - - class TestCase; - struct IConfig; - - struct ITestCaseRegistry { - virtual ~ITestCaseRegistry(); - virtual std::vector const& getAllTests() const = 0; - virtual std::vector const& getAllTestsSorted( IConfig const& config ) const = 0; - }; - - bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config ); - std::vector filterTests( std::vector const& testCases, TestSpec const& testSpec, IConfig const& config ); - std::vector const& getAllTestCasesSorted( IConfig const& config ); - -} - -// end catch_interfaces_testcase.h -// start catch_stringref.h - -#include -#include -#include - -namespace Catch { - - /// A non-owning string class (similar to the forthcoming std::string_view) - /// Note that, because a StringRef may be a substring of another string, - /// it may not be null terminated. c_str() must return a null terminated - /// string, however, and so the StringRef will internally take ownership - /// (taking a copy), if necessary. In theory this ownership is not externally - /// visible - but it does mean (substring) StringRefs should not be shared between - /// threads. - class StringRef { - public: - using size_type = std::size_t; - - private: - friend struct StringRefTestAccess; - - char const* m_start; - size_type m_size; - - char* m_data = nullptr; - - void takeOwnership(); - - static constexpr char const* const s_empty = ""; - - public: // construction/ assignment - StringRef() noexcept - : StringRef( s_empty, 0 ) - {} - - StringRef( StringRef const& other ) noexcept - : m_start( other.m_start ), - m_size( other.m_size ) - {} - - StringRef( StringRef&& other ) noexcept - : m_start( other.m_start ), - m_size( other.m_size ), - m_data( other.m_data ) - { - other.m_data = nullptr; - } - - StringRef( char const* rawChars ) noexcept; - - StringRef( char const* rawChars, size_type size ) noexcept - : m_start( rawChars ), - m_size( size ) - {} - - StringRef( std::string const& stdString ) noexcept - : m_start( stdString.c_str() ), - m_size( stdString.size() ) - {} - - ~StringRef() noexcept { - delete[] m_data; - } - - auto operator = ( StringRef const &other ) noexcept -> StringRef& { - delete[] m_data; - m_data = nullptr; - m_start = other.m_start; - m_size = other.m_size; - return *this; - } - - operator std::string() const; - - void swap( StringRef& other ) noexcept; - - public: // operators - auto operator == ( StringRef const& other ) const noexcept -> bool; - auto operator != ( StringRef const& other ) const noexcept -> bool; - - auto operator[] ( size_type index ) const noexcept -> char; - - public: // named queries - auto empty() const noexcept -> bool { - return m_size == 0; - } - auto size() const noexcept -> size_type { - return m_size; - } - - auto numberOfCharacters() const noexcept -> size_type; - auto c_str() const -> char const*; - - public: // substrings and searches - auto substr( size_type start, size_type size ) const noexcept -> StringRef; - - // Returns the current start pointer. - // Note that the pointer can change when if the StringRef is a substring - auto currentData() const noexcept -> char const*; - - private: // ownership queries - may not be consistent between calls - auto isOwned() const noexcept -> bool; - auto isSubstring() const noexcept -> bool; - }; - - auto operator + ( StringRef const& lhs, StringRef const& rhs ) -> std::string; - auto operator + ( StringRef const& lhs, char const* rhs ) -> std::string; - auto operator + ( char const* lhs, StringRef const& rhs ) -> std::string; - - auto operator += ( std::string& lhs, StringRef const& sr ) -> std::string&; - auto operator << ( std::ostream& os, StringRef const& sr ) -> std::ostream&; - - inline auto operator "" _sr( char const* rawChars, std::size_t size ) noexcept -> StringRef { - return StringRef( rawChars, size ); - } - -} // namespace Catch - -inline auto operator "" _catch_sr( char const* rawChars, std::size_t size ) noexcept -> Catch::StringRef { - return Catch::StringRef( rawChars, size ); -} - -// end catch_stringref.h -// start catch_type_traits.hpp - - -#include - -namespace Catch{ - -#ifdef CATCH_CPP17_OR_GREATER - template - inline constexpr auto is_unique = std::true_type{}; - - template - inline constexpr auto is_unique = std::bool_constant< - (!std::is_same_v && ...) && is_unique - >{}; -#else - -template -struct is_unique : std::true_type{}; - -template -struct is_unique : std::integral_constant -::value - && is_unique::value - && is_unique::value ->{}; - -#endif -} - -// end catch_type_traits.hpp -// start catch_preprocessor.hpp - - -#define CATCH_RECURSION_LEVEL0(...) __VA_ARGS__ -#define CATCH_RECURSION_LEVEL1(...) CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(__VA_ARGS__))) -#define CATCH_RECURSION_LEVEL2(...) CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(__VA_ARGS__))) -#define CATCH_RECURSION_LEVEL3(...) CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(__VA_ARGS__))) -#define CATCH_RECURSION_LEVEL4(...) CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(__VA_ARGS__))) -#define CATCH_RECURSION_LEVEL5(...) CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(__VA_ARGS__))) - -#ifdef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR -#define INTERNAL_CATCH_EXPAND_VARGS(...) __VA_ARGS__ -// MSVC needs more evaluations -#define CATCH_RECURSION_LEVEL6(...) CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(__VA_ARGS__))) -#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL6(CATCH_RECURSION_LEVEL6(__VA_ARGS__)) -#else -#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL5(__VA_ARGS__) -#endif - -#define CATCH_REC_END(...) -#define CATCH_REC_OUT - -#define CATCH_EMPTY() -#define CATCH_DEFER(id) id CATCH_EMPTY() - -#define CATCH_REC_GET_END2() 0, CATCH_REC_END -#define CATCH_REC_GET_END1(...) CATCH_REC_GET_END2 -#define CATCH_REC_GET_END(...) CATCH_REC_GET_END1 -#define CATCH_REC_NEXT0(test, next, ...) next CATCH_REC_OUT -#define CATCH_REC_NEXT1(test, next) CATCH_DEFER ( CATCH_REC_NEXT0 ) ( test, next, 0) -#define CATCH_REC_NEXT(test, next) CATCH_REC_NEXT1(CATCH_REC_GET_END test, next) - -#define CATCH_REC_LIST0(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ ) -#define CATCH_REC_LIST1(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0) ) ( f, peek, __VA_ARGS__ ) -#define CATCH_REC_LIST2(f, x, peek, ...) f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ ) - -#define CATCH_REC_LIST0_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ ) -#define CATCH_REC_LIST1_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0_UD) ) ( f, userdata, peek, __VA_ARGS__ ) -#define CATCH_REC_LIST2_UD(f, userdata, x, peek, ...) f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ ) - -// Applies the function macro `f` to each of the remaining parameters, inserts commas between the results, -// and passes userdata as the first parameter to each invocation, -// e.g. CATCH_REC_LIST_UD(f, x, a, b, c) evaluates to f(x, a), f(x, b), f(x, c) -#define CATCH_REC_LIST_UD(f, userdata, ...) CATCH_RECURSE(CATCH_REC_LIST2_UD(f, userdata, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) - -#define CATCH_REC_LIST(f, ...) CATCH_RECURSE(CATCH_REC_LIST2(f, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) - -#define INTERNAL_CATCH_EXPAND1(param) INTERNAL_CATCH_EXPAND2(param) -#define INTERNAL_CATCH_EXPAND2(...) INTERNAL_CATCH_NO## __VA_ARGS__ -#define INTERNAL_CATCH_DEF(...) INTERNAL_CATCH_DEF __VA_ARGS__ -#define INTERNAL_CATCH_NOINTERNAL_CATCH_DEF -#define INTERNAL_CATCH_STRINGIZE(...) INTERNAL_CATCH_STRINGIZE2(__VA_ARGS__) -#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR -#define INTERNAL_CATCH_STRINGIZE2(...) #__VA_ARGS__ -#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) -#else -// MSVC is adding extra space and needs another indirection to expand INTERNAL_CATCH_NOINTERNAL_CATCH_DEF -#define INTERNAL_CATCH_STRINGIZE2(...) INTERNAL_CATCH_STRINGIZE3(__VA_ARGS__) -#define INTERNAL_CATCH_STRINGIZE3(...) #__VA_ARGS__ -#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) (INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) + 1) -#endif - -#define INTERNAL_CATCH_MAKE_NAMESPACE2(...) ns_##__VA_ARGS__ -#define INTERNAL_CATCH_MAKE_NAMESPACE(name) INTERNAL_CATCH_MAKE_NAMESPACE2(name) - -#define INTERNAL_CATCH_REMOVE_PARENS(...) INTERNAL_CATCH_EXPAND1(INTERNAL_CATCH_DEF __VA_ARGS__) - -#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR -#define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) decltype(get_wrapper()) -#define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__)) -#else -#define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) INTERNAL_CATCH_EXPAND_VARGS(decltype(get_wrapper())) -#define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__))) -#endif - -#define INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(...)\ - CATCH_REC_LIST(INTERNAL_CATCH_MAKE_TYPE_LIST,__VA_ARGS__) - -#define INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_0) INTERNAL_CATCH_REMOVE_PARENS(_0) -#define INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_0, _1) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_1) -#define INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_0, _1, _2) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_1, _2) -#define INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_0, _1, _2, _3) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_1, _2, _3) -#define INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_0, _1, _2, _3, _4) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_1, _2, _3, _4) -#define INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_0, _1, _2, _3, _4, _5) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_1, _2, _3, _4, _5) -#define INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_0, _1, _2, _3, _4, _5, _6) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_1, _2, _4, _5, _6) -#define INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_0, _1, _2, _3, _4, _5, _6, _7) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_1, _2, _3, _4, _5, _6, _7) -#define INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_1, _2, _3, _4, _5, _6, _7, _8) -#define INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9) -#define INTERNAL_CATCH_REMOVE_PARENS_11_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10) - -#define INTERNAL_CATCH_VA_NARGS_IMPL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N - -#define INTERNAL_CATCH_TYPE_GEN\ - template struct TypeList {};\ - template\ - constexpr auto get_wrapper() noexcept -> TypeList { return {}; }\ - \ - template class L1, typename...E1, template class L2, typename...E2> \ - constexpr auto append(L1, L2) noexcept -> L1 { return {}; }\ - template< template class L1, typename...E1, template class L2, typename...E2, typename...Rest>\ - constexpr auto append(L1, L2, Rest...) noexcept -> decltype(append(L1{}, Rest{}...)) { return {}; }\ - template< template class L1, typename...E1, typename...Rest>\ - constexpr auto append(L1, TypeList, Rest...) noexcept -> L1 { return {}; }\ - \ - template< template class Container, template class List, typename...elems>\ - constexpr auto rewrap(List) noexcept -> TypeList> { return {}; }\ - template< template class Container, template class List, class...Elems, typename...Elements>\ - constexpr auto rewrap(List,Elements...) noexcept -> decltype(append(TypeList>{}, rewrap(Elements{}...))) { return {}; }\ - \ - template