Skip to content

add some tests

add some tests #19

Workflow file for this run

name: Tests
on:
push:
paths:
- 'src/**'
- 'tests/**'
- '.github/**'
pull_request:
paths:
- 'src/**'
- 'tests/**'
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK 20
uses: actions/setup-java@v3
with:
java-version: 20
distribution: 'adopt'
- name: Install Dependencies
run: |
mkdir -p lib
curl -L -o lib/mockito-core.jar https://repo1.maven.org/maven2/org/mockito/mockito-core/3.12.4/mockito-core-3.12.4.jar
curl -L -o lib/byte-buddy.jar https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy/1.12.6/byte-buddy-1.12.6.jar
curl -L -o lib/byte-buddy-agent.jar https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy-agent/1.12.6/byte-buddy-agent-1.12.6.jar
curl -L -o lib/objenesis.jar https://repo1.maven.org/maven2/org/objenesis/objenesis/3.2/objenesis-3.2.jar
curl -L -o lib/junit-jupiter-api.jar https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-api/5.8.1/junit-jupiter-api-5.8.1.jar
curl -L -o lib/opentest4j.jar https://repo1.maven.org/maven2/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar
curl -L -o lib/junit-platform-commons.jar https://repo1.maven.org/maven2/org/junit/platform/junit-platform-commons/1.8.1/junit-platform-commons-1.8.1.jar
curl -L -o lib/apiguardian-api.jar https://repo1.maven.org/maven2/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar
curl -L -o lib/junit-jupiter-params.jar https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-params/5.8.1/junit-jupiter-params-5.8.1.jar
curl -L -o lib/junit-jupiter-engine.jar https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-engine/5.8.1/junit-jupiter-engine-5.8.1.jar
curl -L -o lib/junit-platform-engine.jar https://repo1.maven.org/maven2/org/junit/platform/junit-platform-engine/1.8.1/junit-platform-engine-1.8.1.jar
curl -L -o lib/junit-platform-launcher.jar https://repo1.maven.org/maven2/org/junit/platform/junit-platform-launcher/1.8.1/junit-platform-launcher-1.8.1.jar
curl -L -o lib/junit-platform-console-standalone.jar https://repo1.maven.org/maven2/org/junit/platform/junit-platform-console-standalone/1.8.1/junit-platform-console-standalone-1.8.1.jar
- name: Compile
run: |
# Recursively find and compile all .java files under src and tests directories
find src tests -name "*.java" > sources.txt
javac -cp "lib/*" -d . @sources.txt
- name: Run tests
run: |
java -cp ".:lib/*:**" org.junit.platform.console.ConsoleLauncher --scan-classpath --include-classname ".*Test"