Skip to content

Commit

Permalink
Merge branch 'antlr:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
100mango authored Jan 4, 2022
2 parents bcd7892 + 7d3fb7b commit fb8a23c
Show file tree
Hide file tree
Showing 827 changed files with 22,034 additions and 21,009 deletions.
38 changes: 20 additions & 18 deletions .appveyor/workflow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
environment:
JAVA_HOME: C:\Program Files\Java\jdk11
MAVEN_VERSION: 3.8
matrix:
- job_name: java-tool-and-runtime
- job_name: csharp-runtime
Expand All @@ -19,7 +21,7 @@ environment:
matrix:
fast_finish: false

version: '4.9.1-SNAPSHOT+AppVeyor.{build}'
version: '4.10-SNAPSHOT+AppVeyor.{build}'
cache:
- '%USERPROFILE%\.m2'
- '%USERPROFILE%\.nuget\packages -> **\project.json'
Expand All @@ -32,24 +34,24 @@ for:
only:
- job_name: java-tool-and-runtime
build_script:
- mvn -q -DskipTests install --batch-mode
- mvn -DskipTests install --batch-mode
test_script:
- cd tool-testsuite
- mvn -q test
- mvn test
- cd ..\runtime-testsuite
- mvn -q -Dtest=java.* test
- mvn -Dparallel=classes -DthreadCount=4 -Dtest=java.** test

- matrix:
only:
- job_name: csharp-runtime
build_script:
- mvn -q -DskipTests install --batch-mode
- mvn -DskipTests install --batch-mode
- dotnet build runtime/CSharp/src/Antlr4.csproj -c Release
after_build:
- dotnet pack runtime/CSharp/src/Antlr4.csproj -c Release
test_script:
- cd runtime-testsuite
- mvn -q -Dtest=csharp.* test
- mvn -Dparallel=classes -DthreadCount=4 -Dtest=csharp.** test
artifacts:
- path: 'runtime\**\*.nupkg'
name: NuGet
Expand All @@ -60,19 +62,19 @@ for:
install:
- cinst -y dart-sdk --version=2.12.1
build_script:
- mvn -q -DskipTests install --batch-mode
- mvn -DskipTests install --batch-mode
test_script:
- cd runtime-testsuite
- mvn -q -Dtest=dart.* test -Dantlr-dart-dart="C:\tools\dart-sdk\bin\dart.exe" -Dantlr-dart-pub="C:\tools\dart-sdk\bin\pub.bat" -Dantlr-dart-dart2native="C:\tools\dart-sdk\bin\dart2native.bat"
- mvn -Dparallel=classes -DthreadCount=4 -Dtest=dart.** test -Dantlr-dart-dart="C:\tools\dart-sdk\bin\dart.exe" -Dantlr-dart-pub="C:\tools\dart-sdk\bin\pub.bat" -Dantlr-dart-dart2native="C:\tools\dart-sdk\bin\dart2native.bat"

- matrix:
only:
- job_name: go-runtime
build_script:
- mvn -q -DskipTests install --batch-mode
- mvn -DskipTests install --batch-mode
test_script:
- cd runtime-testsuite
- mvn -q -Dtest=go.* test
- mvn -Dparallel=classes -DthreadCount=4 -Dtest=go.** test

- matrix:
only:
Expand All @@ -87,13 +89,13 @@ for:
- npm install
- npm link
- cd ..\..
- mvn -q -DskipTests install --batch-mode
- mvn -DskipTests install --batch-mode
test_script:
- cd runtime\JavaScript\
- yarn test
- cd ..\..
- cd runtime-testsuite
- mvn -q -Dtest=javascript.* test -Dantlr-javascript-npm="C:\Program Files\nodejs\npm.cmd" -Dantlr-javascript-nodejs="C:\Program Files\nodejs\node.exe"
- mvn -Dparallel=classes -DthreadCount=4 -Dtest=javascript.** test -Dantlr-javascript-npm="C:\Program Files\nodejs\npm.cmd" -Dantlr-javascript-nodejs="C:\Program Files\nodejs\node.exe"

- matrix:
only:
Expand All @@ -104,25 +106,25 @@ for:
- cinst -y php --params "/InstallDir:C:\tools\php"
- cinst -y composer
build_script:
- mvn -q -DskipTests install --batch-mode
- mvn -DskipTests install --batch-mode
test_script:
- cd runtime-testsuite
- mvn -q -Dtest=php.* test -Dantlr-php-php="C:\tools\php\php.exe"
- mvn -Dparallel=classes -DthreadCount=4 -Dtest=php.** test -Dantlr-php-php="C:\tools\php\php.exe"

- matrix:
only:
- job_name: python2-runtime
build_script:
- mvn -q -DskipTests install --batch-mode
- mvn -DskipTests install --batch-mode
test_script:
- cd runtime-testsuite
- mvn -q -Dtest=python2.* test -Dantlr-python2-python="C:\Python27\python.exe"
- mvn -Dparallel=classes -DthreadCount=4 -Dtest=python2.** test -Dantlr-python2-python="C:\Python27\python.exe"

