diff --git a/aggregate/junit_xml_parser.rb b/aggregate/junit_xml_parser.rb index b52c6f7f7..b72f9e3db 100644 --- a/aggregate/junit_xml_parser.rb +++ b/aggregate/junit_xml_parser.rb @@ -74,14 +74,14 @@ def each_test tr = TestResult.new(name, :skipped, 0, nil) yield tr - elsif ts.attribute('errors') && ts.attribute('errors').value.to_f != 0 && ts.attribute('name').value =~ /^\/(.*?) test$/ + elsif ts.attribute('errors') && ts.attribute('errors').value != '0' && ts.attribute('name').value =~ /^\/(.*?) test$/ # Pick up Julia errored tests name = $1 error_element = ts.elements['error'] error_message = error_element.attribute('message').value if error_element error_trace = error_element.text.strip if error_element - tr = TestResult.new(name, :error, 0, TestResult::Failure.new(nil, nil, error_message, error_trace)) + tr = TestResult.new(name, :failed, 0, TestResult::Failure.new(nil, nil, error_message, error_trace)) yield tr end } diff --git a/run-julia b/run-julia index b94774211..5465f6bdc 100755 --- a/run-julia +++ b/run-julia @@ -1,10 +1,5 @@ -#!/bin/bash +#!/bin/sh -ef +. ./config -source ./config - -# Define the command to run the Julia script with redirected output -command="JULIA_LOAD_PATH=\"$JULIA_LOAD_PATH:$JULIA_RUNTIME_DIR:compiled/julia:spec/julia/extra\" julia \"spec/julia/runtests.jl\"" - -# Run the command -eval $command +JULIA_LOAD_PATH="$JULIA_LOAD_PATH:$JULIA_RUNTIME_DIR:compiled/julia:spec/julia/extra" julia spec/julia/runtests.jl diff --git a/spec/julia/runtests.jl b/spec/julia/runtests.jl index aa04b95aa..f7bb414c1 100644 --- a/spec/julia/runtests.jl +++ b/spec/julia/runtests.jl @@ -5,7 +5,7 @@ using TestReports function run_tests() #nested testset is needed to continue even after some test errors @testset "" begin - for f in filter(s -> contains(s, r".jl$") && !contains(s, "runtests.jl"), readdir(@__DIR__; join=true)) + for f in filter(s -> endswith(s, ".jl") && (basename(s) != "runtests.jl"), readdir(@__DIR__; join=true)) include(f) end end diff --git a/translator/src/main/scala/io/kaitai/struct/testtranslator/specgenerators/JuliaSG.scala b/translator/src/main/scala/io/kaitai/struct/testtranslator/specgenerators/JuliaSG.scala index 3392e707e..52a0b9042 100644 --- a/translator/src/main/scala/io/kaitai/struct/testtranslator/specgenerators/JuliaSG.scala +++ b/translator/src/main/scala/io/kaitai/struct/testtranslator/specgenerators/JuliaSG.scala @@ -20,7 +20,7 @@ class JuliaSG(spec: TestSpec, provider: ClassTypeProvider) extends BaseGenerator override def header(): Unit = { importList.add(s"import ${className}Module") out.puts - out.puts(s"@testset ${'"'}$className test${'"'} begin") + out.puts(s"""@testset "$className test" begin""") out.inc } @@ -41,7 +41,7 @@ class JuliaSG(spec: TestSpec, provider: ClassTypeProvider) extends BaseGenerator override def simpleEquality(check: TestEquals): Unit = { val actStr = translateAct(check.actual) - val expStr = translateExp(check.expected) + val expStr = translator.translate(check.expected) out.puts(s"@test $actStr == $expStr") } @@ -70,9 +70,6 @@ class JuliaSG(spec: TestSpec, provider: ClassTypeProvider) extends BaseGenerator def translateAct(x: Ast.expr) = translator.translate(x).replace("this." + Main.INIT_OBJ_NAME, "r") - def translateExp(x: Ast.expr) = - translator.translate(x).replace("this._root", className) - override def results: String = "# " + AUTOGEN_COMMENT + "\n\n" + super.results }