Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add and update tests; run tests in CI #324

Merged
merged 2 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ jobs:
run: ./gradlew requireJavadoc
- name: ./gradlew spotlessCheck
run: ./gradlew spotlessCheck
- name: run-tests.sh
run: src/test/run-tests.sh
2 changes: 1 addition & 1 deletion src/test/expected.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
JavaRecords.java:5:5: missing documentation for second
JavaRecords.java:9:1: missing documentation for MyOtherRecord
JavaRecords.java:15:1: missing documentation for Undocumented
NoArgConstructor.java:8:3: missing documentation for HasArgConstructor
Expand Down Expand Up @@ -52,3 +51,4 @@ TrivialProperties.java:355:3: missing documentation for get
TrivialProperties.java:359:3: missing documentation for set
TrivialProperties.java:363:3: missing documentation for has
TrivialProperties.java:367:3: missing documentation for is
package-info.java:2:1: missing documentation for a.b.c
2 changes: 2 additions & 0 deletions src/test/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** There is a Javadoc comment here. */
package a.b.c;
2 changes: 2 additions & 0 deletions src/test/package-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// There is no Javadoc comment here.
package a.b.c;
8 changes: 5 additions & 3 deletions src/test/README → src/test/run-tests.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
Tests are not yet automated. :-(
#!/bin/sh

The diff output should be empty:
SCRIPTDIR="$(cd "$(dirname "$0")" && pwd -P)"

cd ${SCRIPTDIR}

(cd ../.. && ./gradlew assemble) && sleep .1 && java -cp ../../build/libs/require-javadoc-1.0.9-all.jar org.plumelib.javadoc.RequireJavadoc --relative --dont-require-trivial-properties --dont-require-noarg-constructor > out.txt

diff expected.txt out.txt
diff -u expected.txt out.txt