Skip to content

Commit

Permalink
refining the commit tree. as some unwanted commit got into my history…
Browse files Browse the repository at this point in the history
… by rebasing
  • Loading branch information
Tahiatul Islam committed Mar 11, 2024
1 parent b33b7db commit 5ec1b2d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,4 @@ jobs:
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Run tests
run: python TestMain.py
- name: Run specimin on targets
run: python main.py
- name: Export Specimin path
run: echo "SPECIMIN=ISSUES/specimin" >> $GITHUB_ENV
- name: Compile output
run: sh check_compilation.sh
run: python TestMain.py
21 changes: 15 additions & 6 deletions check_compilation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@
# It is desirable that all of the expected Specimin's minimized program gets compiled, because Specimin
# should produce independently-compilable programs.

# when this script is invoked from specimin CI,
# compilation result will be compared with "expected" result and CI will be passed/failed accordingly.

returnval=0
compile_status_json="{"
echo "Specimin path: $SPECIMIN"
cd ISSUES || exit 1
for target in * ; do
echo "Target = ${target}"
if [ "${target}" = "output.html" ] || [ "${target}" = "target_status.json" ] || [ "${target}" = "specimin" ]; then
if [ "${target}" = "output.html" ] || [ "${target}" = "target_status.json" ] || [ "${target}" = "specimin" ] || [ "${target}" = "compile_status.json" ]; then
continue;
fi

Expand All @@ -22,16 +26,19 @@ for target in * ; do
directory_count="$(find ./ -mindepth 1 -type d | wc -l)"
if [ "$directory_count" -eq 0 ]; then
echo "No directories inside ${target}/output. Ignoring it."
compile_status_json="$compile_status_json\n \"$target\": \"FAIL\","
cd ../..
continue
fi

# javac relies on word splitting
# shellcheck disable=SC2046
javac -classpath "$SPECIMIN/main/src/test/resources/shared/checker-qual-3.42.0.jar" $(find . -name "*.java") \
&& { echo "Running javac on ${target}/output PASSES"; } \
|| { echo "Running javac on ${target}/output FAILS. Please check logs above."; returnval=2; }
&& { echo "Running javac on ${target}/output PASSES"; compile_status_json="$compile_status_json\n \"$target\": \"PASS\","; } \
|| { echo "Running javac on ${target}/output FAILS. Please check logs above."; compile_status_json="$compile_status_json\n \"$target\": \"FAIL\","; returnval=2; }

cd ../.. || exit 1

done

if [ "${returnval}" = 0 ]; then
Expand All @@ -40,6 +47,8 @@ elif [ "${returnval}" = 2 ]; then
echo "Some expected test outputs do not compile successfully. See the above error output for details."
fi

find . -name "*.class" -exec rm {} \;

exit 0 # Even though some targets do not compile, passing the CI. exit 1 still exists, which will help us debug problems other than compilation
compile_status_json="${compile_status_json%,}"
compile_status_json="$compile_status_json\n}"
rm compile_status.json
echo "$compile_status_json" > compile_status.json
find . -name "*.class" -exec rm {} \;

0 comments on commit 5ec1b2d

Please sign in to comment.