Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Julia tests #127

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions aggregate/junit_xml_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
11 changes: 3 additions & 8 deletions run-julia
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion spec/julia/runtests.jl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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")
}

Expand Down Expand Up @@ -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
}