- matrix:
only:
- job_name: python3-runtime
build_script:
- mvn -q -DskipTests install --batch-mode
- mvn -DskipTests install --batch-mode
test_script:
- cd runtime-testsuite
- mvn -q -Dtest=python3.* test -Dantlr-python3-python="C:\Python35\python.exe"
- mvn -Dparallel=classes -DthreadCount=4 -Dtest=python3.** test -Dantlr-python3-python="C:\Python35\python.exe"
19 changes: 8 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2.1
jobs:
test_tool_and_runtime_java:
docker:
- image: cimg/openjdk:8.0
- image: cimg/openjdk:11.0
steps:
- checkout
- run:
Expand All @@ -13,13 +13,13 @@ jobs:
name: test runtime
command: |
cd runtime-testsuite
mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=java.* test
mvn -Dparallel=classes -DthreadCount=4 -Dtest=java.** test
cd ..
- run:
name: test tool
command: |
cd tool-testsuite
mvn -q -Dparallel=methods -DthreadCount=4 test
mvn -Dparallel=classes -DthreadCount=4 test
cd ..
test_runtime:
parameters:
Expand All @@ -32,7 +32,10 @@ jobs:
type: string
default: java
docker:
- image: cimg/openjdk:8.0
- image: cimg/openjdk:11.0
environment:
MAVEN_OPTS: -Xmx512m
resource_class: large
environment:
TARGET: << parameters.target >>
GROUP: << parameters.test-group >>
Expand All @@ -57,10 +60,4 @@ workflows:
- test_runtime:
matrix:
parameters:
target: [ dart, go, python2, python3, javascript, php ]
- test_runtime:
matrix:
parameters:
# target: [ cpp, dotnet, swift ]
target: [ cpp, dotnet, dart ]
test-group: [ LEXER, PARSER, RECURSION ]
target: [ dart, go, python2, python3, javascript, php, cpp, dotnet ]
12 changes: 1 addition & 11 deletions .circleci/scripts/run-tests-cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,5 @@
set -euo pipefail

pushd runtime-testsuite
echo "running maven tests..."
if [ $GROUP == "LEXER" ]; then
mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LexerTests" -Dtest=cpp.* test
elif [ $GROUP == "PARSER" ]; then
mvn -q -Dgroups="org.antlr.v4.test.runtime.category.ParserTests" -Dtest=cpp.* test
elif [ $GROUP == "RECURSION" ]; then
mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LeftRecursionTests" -Dtest=cpp.* test
else
mvn -q -Dtest=cpp.* test
fi
mvn -Dparallel=classes -DthreadCount=4 -Dtest=cpp.** test
popd

3 changes: 1 addition & 2 deletions .circleci/scripts/run-tests-dart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ dart --version

pushd runtime-testsuite
echo "running maven tests..."
# mvn -q -Dparallel=classes -DthreadCount=4 -Dtest=dart.* test
mvn -q -Dtest=dart.* test
mvn -Dparallel=classes -DthreadCount=4 -Dtest=dart.** test
popd
13 changes: 2 additions & 11 deletions .circleci/scripts/run-tests-dotnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@

set -euo pipefail

pushd runtime-testsuite/
echo "running maven tests..."
if [ $GROUP == "LEXER" ]; then
mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LexerTests" -Dtest=csharp.* test
elif [ $GROUP == "PARSER" ]; then
mvn -q -Dgroups="org.antlr.v4.test.runtime.category.ParserTests" -Dtest=csharp.* test
elif [ $GROUP == "RECURSION" ]; then
mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LeftRecursionTests" -Dtest=csharp.* test
else
mvn -q -Dtest=csharp.* test
fi
pushd runtime-testsuite
mvn -Dparallel=classes -DthreadCount=4 -Dtest=csharp.** test
popd
4 changes: 2 additions & 2 deletions .circleci/scripts/run-tests-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ go version

pushd runtime-testsuite
echo "running maven tests..."
mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=go.* test
popd
mvn -Dparallel=classes -DthreadCount=4 -Dtest=go.** test
popd
4 changes: 2 additions & 2 deletions .circleci/scripts/run-tests-javascript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ popd
pushd runtime-testsuite

echo "running maven tests..."
mvn -q -Dtest=javascript.* test
mvn -Dtest=javascript.** test
RESULT+=$?

popd

exit $RESULT
exit $RESULT
2 changes: 1 addition & 1 deletion .circleci/scripts/run-tests-php.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ php -v
php_path=$(which php)
pushd runtime-testsuite
echo "running maven tests..."
mvn -q -DPHP_PATH="${php_path}" -Dparallel=methods -DthreadCount=4 -Dtest=php.* test
mvn -DPHP_PATH="${php_path}" -Dparallel=classes -DthreadCount=4 -Dtest=php.** test
popd
4 changes: 2 additions & 2 deletions .circleci/scripts/run-tests-python2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ popd
if [ $rc == 0 ]; then
pushd runtime-testsuite
echo "running maven tests..."
mvn -q -Dtest=python2.* test
mvn -Dparallel=classes -DthreadCount=4 -Dtest=python2.** test
rc=$?
popd
fi

