Skip to content

Commit

Permalink
Merge pull request #2079 from kaby76/issue-2064
Browse files Browse the repository at this point in the history
Changes for #2064.
  • Loading branch information
teverett authored Mar 15, 2021
2 parents 78e083d + b4ea858 commit 090c0fb
Show file tree
Hide file tree
Showing 16 changed files with 5,688 additions and 525 deletions.
29 changes: 27 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,36 @@ jobs:
- name: Test C# target
run: |
bash _scripts/regtest.sh CSharp
build-csharp-pwsh:
build-csharp-pwsh-problem-child:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Test C# target with PowerShell
shell: pwsh
run: |
if ("${{ github.event_name }}" -eq "pull_request") {
$Before = "${{ github.event.pull_request.base.sha }}"
$After = "${{ github.event.pull_request.head.sha }}"
}
else {
$Before = "${{ github.event.before }}"
$After = "${{ github.event.after }}"
}
dotnet tool install -g dotnet-antlr --version 3.0.6
_scripts/test.ps1 CSharp $Before $After
build-csharp-pwsh-ok:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -52,4 +76,5 @@ jobs:
$Before = "${{ github.event.before }}"
$After = "${{ github.event.after }}"
}
dotnet tool install -g dotnet-antlr --version 3.0.6
_scripts/test.ps1 CSharp $Before $After
8 changes: 3 additions & 5 deletions _scripts/regtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ fi
case "$target" in
CSharp)
do_not_do_list=" \
_grammar-test acme algol60 antlr/antlr2 apex apt \
_grammar-test acme apex apt \
arithmetic asm/masm asn/asn_3gpp atl \
basic bcpl \
basic \
calculator capnproto cpp csharp cto \
dcm dgol dice \
erlang \
Expand Down Expand Up @@ -58,13 +58,11 @@ z \

Java)
do_not_do_list=" \
bcpl \
"
;;

JavaScript)
do_not_do_list=" \
bcpl \
"
;;

Expand Down Expand Up @@ -188,7 +186,7 @@ test()
part1()
{
dotnet tool uninstall -g dotnet-antlr
dotnet tool install -g dotnet-antlr --version 3.0.4
dotnet tool install -g dotnet-antlr --version 3.0.6
dotnet tool uninstall -g csxml2
dotnet tool install -g csxml2 --version 1.0.0
# 1) Generate driver source code from poms.
Expand Down
18 changes: 10 additions & 8 deletions _scripts/test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ function Get-GrammarSkipList {
"CSharp" {
return @(
"_grammar-test",
"acme", "algol60", "antlr/antlr2", "apex", "apt", "arithmetic", "asm/masm", "asn/asn_3gpp", "atl",
"basic", "bcpl",
"acme", "apex", "apt", "arithmetic", "asm/masm", "asn/asn_3gpp", "atl",
"basic",
"calculator", "capnproto", "cpp", "csharp", "cto",
"dcm", "dgol", "dice",
"erlang",
Expand All @@ -34,10 +34,10 @@ function Get-GrammarSkipList {
"z")
}
"Java" {
return @("bcpl")
return @("")
}
"JavaScript" {
return @("bcpl")
return @("")
}
Default {
Write-Error "Unknown target $Target"
Expand Down Expand Up @@ -108,9 +108,9 @@ function Test-GrammarTestCases {
Write-Host "Test cases here: $TestDirectory"
foreach ($item in Get-ChildItem $TestDirectory -Recurse) {

Write-Host "Test case: $item"
Write-Host "Test case: $item"

$case = Join-Path $TestDirectory $item
$case = $item
$ext = $case.Extension
if (($ext -eq ".errors") -or ($ext -eq ".tree")) {
continue
Expand Down Expand Up @@ -266,6 +266,10 @@ function Test-AllGrammars {

Write-Host "Grammars to be tested with $Target target:"
Write-Host "$grammars"
# Try adding to path for Ubuntu.
Write-Host "PATH is $env:PATH"
$env:PATH += ":/home/runner/.dotnet/tools"
Write-Host "PATH after update is $env:PATH"

$success = $true
$t = Get-Date
Expand Down Expand Up @@ -295,8 +299,6 @@ function Test-AllGrammars {
# the dotnet-antlr tool to instantiate drivers from templates.
$Dir = Get-Location
$templates = Join-Path $Dir "/_scripts/templates/"
dotnet tool uninstall -g dotnet-antlr
dotnet tool install -g dotnet-antlr --version 3.0.4

$t = $args[0]
$pc = $args[1]
Expand Down
Loading

0 comments on commit 090c0fb

Please sign in to comment.