forked from exercism/fsharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate-tests.ps1
More file actions
37 lines (31 loc) · 876 Bytes
/
generate-tests.ps1
File metadata and controls
37 lines (31 loc) · 876 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<#
.SYNOPSIS
Generate tests.
.DESCRIPTION
Generate tests based on the latest canonical data.
.PARAMETER Exercise
The slug of the exercise to be analyzed (optional).
.EXAMPLE
The example below will regenerate all tests
PS C:\> ./generate-tests.ps1
.EXAMPLE
The example below will regenerate the tests for the "acronym" exercise
PS C:\> ./generate-tests.ps1 acronym
#>
param (
[Parameter(Position = 0, Mandatory = $false)]
[string]$Exercise
)
# Import shared functionality
. ./shared.ps1
function Update-Canonical-Data {
Write-Output "Updating canonical data"
Run-Command "./update-canonical-data.ps1"
}
function Update-Tests {
Write-Output "Updating tests"
$args = if ($Exercise) { @("--exercise", $Exercise) } else { @() }
Run-Command "dotnet run --project ./generators $args"
}
Update-Canonical-Data
Update-Tests