# return $rc
# return $rc
4 changes: 2 additions & 2 deletions .circleci/scripts/run-tests-python3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ popd
if [ $rc == 0 ]; then
pushd runtime-testsuite
echo "running maven tests..."
mvn -q -Dtest=python3.* test
mvn -Dparallel=classes -DthreadCount=4 -Dtest=python3.** test
rc=$?
popd
fi

# return $rc
# return $rc
13 changes: 4 additions & 9 deletions .circleci/scripts/run-tests-swift.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

# Appears to be unused

set -euo pipefail

pushd runtime/Swift
Expand All @@ -11,17 +13,10 @@ pushd runtime/Swift
fi
popd


if [ $rc == 0 ]; then
pushd runtime-testsuite
echo "running maven tests..."
if [ $GROUP == "LEXER" ]; then
mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LexerTests" -Dtest=swift.* test
elif [ $GROUP == "PARSER" ]; then
mvn -q -Dgroups="org.antlr.v4.test.runtime.category.ParserTests" -Dtest=swift.* test
elif [ $GROUP == "RECURSION" ]; then
mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LeftRecursionTests" -Dtest=swift.* test
else
mvn -q -Dtest=swift.* test
fi
mvn -Dparallel=classes -DthreadCount=4 -Dtest=swift.** test
popd
fi
20 changes: 20 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
# This section defines defaults for all languages. Currently we derive ANTLR style from LLVM.
BasedOnStyle: LLVM
# Only use clang-format for C++ for now.
DisableFormat: true

---
# This section configures C++ formatting.
Language: Cpp
DisableFormat: false
Standard: c++17
# Prevent clang-format from attempting to pick the alignment and always use right alignment.
DerivePointerAlignment: false
# ANTLR existing style is to right align pointers and references.
PointerAlignment: Right
ReferenceAlignment: Right
# Some of ANTLR existing code is longer than the default 80, so use 100 for now.
ColumnLimit: 100
# Historically ANTLR has used indentation within namespaces, so replicate it.
NamespaceIndentation: Inner
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab
ij_java_else_on_new_line = true
14 changes: 3 additions & 11 deletions .github/scripts/run-tests-cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@

set -euo pipefail

cd runtime-testsuite/

if [ $GROUP == "LEXER" ]; then
mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LexerTests" -Dtest=cpp.* test
elif [ $GROUP == "PARSER" ]; then
mvn -q -Dgroups="org.antlr.v4.test.runtime.category.ParserTests" -Dtest=cpp.* test
elif [ $GROUP == "RECURSION" ]; then
mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LeftRecursionTests" -Dtest=cpp.* test
else
mvn -q -Dtest=cpp.* test
fi
pushd runtime-testsuite
mvn -Dparallel=classes -DthreadCount=4 -Dtest=cpp.** test
popd
16 changes: 5 additions & 11 deletions .github/scripts/run-tests-dotnet.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

# Appears not to be used at moment

set -euo pipefail

export PATH=$PATH:~/.dotnet
Expand All @@ -10,14 +12,6 @@ export PATH=$PATH:~/.dotnet
dotnet build -c Release -f netstandard2.0 runtime/CSharp/Antlr4.csproj

# run tests
cd runtime-testsuite/

if [ $GROUP == "LEXER" ]; then
mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LexerTests" -Dtest=csharp.* test
elif [ $GROUP == "PARSER" ]; then
mvn -q -Dgroups="org.antlr.v4.test.runtime.category.ParserTests" -Dtest=csharp.* test
elif [ $GROUP == "RECURSION" ]; then
mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LeftRecursionTests" -Dtest=csharp.* test
else
mvn -q -Dtest=csharp.* test
fi
pushd runtime-testsuite/
mvn -Dparallel=classes -DthreadCount=4 -Dtest=csharp.** test
popd
12 changes: 3 additions & 9 deletions .github/scripts/run-tests-swift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,9 @@ popd
if [ $rc == 0 ]; then
# run java tests
cd runtime-testsuite/
if [ $GROUP == "LEXER" ]; then
mvn -e -q -Dgroups="org.antlr.v4.test.runtime.category.LexerTests" -Dtest="swift.*" test
elif [ $GROUP == "PARSER" ]; then
mvn -e -q -Dgroups="org.antlr.v4.test.runtime.category.ParserTests" -Dtest="swift.*" test
elif [ $GROUP == "RECURSION" ]; then
mvn -e -q -Dgroups="org.antlr.v4.test.runtime.category.LeftRecursionTests" -Dtest="swift.*" test
else
mvn -e -q -Dtest=swift.* test
fi
# mvn -e -Dparallel=classes -DthreadCount=4 -Dtest=swift.** test
# I don't know swift enough to make it parallel. revert to single threaded
mvn -e -Dtest=swift.** test
rc=$?
cat target/surefire-reports/*.dumpstream || true
fi
Expand Down
Loading

0 comments on commit fb8a23c

Please sign in to comment.