Skip to content

Helper functions to accomplish advanced testing cleanly

License

Notifications You must be signed in to change notification settings

Farwaykorse/AppVeyorHelpers

Repository files navigation

🔧 AppVeyorHelpers

AppVeyor Status tests

A PowerShell module, containing a collection of helper functions for use with the AppVeyor CI platform. Providing robust and tested functionality, with a clean and intuitive interface for the more complex operations to unlock the advanced features of the CI platform.

The initial focus is on support for C++ projects using both MSBuild and CMake on Windows.

🏱 Features

  • Keep the build-log clean and informative.
    • Send notifications and detailed reports to the AppVeyor message API.
    • Upload test results to the AppVeyor Test API.
    • Encapsulate common complex commands in function calls.
  • For use on AppVeyor and local systems.
    Minimum required: PowerShell v5.1, tested on AppVeyor Windows images.
  • Support more build configurations.
    • Use Ninja for faster builds (with CMake projects).
  • [C++] Improved vcpkg usage.

💻 Usage

Usage on AppVeyor. (appveyor.yml)

Import the PowerShell module at the start of the build session:

init:
- ps: |
    New-Item -ItemType Directory -Force ~/Tools | pushd
    git clone https://github.com/Farwaykorse/AppVeyorHelpers.git --quiet
    Import-Module -Name .\AppVeyorHelpers
    popd

A few usage examples:
Display the build configuration and the installed CMake version:

- ps: Show-SystemInfo -CMake

Install tools:

install:
- ps: Install-Ninja -Tag v1.9.0 -AddToPath

Install libraries:

- ps: Update-Vcpkg
- ps: vcpkg install ms-gsl:x64-Windows

📝 Notes

These modules can create persistent files in the file-system. These are primarily the Install-* functions. With the exception of installers that install software in their default location or update software present on the system (notably Update-Vcpkg) these files are all located in ~/Tools.

🏗 Development

Unit tests are implemented with Pester. To run all unit-tests (and code coverage) for this module call:

.\RunTests.ps1 -Coverage

or run Invoke-Pester for an individual sub-module:

Invoke-Pester -Script .\<script>.Tests.ps1 -CodeCoverage .\<script>.psm1

Note: The version of Pester supplied with Windows (10 and Server 2016) is not compatible. Refer to the Pester documentation for instructions.

⚖ License

Code licensed under the MIT License.

top