Skip to content

Commit

Permalink
Add and update tests; run tests in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mernst authored Jan 30, 2025
1 parent af85032 commit b8917f0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
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

0 comments on commit b8917f0

Please sign in to comment.