Skip to content

Commit c877afe

Browse files
committed
Use Base.julia_cmd.
1 parent 243dfbb commit c877afe

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

test/examples.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ filter!(file -> !occursin("Kaleidoscope", file), examples)
1919
cd(examples_dir) do
2020
examples = relpath.(examples, Ref(examples_dir))
2121
@testset for example in examples
22-
cmd = julia_cmd(`$example`)
23-
@test success(pipeline(cmd, stderr=stderr))
22+
cmd = Base.julia_cmd()
23+
if Base.JLOptions().project != C_NULL
24+
cmd = `$cmd --project=$(unsafe_string(Base.JLOptions().project))`
25+
end
26+
27+
@test success(pipeline(`$cmd $example`, stderr=stderr))
2428
end
2529
end
2630

test/support.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ code = """
88
"""
99

1010
out = Pipe()
11-
run(pipeline(julia_cmd(`-e $code`), stdout=out, stderr=out))
11+
cmd = Base.julia_cmd()
12+
if Base.JLOptions().project != C_NULL
13+
cmd = `$cmd --project=$(unsafe_string(Base.JLOptions().project))`
14+
end
15+
run(pipeline(`$cmd -e $code`, stdout=out, stderr=out))
1216
close(out.in)
1317

1418
@test occursin("LLVM (http://llvm.org/)", read(out, String))

test/util.jl

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
function julia_cmd(cmd)
2-
return `
3-
$(Base.julia_cmd())
4-
--color=$(Base.have_color ? "yes" : "no")
5-
--compiled-modules=$(Base.JLOptions().use_compiled_modules != 0 ? "yes" : "no")
6-
--history-file=no
7-
--startup-file=$(Base.JLOptions().startupfile != 2 ? "yes" : "no")
8-
--code-coverage=$(["none", "user", "all"][1+Base.JLOptions().code_coverage])
9-
$cmd
10-
`
11-
end
12-
131
macro check_ir(inst, str)
142
quote
153
@test occursin($(esc(str)), string($(esc(inst))))

0 commit comments

Comments
 (0)