From bca2536f3fb689e6e06b8351c71571f8e837f71e Mon Sep 17 00:00:00 2001 From: ericvergnaud Date: Tue, 26 Jan 2021 12:56:16 +0800 Subject: [PATCH] Circleci project setup (#3055) * Add .circleci/config.yml * setup config * use jdk8 image * Updated config.yml * Updated config.yml * Updated config.yml * more targets * Updated config.yml * update config * update config * update config * update config * update config * Updated config.yml * Updated config.yml * Updated config.yml * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update runtime version * update config * update config * python3 config * update config * align Python2 and Python3 test hierarchy * update runtime version * update config * update config * update config * update config * explore dart issue * update dart installer * update config * update dart installer * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * use sudo on circle ci * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * Fix NPE * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * update config * more consistent badges * do not parallelize tests on circle-ci --- .circleci/config.yml | 66 +++++++ .circleci/scripts/install-linux-cpp.sh | 35 ++++ .circleci/scripts/install-linux-dart.sh | 14 ++ .circleci/scripts/install-linux-dotnet.sh | 19 ++ .circleci/scripts/install-linux-go.sh | 9 + .circleci/scripts/install-linux-javascript.sh | 17 ++ .circleci/scripts/install-linux-libcurl3.sh | 24 +++ .circleci/scripts/install-linux-php.sh | 11 ++ .circleci/scripts/install-linux-python2.sh | 8 + .circleci/scripts/install-linux-python3.sh | 8 + .circleci/scripts/install-linux-swift.sh | 36 ++++ .circleci/scripts/run-tests-cpp.sh | 17 ++ .circleci/scripts/run-tests-dart.sh | 11 ++ .circleci/scripts/run-tests-dotnet.sh | 16 ++ .circleci/scripts/run-tests-go.sh | 10 + .circleci/scripts/run-tests-javascript.sh | 8 + .circleci/scripts/run-tests-php.sh | 9 + .circleci/scripts/run-tests-python2.sh | 24 +++ .circleci/scripts/run-tests-python3.sh | 24 +++ .circleci/scripts/run-tests-swift.sh | 27 +++ .travis.yml | 186 +----------------- README.md | 7 +- .../antlr/v4/test/runtime/TestContext.java | 5 + .../v4/test/runtime/cpp/BaseCppTest.java | 25 ++- .../test/runtime/csharp/BaseCSharpTest.java | 6 +- .../v4/test/runtime/dart/BaseDartTest.java | 56 +++++- .../antlr/v4/test/runtime/go/BaseGoTest.java | 18 +- .../v4/test/runtime/java/BaseJavaTest.java | 21 +- .../test/runtime/javascript/BaseNodeTest.java | 25 ++- .../v4/test/runtime/php/BasePHPTest.java | 19 +- .../test/runtime/python/BasePythonTest.java | 18 +- runtime/Python2/tests/mocks/TestLexer.py | 4 +- .../Python3/{test => tests}/TestFileStream.py | 0 .../{test => tests}/TestInputStream.py | 0 .../{test => tests}/TestIntervalSet.py | 0 .../Python3/{test => tests}/TestRecognizer.py | 0 .../TestTokenStreamRewriter.py | 0 runtime/Python3/{test => tests}/__init__.py | 0 runtime/Python3/{test => tests}/c.c | 0 runtime/Python3/{test => tests}/ctest.py | 0 runtime/Python3/{test => tests}/expr/Expr.g4 | 0 .../Python3/{test => tests}/expr/ExprLexer.py | 0 .../{test => tests}/expr/ExprParser.py | 0 .../{test => tests}/mocks/TestLexer.py | 2 +- .../Python3/{test => tests}/mocks/__init__.py | 0 .../{test => tests}/parser/__init__.py | 0 .../Python3/{test => tests}/parser/clexer.py | 0 .../Python3/{test => tests}/parser/cparser.py | 0 runtime/Python3/{test => tests}/run.py | 0 runtime/Python3/{test => tests}/xpathtest.py | 0 50 files changed, 547 insertions(+), 238 deletions(-) create mode 100644 .circleci/config.yml create mode 100755 .circleci/scripts/install-linux-cpp.sh create mode 100755 .circleci/scripts/install-linux-dart.sh create mode 100755 .circleci/scripts/install-linux-dotnet.sh create mode 100755 .circleci/scripts/install-linux-go.sh create mode 100755 .circleci/scripts/install-linux-javascript.sh create mode 100755 .circleci/scripts/install-linux-libcurl3.sh create mode 100755 .circleci/scripts/install-linux-php.sh create mode 100755 .circleci/scripts/install-linux-python2.sh create mode 100755 .circleci/scripts/install-linux-python3.sh create mode 100755 .circleci/scripts/install-linux-swift.sh create mode 100755 .circleci/scripts/run-tests-cpp.sh create mode 100755 .circleci/scripts/run-tests-dart.sh create mode 100755 .circleci/scripts/run-tests-dotnet.sh create mode 100755 .circleci/scripts/run-tests-go.sh create mode 100755 .circleci/scripts/run-tests-javascript.sh create mode 100755 .circleci/scripts/run-tests-php.sh create mode 100755 .circleci/scripts/run-tests-python2.sh create mode 100755 .circleci/scripts/run-tests-python3.sh create mode 100755 .circleci/scripts/run-tests-swift.sh rename runtime/Python3/{test => tests}/TestFileStream.py (100%) rename runtime/Python3/{test => tests}/TestInputStream.py (100%) rename runtime/Python3/{test => tests}/TestIntervalSet.py (100%) rename runtime/Python3/{test => tests}/TestRecognizer.py (100%) rename runtime/Python3/{test => tests}/TestTokenStreamRewriter.py (100%) rename runtime/Python3/{test => tests}/__init__.py (100%) rename runtime/Python3/{test => tests}/c.c (100%) rename runtime/Python3/{test => tests}/ctest.py (100%) rename runtime/Python3/{test => tests}/expr/Expr.g4 (100%) rename runtime/Python3/{test => tests}/expr/ExprLexer.py (100%) rename runtime/Python3/{test => tests}/expr/ExprParser.py (100%) rename runtime/Python3/{test => tests}/mocks/TestLexer.py (99%) rename runtime/Python3/{test => tests}/mocks/__init__.py (100%) rename runtime/Python3/{test => tests}/parser/__init__.py (100%) rename runtime/Python3/{test => tests}/parser/clexer.py (100%) rename runtime/Python3/{test => tests}/parser/cparser.py (100%) rename runtime/Python3/{test => tests}/run.py (100%) rename runtime/Python3/{test => tests}/xpathtest.py (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..0fdffd99b --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,66 @@ +version: 2.1 + +jobs: + test_tool_and_runtime_java: + docker: + - image: cimg/openjdk:8.0 + steps: + - checkout + - run: + name: build tool + command: mvn -B -V -DskipTests=true -Dmaven.javadoc.skip=true install + - run: + name: test runtime + command: | + cd runtime-testsuite + mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=java.* test + cd .. + - run: + name: test tool + command: | + cd tool-testsuite + mvn -q -Dparallel=methods -DthreadCount=4 test + cd .. + test_runtime: + parameters: + test-group: + description: The section + type: string + default: ALL + target: + description: The target + type: string + default: java + docker: + - image: cimg/openjdk:8.0 + environment: + TARGET: << parameters.target >> + GROUP: << parameters.test-group >> + steps: + - checkout + - run: + name: Install << parameters.target >> pre-requisites + command: | + f=".circleci/scripts/install-linux-<< parameters.target >>.sh"; ! [ -x "$f" ] || "$f" + - run: + name: Build ANTLR4 tool + command: mvn -B -V -DskipTests=true -Dmaven.javadoc.skip=true install + - run: + name: Test << parameters.target >> runtime + command: | + .circleci/scripts/run-tests-<< parameters.target >>.sh + +workflows: + build: + jobs: + - test_tool_and_runtime_java + - test_runtime: + matrix: + parameters: + target: [ dart, go, python2, python3, javascript ] + - test_runtime: + matrix: + parameters: +# target: [ cpp, dotnet, swift ] + target: [ cpp, dotnet ] + test-group: [ LEXER, PARSER, RECURSION ] diff --git a/.circleci/scripts/install-linux-cpp.sh b/.circleci/scripts/install-linux-cpp.sh new file mode 100755 index 000000000..8e3b003a0 --- /dev/null +++ b/.circleci/scripts/install-linux-cpp.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +set -euo pipefail + +echo "installing cpp SDK..." + +sudo apt-get update -y +sudo apt-get install -y clang +sudo apt-get install -y cmake +sudo apt-get install -y pkg-config +sudo apt-get install -y uuid-dev + +echo "done installing cpp SDK" + +clang++ --version +cmake --version + +echo "building cpp runtime..." + +pushd "runtime/Cpp/" + echo $PWD + rc=0 + if [ $rc == 0 ]; then + cmake . -DCMAKE_BUILD_TYPE=release + rc=$? + fi + if [ $rc == 0 ]; then + make -j 8 + rc=$? + fi +popd + + +echo "done building cpp runtime" + diff --git a/.circleci/scripts/install-linux-dart.sh b/.circleci/scripts/install-linux-dart.sh new file mode 100755 index 000000000..f15e29f5b --- /dev/null +++ b/.circleci/scripts/install-linux-dart.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -euo pipefail + +echo "installing dart SDK..." +sudo apt-get update +sudo apt-get install apt-transport-https +sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -' +sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list' +sudo apt-get update +sudo apt-get install dart=2.8.4-1 +export PATH="$PATH:/usr/lib/dart/bin" +echo "done installing dart SDK" +sudo apt-get install -f diff --git a/.circleci/scripts/install-linux-dotnet.sh b/.circleci/scripts/install-linux-dotnet.sh new file mode 100755 index 000000000..035ffdaf6 --- /dev/null +++ b/.circleci/scripts/install-linux-dotnet.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -euo pipefail + +echo "installing .Net SDK..." +wget https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb +sudo dpkg -i packages-microsoft-prod.deb +sudo apt-get update; \ + sudo apt-get install -y apt-transport-https && \ + sudo apt-get update && \ + sudo apt-get install -y dotnet-sdk-3.1 +export PATH=$PATH:~/.dotnet +echo "done installing .Net SDK" + +# we need to build the runtime before test run, since we used "--no-dependencies" +# when we call dotnet cli for restore and build, in order to speed up +echo "building runtime..." +dotnet build -c Release -f netstandard2.0 runtime/CSharp/Antlr4.csproj +echo "done building runtime" diff --git a/.circleci/scripts/install-linux-go.sh b/.circleci/scripts/install-linux-go.sh new file mode 100755 index 000000000..363e09095 --- /dev/null +++ b/.circleci/scripts/install-linux-go.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -euo pipefail + +echo "installing go SDK..." +sudo apt update +sudo apt install golang-go +go version +echo "done installing go SDK" \ No newline at end of file diff --git a/.circleci/scripts/install-linux-javascript.sh b/.circleci/scripts/install-linux-javascript.sh new file mode 100755 index 000000000..1ecc3a437 --- /dev/null +++ b/.circleci/scripts/install-linux-javascript.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -euo pipefail + +# use v14 and check +echo "installing nodejs..." +curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - +sudo apt-get install -y nodejs +echo node version: $(node --version) +echo "done installing nodejs..." + +echo "packaging javascript runtime..." +pushd runtime/JavaScript + sudo npm install + sudo npm link +popd +echo "done packaging javascript runtime" diff --git a/.circleci/scripts/install-linux-libcurl3.sh b/.circleci/scripts/install-linux-libcurl3.sh new file mode 100755 index 000000000..6fe59bafa --- /dev/null +++ b/.circleci/scripts/install-linux-libcurl3.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +echo "before patching" +ls -all /lib/x86_64-linux-gnu/ | grep libcurl + +# This would fix missing CURL_OPENSSL_3 +# use a dedicated temp dir in the user space +mkdir ~/libcurl3 +cd ~/libcurl3 +# fetch latest libcurl3 +wget http://archive.ubuntu.com/ubuntu/pool/main/c/curl/libcurl3_7.47.0-1ubuntu2_amd64.deb +# extract data.tar.xz +ar x libcurl3* data.tar.xz +# extract all from data.tar.xz +tar xf data.tar.xz +# copy libcurl.so.3 where required +sudo cp -L ~/libcurl3/usr/lib/x86_64-linux-gnu/libcurl.so.4.4.0 /lib/x86_64-linux-gnu/libcurl.so.4.4.0 +sudo ln -sf libcurl.so.4.4.0 /lib/x86_64-linux-gnu/libcurl.so.4 +cd .. +# drop dedicated temp dir +sudo rm -rf ~/libcurl3 + +echo "after patching" +ls -all /lib/x86_64-linux-gnu/ | grep libcurl diff --git a/.circleci/scripts/install-linux-php.sh b/.circleci/scripts/install-linux-php.sh new file mode 100755 index 000000000..09028e5b8 --- /dev/null +++ b/.circleci/scripts/install-linux-php.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -euo pipefail + +sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF +sudo apt-get update -qq + +php -v + +git clone https://github.com/antlr/antlr-php-runtime.git +mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V \ No newline at end of file diff --git a/.circleci/scripts/install-linux-python2.sh b/.circleci/scripts/install-linux-python2.sh new file mode 100755 index 000000000..5549c1b9c --- /dev/null +++ b/.circleci/scripts/install-linux-python2.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -euo pipefail + +echo "installing python 2..." +sudo apt-get update -y +sudo apt-get install python2 +echo "done installing python 2" diff --git a/.circleci/scripts/install-linux-python3.sh b/.circleci/scripts/install-linux-python3.sh new file mode 100755 index 000000000..4c90f519c --- /dev/null +++ b/.circleci/scripts/install-linux-python3.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -euo pipefail + +echo "installing python 3..." +sudo apt-get update -y +sudo apt-get install python3 +echo "done installing python 3" diff --git a/.circleci/scripts/install-linux-swift.sh b/.circleci/scripts/install-linux-swift.sh new file mode 100755 index 000000000..739017565 --- /dev/null +++ b/.circleci/scripts/install-linux-swift.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +set -euo pipefail + +echo "installing swift SDK..." + +.circleci/scripts/install-linux-libcurl3.sh + +# see https://tecadmin.net/install-swift-ubuntu-1604-xenial/ +sudo apt-get update -y +sudo apt-get install clang libicu-dev +sudo apt-get install libpython2.7 libpython2.7-dev + +export SWIFT_VERSION=swift-5.3.2 +echo "installing gpg key..." +wget -q -O - https://swift.org/keys/all-keys.asc | sudo gpg --import - +echo "downloading SDK gpg key..." +SWIFT_SDK=https://swift.org/builds/$SWIFT_VERSION-release/ubuntu1604/$SWIFT_VERSION-RELEASE/$SWIFT_VERSION-RELEASE-ubuntu16.04.tar.gz +echo $SWIFT_SDK +wget -q $SWIFT_SDK +sudo tar xzf $SWIFT_VERSION-RELEASE-ubuntu16.04.tar.gz +mv $SWIFT_VERSION-RELEASE-ubuntu16.04 $PWD/swift + +export SWIFT_HOME=$PWD/swift/$SWIFT_VERSION-RELEASE-ubuntu16.04/usr/bin/ +export PATH=$PWD/swift/usr/bin:$PATH + +# This would fix a know linker issue mentioned in: # https://bugs.swift.org/browse/SR-2299 +sudo ln -sf ld.gold /usr/bin/ld +# This would fix missing libtinfo.so.5 +sudo apt install libncurses5 + +echo "done installing swift SDK..." + +# check swift +swift --version +swift build --version diff --git a/.circleci/scripts/run-tests-cpp.sh b/.circleci/scripts/run-tests-cpp.sh new file mode 100755 index 000000000..0913a82d8 --- /dev/null +++ b/.circleci/scripts/run-tests-cpp.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +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 +popd + diff --git a/.circleci/scripts/run-tests-dart.sh b/.circleci/scripts/run-tests-dart.sh new file mode 100755 index 000000000..89ccc37af --- /dev/null +++ b/.circleci/scripts/run-tests-dart.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -euo pipefail + +dart --version + +pushd runtime-testsuite + echo "running maven tests..." +# mvn -q -Dparallel=classes -DthreadCount=4 -Dtest=dart.* test + mvn -q -Dtest=dart.* test +popd diff --git a/.circleci/scripts/run-tests-dotnet.sh b/.circleci/scripts/run-tests-dotnet.sh new file mode 100755 index 000000000..5af345c42 --- /dev/null +++ b/.circleci/scripts/run-tests-dotnet.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +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 +popd diff --git a/.circleci/scripts/run-tests-go.sh b/.circleci/scripts/run-tests-go.sh new file mode 100755 index 000000000..3c29def4d --- /dev/null +++ b/.circleci/scripts/run-tests-go.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -euo pipefail + +go version + +pushd runtime-testsuite + echo "running maven tests..." + mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=go.* test +popd \ No newline at end of file diff --git a/.circleci/scripts/run-tests-javascript.sh b/.circleci/scripts/run-tests-javascript.sh new file mode 100755 index 000000000..b2390d468 --- /dev/null +++ b/.circleci/scripts/run-tests-javascript.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -euo pipefail + +pushd runtime-testsuite + echo "running maven tests..." + mvn -q -Dtest=javascript.* test +popd \ No newline at end of file diff --git a/.circleci/scripts/run-tests-php.sh b/.circleci/scripts/run-tests-php.sh new file mode 100755 index 000000000..853efbd86 --- /dev/null +++ b/.circleci/scripts/run-tests-php.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -euo pipefail + +php_path=$(which php) + +composer install -d ../runtime/PHP + +mvn -q -DPHP_PATH="${php_path}" -Dparallel=methods -DthreadCount=4 -Dtest=php.* test diff --git a/.circleci/scripts/run-tests-python2.sh b/.circleci/scripts/run-tests-python2.sh new file mode 100755 index 000000000..9b65b302e --- /dev/null +++ b/.circleci/scripts/run-tests-python2.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -euo pipefail + +python2 --version + +pushd runtime/Python2/tests + echo "running native tests..." + python2 run.py + rc=$? + if [ $rc != 0 ]; then + echo "failed running native tests" + fi +popd + +if [ $rc == 0 ]; then + pushd runtime-testsuite + echo "running maven tests..." + mvn -q -Dtest=python2.* test + rc=$? + popd +fi + +# return $rc \ No newline at end of file diff --git a/.circleci/scripts/run-tests-python3.sh b/.circleci/scripts/run-tests-python3.sh new file mode 100755 index 000000000..11290cccb --- /dev/null +++ b/.circleci/scripts/run-tests-python3.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -euo pipefail + +python3 --version + +pushd runtime/Python3/tests + echo "running native tests..." + python3 run.py + rc=$? + if [ $rc != 0 ]; then + echo "failed running native tests" + fi +popd + +if [ $rc == 0 ]; then + pushd runtime-testsuite + echo "running maven tests..." + mvn -q -Dtest=python3.* test + rc=$? + popd +fi + +# return $rc \ No newline at end of file diff --git a/.circleci/scripts/run-tests-swift.sh b/.circleci/scripts/run-tests-swift.sh new file mode 100755 index 000000000..c773b6492 --- /dev/null +++ b/.circleci/scripts/run-tests-swift.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +set -euo pipefail + +pushd runtime/Swift + echo "running native tests..." + ./boot.py --test + rc=$? + if [ $rc != 0 ]; then + echo "failed running native tests" + 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 + popd +fi diff --git a/.travis.yml b/.travis.yml index ca525bd4c..33db1610d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,105 +12,12 @@ cache: - $HOME/Library/Caches/Homebrew stages: - - smoke-test - - main-test +# - smoke-test +# - main-test - extended-test matrix: include: - - os: linux - dist: focal - compiler: clang - jdk: openjdk11 - env: - - TARGET=cpp - - CXX=g++-10 - - GROUP=LEXER - stage: main-test - addons: - apt: - sources: - - sourceline: 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-10 main' - packages: - - g++-10 - - uuid-dev - - clang-10 - - os: linux - dist: focal - compiler: clang - jdk: openjdk11 - env: - - TARGET=cpp - - CXX=g++-10 - - GROUP=PARSER - stage: main-test - addons: - apt: - sources: - - sourceline: 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-10 main' - packages: - - g++-10 - - uuid-dev - - clang-10 - - os: linux - dist: focal - compiler: clang - jdk: openjdk11 - env: - - TARGET=cpp - - CXX=g++-10 - - GROUP=RECURSION - stage: main-test - addons: - apt: - sources: - - sourceline: 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-10 main' - packages: - - g++-10 - - uuid-dev - - clang-10 - - os: osx - compiler: clang - osx_image: xcode10.2 - env: - - TARGET=cpp - - GROUP=LEXER - stage: extended-test - - os: osx - compiler: clang - osx_image: xcode10.2 - env: - - TARGET=cpp - - GROUP=PARSER - stage: extended-test - - os: osx - compiler: clang - osx_image: xcode10.2 - env: - - TARGET=cpp - - GROUP=RECURSION - stage: extended-test - - os: osx - compiler: clang - osx_image: xcode10.2 - env: - - TARGET=swift - - GROUP=LEXER - stage: main-test - - os: osx - compiler: clang - osx_image: xcode10.2 - env: - - TARGET=swift - - GROUP=PARSER - stage: main-test - - os: osx - compiler: clang - osx_image: xcode10.2 - env: - - TARGET=swift - - GROUP=RECURSION - stage: main-test - os: linux dist: xenial compiler: clang @@ -118,95 +25,6 @@ matrix: - TARGET=swift - GROUP=ALL stage: extended-test - - os: osx - osx_image: xcode10.2 - env: - - TARGET=dotnet - - GROUP=LEXER - stage: extended-test - - os: osx - osx_image: xcode10.2 - env: - - TARGET=dotnet - - GROUP=PARSER - stage: extended-test - - os: osx - osx_image: xcode10.2 - env: - - TARGET=dotnet - - GROUP=RECURSION - stage: extended-test - - os: linux - dist: trusty - jdk: openjdk7 - env: TARGET=java - stage: extended-test - - os: linux - jdk: openjdk8 - env: TARGET=java - stage: smoke-test - - os: linux - jdk: openjdk8 - env: - - TARGET=dotnet - - GROUP=MAIN - stage: main-test - - os: linux - jdk: openjdk8 - env: TARGET=dart - stage: main-test - - os: linux - language: php - php: - - 7.2 - jdk: openjdk8 - env: TARGET=php - stage: main-test - - os: linux - jdk: openjdk8 - env: - - TARGET=dotnet - - GROUP=LEXER - stage: extended-test - - os: linux - jdk: openjdk8 - env: - - TARGET=dotnet - - GROUP=PARSER - stage: extended-test - - os: linux - jdk: openjdk8 - env: - - TARGET=dotnet - - GROUP=RECURSION - stage: extended-test - - os: linux - jdk: openjdk8 - env: TARGET=python2 - stage: main-test - - os: linux - jdk: openjdk8 - env: TARGET=python3 - addons: - apt: - sources: - - deadsnakes # source required so it finds the package definition below - packages: - - python3.7 - stage: main-test - - os: linux - dist: trusty - jdk: openjdk8 - env: TARGET=javascript - stage: main-test - before_install: - - nvm install 14 # otherwise it runs by default on node 8 - - f="./.travis/before-install-linux-javascript.sh"; ! [ -x "$f" ] || "$f" - - os: linux - dist: trusty - jdk: openjdk8 - env: TARGET=go - stage: main-test before_install: - f="./.travis/before-install-$TRAVIS_OS_NAME-$TARGET.sh"; ! [ -x "$f" ] || "$f" diff --git a/README.md b/README.md index cd9d7c2ee..72462f557 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,11 @@ # ANTLR v4 -[![Github Build Status (MacOSX)](https://github.com/antlr/antlr4/workflows/MacOSX/badge.svg)](https://github.com/antlr/antlr4/actions) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/5acpbx1pg7bhgh8v/branch/master?svg=true)](https://ci.appveyor.com/project/parrt/antlr4) [![Java 7+](https://img.shields.io/badge/java-7+-4c7e9f.svg)](http://java.oracle.com) [![License](https://img.shields.io/badge/license-BSD-blue.svg)](https://raw.githubusercontent.com/antlr/antlr4/master/LICENSE.txt) +[![Github CI Build Status (MacOSX)](https://img.shields.io/github/workflow/status/antlr/antlr4/MacOSX?label=MacOSX)](https://github.com/antlr/antlr4/actions) +[![AppVeyor CI Build Status (Windows)](https://img.shields.io/appveyor/build/parrt/antlr4?label=Windows)](https://ci.appveyor.com/project/parrt/antlr4) +[![Circle CI Build Status (Linux)](https://img.shields.io/circleci/build/gh/antlr/antlr4/master?label=Linux)](https://app.circleci.com/pipelines/github/antlr/antlr4) +[![Travis-CI Build Status (Swift-Linux)](https://img.shields.io/travis/antlr/antlr4.svg?label=Linux-Swift&branch=master)](https://travis-ci.org/antlr/antlr4) +[![Java 7+](https://img.shields.io/badge/java-7+-4c7e9f.svg)](http://java.oracle.com) +[![License](https://img.shields.io/badge/license-BSD-blue.svg)](https://raw.githubusercontent.com/antlr/antlr4/master/LICENSE.txt) **ANTLR** (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files. It's widely used to build languages, tools, and frameworks. From a grammar, ANTLR generates a parser that can build parse trees and also generates a listener interface (or visitor) that makes it easy to respond to the recognition of phrases of interest. diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/TestContext.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/TestContext.java index bb1cb78f6..50a3d97b5 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/TestContext.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/TestContext.java @@ -10,10 +10,15 @@ public abstract class TestContext { return "true".equals(String.valueOf(System.getenv("APPVEYOR")).toLowerCase()); } + public static boolean isCircleCI() { + return "true".equals(String.valueOf(System.getenv("CIRCLECI")).toLowerCase()); + } + public static boolean isSupportedTarget(String target) { if(isAppVeyorCI()) return !target.matches("Swift|Node"); else return true; } + } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/BaseCppTest.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/BaseCppTest.java index d8c70ca23..780c64839 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/BaseCppTest.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/BaseCppTest.java @@ -534,7 +534,7 @@ public class BaseCppTest implements RuntimeTestSupport { } private String runProcess(ProcessBuilder builder, String description, boolean showStderr) throws Exception { -// System.out.println("BUILDER: "+builder.command()); + System.out.println("BUILDER: " + builder.command() + " @ " + builder.directory().toString()); Process process = builder.start(); StreamVacuum stdoutVacuum = new StreamVacuum(process.getInputStream()); StreamVacuum stderrVacuum = new StreamVacuum(process.getErrorStream()); @@ -712,7 +712,7 @@ public class BaseCppTest implements RuntimeTestSupport { p = Paths.get(runtimeURL.toURI()).toFile().toString(); } catch (URISyntaxException use) { - p = "Can't find runtime"; + p = "Can't find runtime at " + runtimeURL.toString(); } return p; } @@ -987,20 +987,26 @@ public class BaseCppTest implements RuntimeTestSupport { @Override public void eraseTempDir() { - boolean doErase = true; - String propName = getPropertyPrefix() + "-erase-test-dir"; - String prop = System.getProperty(propName); - if(prop!=null && prop.length()>0) - doErase = Boolean.getBoolean(prop); - if(doErase) { + if (shouldEraseTempDir()) { File tmpdirF = new File(tmpdir); - if ( tmpdirF.exists() ) { + if (tmpdirF.exists()) { eraseFiles(tmpdirF); tmpdirF.delete(); } } } + private boolean shouldEraseTempDir() { + if(tmpdir==null) + return false; + String propName = getPropertyPrefix() + "-erase-test-dir"; + String prop = System.getProperty(propName); + if (prop != null && prop.length() > 0) + return Boolean.getBoolean(prop); + else + return true; + } + public String getFirstLineOfException() { if ( this.stderrDuringParse ==null ) { return null; @@ -1152,3 +1158,4 @@ public class BaseCppTest implements RuntimeTestSupport { return dup; } } + diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/BaseCSharpTest.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/BaseCSharpTest.java index 923b34298..2cd12d015 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/BaseCSharpTest.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/BaseCSharpTest.java @@ -581,7 +581,7 @@ public class BaseCSharpTest implements RuntimeTestSupport { @Override public void eraseTempDir() { - if (!PRESERVE_TEST_DIR) { + if (shouldEraseTempDir()) { File tmpdirF = new File(tmpdir); if (tmpdirF.exists()) { eraseDirectory(tmpdirF); @@ -590,6 +590,10 @@ public class BaseCSharpTest implements RuntimeTestSupport { } } + private boolean shouldEraseTempDir() { + return tmpdir!=null && !PRESERVE_TEST_DIR; + } + /** * Return map sorted by key */ diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/BaseDartTest.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/BaseDartTest.java index fd4da1cfb..5bedebde2 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/BaseDartTest.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/BaseDartTest.java @@ -560,10 +560,22 @@ public class BaseDartTest implements RuntimeTestSupport { " path: " + runtime + "\n"); if (cacheDartPackages == null) { try { - Process process = Runtime.getRuntime().exec(new String[]{locatePub(), "get"}, null, new File(tmpdir)); + final Process process = Runtime.getRuntime().exec(new String[]{locatePub(), "get"}, null, new File(tmpdir)); StreamVacuum stderrVacuum = new StreamVacuum(process.getErrorStream()); stderrVacuum.start(); + Timer timer = new Timer(); + timer.schedule(new TimerTask() { + @Override + public void run() { + try { + process.destroy(); + } catch(Exception e) { + e.printStackTrace(System.err); + } + } + }, 30_000); process.waitFor(); + timer.cancel(); stderrVacuum.join(); String stderrDuringPubGet = stderrVacuum.toString(); if (!stderrDuringPubGet.isEmpty()) { @@ -609,11 +621,23 @@ public class BaseDartTest implements RuntimeTestSupport { }; String cmdLine = Utils.join(args, " "); System.err.println("Compile: " + cmdLine); - Process process = + final Process process = Runtime.getRuntime().exec(args, null, new File(tmpdir)); StreamVacuum stderrVacuum = new StreamVacuum(process.getErrorStream()); stderrVacuum.start(); + Timer timer = new Timer(); + timer.schedule(new TimerTask() { + @Override + public void run() { + try { + process.destroy(); + } catch(Exception e) { + e.printStackTrace(System.err); + } + } + }, 30_000); int result = process.waitFor(); + timer.cancel(); if (result != 0) { stderrVacuum.join(); System.err.print("Error compiling dart file: " + stderrVacuum.toString()); @@ -633,13 +657,25 @@ public class BaseDartTest implements RuntimeTestSupport { } //String cmdLine = Utils.join(args, " "); //System.err.println("execParser: " + cmdLine); - Process process = + final Process process = Runtime.getRuntime().exec(args, null, new File(tmpdir)); StreamVacuum stdoutVacuum = new StreamVacuum(process.getInputStream()); StreamVacuum stderrVacuum = new StreamVacuum(process.getErrorStream()); stdoutVacuum.start(); stderrVacuum.start(); + Timer timer = new Timer(); + timer.schedule(new TimerTask() { + @Override + public void run() { + try { + process.destroy(); + } catch(Exception e) { + e.printStackTrace(System.err); + } + } + }, 30_000); process.waitFor(); + timer.cancel(); stdoutVacuum.join(); stderrVacuum.join(); String output = stdoutVacuum.toString(); @@ -1031,13 +1067,19 @@ public class BaseDartTest implements RuntimeTestSupport { @Override public void eraseTempDir() { - File tmpdirF = new File(tmpdir); - if (tmpdirF.exists()) { - eraseFiles(); - tmpdirF.delete(); + if(shouldEraseTempDir()) { + File tmpdirF = new File(tmpdir); + if (tmpdirF.exists()) { + eraseFiles(); + tmpdirF.delete(); + } } } + private boolean shouldEraseTempDir() { + return tmpdir!=null; + } + public String getFirstLineOfException() { if (this.stderrDuringParse == null) { return null; diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/BaseGoTest.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/BaseGoTest.java index 0226d5023..1696d5307 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/BaseGoTest.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/BaseGoTest.java @@ -821,18 +821,24 @@ public class BaseGoTest implements RuntimeTestSupport { } public void eraseTempDir() { - boolean doErase = true; - String propName = "antlr-go-erase-test-dir"; - String prop = System.getProperty(propName); - if (prop != null && prop.length() > 0) - doErase = Boolean.getBoolean(prop); - if (doErase) { + if (shouldEraseTempDir()) { if ( overall_tmpdir.exists()) { eraseDirectory(overall_tmpdir); } } } + private boolean shouldEraseTempDir() { + if(overall_tmpdir==null) + return false; + String propName = "antlr-go-erase-test-dir"; + String prop = System.getProperty(propName); + if (prop != null && prop.length() > 0) + return Boolean.getBoolean(prop); + else + return true; + } + public String getFirstLineOfException() { if (this.stderrDuringParse == null) { return null; diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/BaseJavaTest.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/BaseJavaTest.java index d142d1df3..606cdede2 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/BaseJavaTest.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/BaseJavaTest.java @@ -1032,6 +1032,9 @@ public class BaseJavaTest implements RuntimeTestSupport { protected void eraseFiles(final String filesEndingWith) { + if (tmpdir == null) { + return; + } File tmpdirF = new File(tmpdir); String[] files = tmpdirF.list(); for(int i = 0; files!=null && i < files.length; i++) { @@ -1045,7 +1048,6 @@ public class BaseJavaTest implements RuntimeTestSupport { if (tmpdir == null) { return; } - File tmpdirF = new File(tmpdir); String[] files = tmpdirF.list(); for(int i = 0; files!=null && i < files.length; i++) { @@ -1054,13 +1056,20 @@ public class BaseJavaTest implements RuntimeTestSupport { } public void eraseTempDir() { - File tmpdirF = new File(tmpdir); - if ( tmpdirF.exists() ) { - eraseFiles(); - tmpdirF.delete(); - } + if (shouldEraseTempDir()) { + File tmpdirF = new File(tmpdir); + if (tmpdirF.exists()) { + eraseFiles(); + tmpdirF.delete(); + } + } } + private boolean shouldEraseTempDir() { + return tmpdir != null; + } + + public String getFirstLineOfException() { if ( this.stderrDuringParse ==null ) { return null; diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/BaseNodeTest.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/BaseNodeTest.java index 65fb05aba..99b063158 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/BaseNodeTest.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/BaseNodeTest.java @@ -251,7 +251,7 @@ public class BaseNodeTest implements RuntimeTestSupport { public String execModule(String fileName) { try { String npmPath = locateNpm(); - if(!TestContext.isTravisCI()) { + if(!TestContext.isTravisCI() && !TestContext.isCircleCI()) { installRuntime(npmPath); registerRuntime(npmPath); } @@ -327,7 +327,11 @@ public class BaseNodeTest implements RuntimeTestSupport { } private void linkRuntime(String npmPath) throws IOException, InterruptedException { - ProcessBuilder builder = new ProcessBuilder(npmPath, "link", "antlr4"); + List args = new ArrayList<>(); + if(TestContext.isCircleCI()) + args.add("sudo"); + args.addAll(Arrays.asList(npmPath, "link", "antlr4")); + ProcessBuilder builder = new ProcessBuilder(args.toArray(new String[0])); builder.directory(new File(tmpdir)); builder.redirectError(new File(tmpdir, "error.txt")); builder.redirectOutput(new File(tmpdir, "output.txt")); @@ -479,12 +483,7 @@ public class BaseNodeTest implements RuntimeTestSupport { @Override public void eraseTempDir() { - boolean doErase = true; - String propName = "antlr-javascript-erase-test-dir"; - String prop = System.getProperty(propName); - if (prop != null && prop.length() > 0) - doErase = Boolean.getBoolean(prop); - if (doErase) { + if (shouldEraseTempDir()) { File tmpdirF = new File(tmpdir); if (tmpdirF.exists()) { eraseFiles(tmpdirF); @@ -493,6 +492,16 @@ public class BaseNodeTest implements RuntimeTestSupport { } } + private boolean shouldEraseTempDir() { + if(tmpdir==null) + return false; + String propName = "antlr-javascript-erase-test-dir"; + String prop = System.getProperty(propName); + if (prop != null && prop.length() > 0) + return Boolean.getBoolean(prop); + else + return true; + } /** Sort a list */ public > List sort(List data) { diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/BasePHPTest.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/BasePHPTest.java index 89d9d081f..deef63287 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/BasePHPTest.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/BasePHPTest.java @@ -581,13 +581,7 @@ public class BasePHPTest implements RuntimeTestSupport { @Override public void eraseTempDir() { - boolean doErase = true; - String propName = getPropertyPrefix() + "-erase-test-dir"; - String prop = System.getProperty(propName); - if (prop != null && prop.length() > 0) { - doErase = Boolean.getBoolean(prop); - } - if (doErase) { + if (shouldEraseTempDir()) { File tmpdirF = new File(tmpdir); if (tmpdirF.exists()) { eraseFiles(tmpdirF); @@ -596,6 +590,17 @@ public class BasePHPTest implements RuntimeTestSupport { } } + private boolean shouldEraseTempDir() { + if(tmpdir==null) + return false; + String propName = getPropertyPrefix() + "-erase-test-dir"; + String prop = System.getProperty(propName); + if (prop != null && prop.length() > 0) + return Boolean.getBoolean(prop); + else + return true; + } + /** * Sort a list */ diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python/BasePythonTest.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python/BasePythonTest.java index c8461ac9c..a3ea85b1b 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python/BasePythonTest.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python/BasePythonTest.java @@ -793,12 +793,7 @@ public abstract class BasePythonTest implements RuntimeTestSupport { @Override public void eraseTempDir() { - boolean doErase = true; - String propName = getPropertyPrefix() + "-erase-test-dir"; - String prop = System.getProperty(propName); - if(prop!=null && prop.length()>0) - doErase = Boolean.getBoolean(prop); - if(doErase) { + if(shouldEraseTempDir()) { File tmpdirF = new File(tmpdir); if ( tmpdirF.exists() ) { eraseFiles(tmpdirF); @@ -807,6 +802,17 @@ public abstract class BasePythonTest implements RuntimeTestSupport { } } + private boolean shouldEraseTempDir() { + if(tmpdir==null) + return false; + String propName = getPropertyPrefix() + "-erase-test-dir"; + String prop = System.getProperty(propName); + if (prop != null && prop.length() > 0) + return Boolean.getBoolean(prop); + else + return true; + } + protected void eraseTempPyCache() { File tmpdirF = new File(tmpdir+"/__pycache__"); if ( tmpdirF.exists() ) { diff --git a/runtime/Python2/tests/mocks/TestLexer.py b/runtime/Python2/tests/mocks/TestLexer.py index 27894ddc4..89c438b63 100644 --- a/runtime/Python2/tests/mocks/TestLexer.py +++ b/runtime/Python2/tests/mocks/TestLexer.py @@ -39,7 +39,7 @@ class TestLexer(Lexer): def __init__(self, input=None): super(TestLexer, self).__init__(input) - self.checkVersion("4.9") + self.checkVersion("4.9.1") self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache()) self._actions = None self._predicates = None @@ -95,7 +95,7 @@ class TestLexer2(Lexer): def __init__(self, input=None): super(TestLexer2, self).__init__(input) - self.checkVersion("4.8") + self.checkVersion("4.9.1") self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache()) self._actions = None self._predicates = None diff --git a/runtime/Python3/test/TestFileStream.py b/runtime/Python3/tests/TestFileStream.py similarity index 100% rename from runtime/Python3/test/TestFileStream.py rename to runtime/Python3/tests/TestFileStream.py diff --git a/runtime/Python3/test/TestInputStream.py b/runtime/Python3/tests/TestInputStream.py similarity index 100% rename from runtime/Python3/test/TestInputStream.py rename to runtime/Python3/tests/TestInputStream.py diff --git a/runtime/Python3/test/TestIntervalSet.py b/runtime/Python3/tests/TestIntervalSet.py similarity index 100% rename from runtime/Python3/test/TestIntervalSet.py rename to runtime/Python3/tests/TestIntervalSet.py diff --git a/runtime/Python3/test/TestRecognizer.py b/runtime/Python3/tests/TestRecognizer.py similarity index 100% rename from runtime/Python3/test/TestRecognizer.py rename to runtime/Python3/tests/TestRecognizer.py diff --git a/runtime/Python3/test/TestTokenStreamRewriter.py b/runtime/Python3/tests/TestTokenStreamRewriter.py similarity index 100% rename from runtime/Python3/test/TestTokenStreamRewriter.py rename to runtime/Python3/tests/TestTokenStreamRewriter.py diff --git a/runtime/Python3/test/__init__.py b/runtime/Python3/tests/__init__.py similarity index 100% rename from runtime/Python3/test/__init__.py rename to runtime/Python3/tests/__init__.py diff --git a/runtime/Python3/test/c.c b/runtime/Python3/tests/c.c similarity index 100% rename from runtime/Python3/test/c.c rename to runtime/Python3/tests/c.c diff --git a/runtime/Python3/test/ctest.py b/runtime/Python3/tests/ctest.py similarity index 100% rename from runtime/Python3/test/ctest.py rename to runtime/Python3/tests/ctest.py diff --git a/runtime/Python3/test/expr/Expr.g4 b/runtime/Python3/tests/expr/Expr.g4 similarity index 100% rename from runtime/Python3/test/expr/Expr.g4 rename to runtime/Python3/tests/expr/Expr.g4 diff --git a/runtime/Python3/test/expr/ExprLexer.py b/runtime/Python3/tests/expr/ExprLexer.py similarity index 100% rename from runtime/Python3/test/expr/ExprLexer.py rename to runtime/Python3/tests/expr/ExprLexer.py diff --git a/runtime/Python3/test/expr/ExprParser.py b/runtime/Python3/tests/expr/ExprParser.py similarity index 100% rename from runtime/Python3/test/expr/ExprParser.py rename to runtime/Python3/tests/expr/ExprParser.py diff --git a/runtime/Python3/test/mocks/TestLexer.py b/runtime/Python3/tests/mocks/TestLexer.py similarity index 99% rename from runtime/Python3/test/mocks/TestLexer.py rename to runtime/Python3/tests/mocks/TestLexer.py index 27894ddc4..19a34896b 100644 --- a/runtime/Python3/test/mocks/TestLexer.py +++ b/runtime/Python3/tests/mocks/TestLexer.py @@ -95,7 +95,7 @@ class TestLexer2(Lexer): def __init__(self, input=None): super(TestLexer2, self).__init__(input) - self.checkVersion("4.8") + self.checkVersion("4.9.1") self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache()) self._actions = None self._predicates = None diff --git a/runtime/Python3/test/mocks/__init__.py b/runtime/Python3/tests/mocks/__init__.py similarity index 100% rename from runtime/Python3/test/mocks/__init__.py rename to runtime/Python3/tests/mocks/__init__.py diff --git a/runtime/Python3/test/parser/__init__.py b/runtime/Python3/tests/parser/__init__.py similarity index 100% rename from runtime/Python3/test/parser/__init__.py rename to runtime/Python3/tests/parser/__init__.py diff --git a/runtime/Python3/test/parser/clexer.py b/runtime/Python3/tests/parser/clexer.py similarity index 100% rename from runtime/Python3/test/parser/clexer.py rename to runtime/Python3/tests/parser/clexer.py diff --git a/runtime/Python3/test/parser/cparser.py b/runtime/Python3/tests/parser/cparser.py similarity index 100% rename from runtime/Python3/test/parser/cparser.py rename to runtime/Python3/tests/parser/cparser.py diff --git a/runtime/Python3/test/run.py b/runtime/Python3/tests/run.py similarity index 100% rename from runtime/Python3/test/run.py rename to runtime/Python3/tests/run.py diff --git a/runtime/Python3/test/xpathtest.py b/runtime/Python3/tests/xpathtest.py similarity index 100% rename from runtime/Python3/test/xpathtest.py rename to runtime/Python3/tests/xpathtest.py