From 11ae69a140425df5cd2ff64dfb3694ad7f01d3b8 Mon Sep 17 00:00:00 2001 From: Richard Elkins Date: Thu, 30 Jan 2025 07:07:03 -0600 Subject: [PATCH] show_subclassing.sh --- .github/workflows/build_and_test.yml | 7 ++++++- HISTORY.md | 1 + show_subclassing.sh | 19 +++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100755 show_subclassing.sh diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index cde0db8..b74297e 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -59,4 +59,9 @@ jobs: ./src/jacotest -r 1 -j openjdk ./src/jacotest -r 2 -j openjdk ./src/jacotest -z -v -j openjdk - + + - name: Show subclassing in test cases + run: | + if [ "$RUNNER_OS" == "Linux" ]; then + ./show_subclassing.sh + fi diff --git a/HISTORY.md b/HISTORY.md index 0f45415..189c105 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -5,6 +5,7 @@ This file is a version history of jacotest amendments. Entries appear in versio | :------------: | :---: | :--- | |||| | 2025-01-30 | 3.5.5 | Updated ERROR_CATEGORIES.txt to prioritize reporting stack {under,over}flows. | +| | | Added show_subclassing.sh to gather subclassing information. | | 2025-01-21 | 3.5.4 | Added more functions to test case atomic-integer. | | 2025-01-16 | 3.5.3 | New test case: blocking-queues-2-3-5. | | 2025-01-09 | 3.5.2 | New test case: iface-with-default-func. | diff --git a/show_subclassing.sh b/show_subclassing.sh new file mode 100755 index 0000000..c3b7a7c --- /dev/null +++ b/show_subclassing.sh @@ -0,0 +1,19 @@ +set -e +set pipefail +MYNAME=`basename $0` + +if [ ! -r VERSION.txt ]; then + echo '*** '$MYNAME': Wrong current directory!' + exit 86 +fi + +# Starting at ./tests, +# 1. Find all occurences of main.java and grep all "class" statements, keeping the file paths (-H) and ignoring case (-i). +# 2. From that, ignore case and throw out (-v) the "class main" statements. +# 3. From that, remove the directory prefix, yielding only the jacotest case (directory) name. +# +# 1 vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv 2 vvvvvvvvvvvvvvvvvvv 3 vvvvvvvvvvvvvvvvvvvvvv +echo +echo $MYNAME': Jacotest case files exhibiting subordinate classes (duplicate entries are possible):' 2>&1 | tee $MYNAME.log +echo 2>&1 | tee -a $MYNAME.log +find ./tests -name main.java -exec grep -iH " class " {} \; 2>&1 | grep -iv "class main" 2>&1 | sed -e "s/\.\/tests\///" 2>&1 | tee -a $MYNAME.log