Fixed tests

This commit is contained in:
Anuken
2026-02-24 12:19:23 -05:00
parent 769e45e65a
commit 8d16c1768e
2 changed files with 19 additions and 13 deletions

View File

@@ -396,6 +396,7 @@ project(":tests"){
testImplementation arcModule("backends:backend-headless") testImplementation arcModule("backends:backend-headless")
testImplementation "org.json:json:20230618" testImplementation "org.json:json:20230618"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.7.1" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.7.1"
testRuntimeOnly "org.junit.platform:junit-platform-launcher"
} }
tasks.withType(JavaCompile){ tasks.withType(JavaCompile){

View File

@@ -102,7 +102,7 @@ static void antialias(File file){
new Fi(file).writePng(out) new Fi(file).writePng(out)
} }
task antialiasImages(){ tasks.register('antialiasImages'){
doLast{ doLast{
for(def img : project.getProperty("images").split(",")){ for(def img : project.getProperty("images").split(",")){
println(project.getProperty("startdir") + "/" + img) println(project.getProperty("startdir") + "/" + img)
@@ -111,7 +111,7 @@ task antialiasImages(){
} }
} }
task tileImages(){ tasks.register('tileImages'){
doLast{ doLast{
for(def img : project.getProperty("images").split(",")){ for(def img : project.getProperty("images").split(",")){
println(project.getProperty("startdir") + "/" + img) println(project.getProperty("startdir") + "/" + img)
@@ -120,7 +120,8 @@ task tileImages(){
} }
} }
task pack(dependsOn: [classes, configurations.runtimeClasspath]){ tasks.register('pack'){
dependsOn = [classes, configurations.runtimeClasspath]
doLast{ doLast{
//cleanup old sprites //cleanup old sprites
@@ -189,7 +190,8 @@ task pack(dependsOn: [classes, configurations.runtimeClasspath]){
} }
} }
task genSprites(dependsOn: classes, type: JavaExec){ tasks.register('genSprites', JavaExec){
dependsOn classes
finalizedBy 'antialiasGen' finalizedBy 'antialiasGen'
mainClass = "mindustry.tools.ImagePacker" mainClass = "mindustry.tools.ImagePacker"
@@ -198,7 +200,8 @@ task genSprites(dependsOn: classes, type: JavaExec){
workingDir = genFolder workingDir = genFolder
} }
task fontgen(dependsOn: classes, type: JavaExec){ tasks.register('fontgen', JavaExec){
dependsOn classes
/* icon font pipeline: /* icon font pipeline:
1. take set of pre-defined icons and SVGs 1. take set of pre-defined icons and SVGs
2. use Fontello API to get a font with these 2. use Fontello API to get a font with these
@@ -233,30 +236,32 @@ task fontgen(dependsOn: classes, type: JavaExec){
//TODO this is broken //TODO this is broken
Log.info(OS.exec("fontforge", "-script", Log.info(OS.exec("fontforge", "-script",
Fi.get("core/assets-raw/fontgen/merge.pe").absolutePath(), Fi.get("core/assets-raw/fontgen/merge.pe").absolutePath(),
Fi.get("core/assets/fonts/font.woff").absolutePath(), Fi.get("core/assets/fonts/font.woff").absolutePath(),
Fi.get("core/assets-raw/fontgen/out/font.woff").absolutePath()) Fi.get("core/assets-raw/fontgen/out/font.woff").absolutePath())
) )
Log.info("Done.") Log.info("Done.")
} }
} }
task icongen(dependsOn: classes, type: JavaExec){ tasks.register('icongen', JavaExec){
dependsOn classes
mainClass = "mindustry.tools.IconConverter" mainClass = "mindustry.tools.IconConverter"
classpath = sourceSets.main.runtimeClasspath classpath = sourceSets.main.runtimeClasspath
standardInput = System.in standardInput = System.in
workingDir = "../core/assets-raw" workingDir = "../core/assets-raw"
} }
task updateScripts(dependsOn: classes, type: JavaExec){ tasks.register('updateScripts', JavaExec){
dependsOn classes
mainClass = "mindustry.tools.ScriptMainGenerator" mainClass = "mindustry.tools.ScriptMainGenerator"
classpath = sourceSets.main.runtimeClasspath classpath = sourceSets.main.runtimeClasspath
standardInput = System.in standardInput = System.in
workingDir = "../" workingDir = "../"
} }
task updateBundles{ tasks.register('updateBundles'){
doLast{ doLast{
def uniEscape = { String string -> def uniEscape = { String string ->
StringBuilder outBuffer = new StringBuilder() StringBuilder outBuffer = new StringBuilder()
@@ -264,12 +269,12 @@ task updateBundles{
for(int i = 0; i < len; i++){ for(int i = 0; i < len; i++){
char ch = string.charAt(i) char ch = string.charAt(i)
if((ch > 61) && (ch < 127)){ if((ch > 61) && (ch < 127)){
outBuffer.append(ch == (char)'\\' ? "\\\\" : ch) outBuffer.append(ch == (char) '\\' ? "\\\\" : ch)
continue continue
} }
if(ch >= 0xE000 && ch <= 0xF8FF){ if(ch >= 0xE000 && ch <= 0xF8FF){
String hex = Integer.toHexString((int)ch) String hex = Integer.toHexString((int) ch)
outBuffer.append("\\u") outBuffer.append("\\u")
for(int j = 0; j < 4 - hex.length(); j++){ for(int j = 0; j < 4 - hex.length(); j++){
outBuffer.append('0') outBuffer.append('0')