Make CI more flexible, fixed string comparator, javafx doc

This commit is contained in:
Paul Scott 2023-04-18 09:37:01 +10:00
parent 3c824e830c
commit 10d2a9b3ac
3 changed files with 18 additions and 8 deletions

View File

@ -9,8 +9,10 @@ stages:
before_script:
- export PATH_TO_FX=/usr/share/openjfx/lib
- export JAVAFX_OPTIONS="--module-path $PATH_TO_FX --add-modules javafx.controls,javafx.fxml,javafx.media"
- export CP=src:/ass2/*:/shared/junit-platform-console-standalone-1.7.0.jar:$PATH_TO_FX/*
- export JUNIT="java $JAVAFX_OPTIONS -jar /shared/junit-platform-console-standalone-1.7.0.jar --class-path src:/ass2/comp1110-ass2.jar --disable-banner"
- export CP=src:src-dev:/ass2/*:/shared/junit-platform-console-standalone-1.7.0.jar:$PATH_TO_FX/*
- export JUNIT="java $JAVAFX_OPTIONS -jar /shared/junit-platform-console-standalone-1.7.0.jar --class-path src:src-dev:/ass2/comp1110-ass2.jar --disable-banner"
- export SRC_FILES=$(find src/ -type f -name '*.java')
- export SRC_DEV_FILES=$(if [ -d "src-dev/" ]; then find src-dev/ -type f -name '*.java'; fi)
checksum:
tags:
@ -38,11 +40,11 @@ build:
- comp1110
stage: build
script:
- javac -encoding utf-8 $JAVAFX_OPTIONS -cp $CP src/comp1110/ass2/*.java src/comp1110/ass2/*/*.java
- javac -encoding utf-8 $JAVAFX_OPTIONS -cp $CP $SRC_FILES $SRC_DEV_FILES
artifacts:
paths:
- src/comp1110/ass2/*.class
- src/comp1110/ass2/*/*.class
- src/
- src-dev/
task3:
tags:

View File

@ -7,7 +7,15 @@
<NATIVE>
<root url="file://$PATH_TO_FX$" />
</NATIVE>
<SOURCES />
<SOURCES>
<root url="jar://$PATH_TO_FX$/../src.zip!/javafx.base" />
<root url="jar://$PATH_TO_FX$/../src.zip!/javafx.controls" />
<root url="jar://$PATH_TO_FX$/../src.zip!/javafx.fxml" />
<root url="jar://$PATH_TO_FX$/../src.zip!/javafx.graphics" />
<root url="jar://$PATH_TO_FX$/../src.zip!/javafx.media" />
<root url="jar://$PATH_TO_FX$/../src.zip!/javafx.swing" />
<root url="jar://$PATH_TO_FX$/../src.zip!/javafx.web" />
</SOURCES>
<jarDirectory url="file://$PATH_TO_FX$" recursive="false" />
</library>
</component>

View File

@ -133,14 +133,14 @@ public class StringComparator {
private void checkGeneralString(List<String> statementsA, List<String> statementsB, List<String> errors) {
// Check for the number of statements
if (checks.get(ResultType.General).contains("num_statements") &&
if (checks.get(ResultType.General).contains("numStatements") &&
statementsA.size() != statementsB.size())
{
errors.add("Strings contain different numbers of statements");
}
// Check if there are any unrecognised statement IDs
if (checks.get(ResultType.General).contains("unrecognised_statements"))
if (checks.get(ResultType.General).contains("unrecognisedStatements"))
{
List<String> unrecognised = statementsB
.stream()