|
1 | 1 | # This file is a part of Julia. License is MIT: http://julialang.org/license
|
2 | 2 |
|
| 3 | +catcmd = `cat` |
| 4 | +if is_windows() |
| 5 | + try # use busybox-w32 on windows |
| 6 | + success(`busybox`) |
| 7 | + catcmd = `busybox cat` |
| 8 | + end |
| 9 | +end |
| 10 | + |
3 | 11 | let exename = `$(Base.julia_cmd()) --precompiled=yes`
|
4 | 12 | # --version
|
5 | 13 | let v = split(readstring(`$exename -v`), "julia version ")[end]
|
@@ -246,13 +254,6 @@ let exename = `$(Base.julia_cmd()) --precompiled=yes`
|
246 | 254 | @test readchomp(`$exename -e 'println(ARGS);' ''`) == "String[\"\"]"
|
247 | 255 |
|
248 | 256 | # issue #12679
|
249 |
| - catcmd = `cat` |
250 |
| - if is_windows() |
251 |
| - try # use busybox-w32 on windows |
252 |
| - success(`busybox`) |
253 |
| - catcmd = `busybox cat` |
254 |
| - end |
255 |
| - end |
256 | 257 | @test readchomp(pipeline(ignorestatus(`$exename --startup-file=no --compile=yes -ioo`),stderr=catcmd)) == "ERROR: unknown option `-o`"
|
257 | 258 | @test readchomp(pipeline(ignorestatus(`$exename --startup-file=no -p`),stderr=catcmd)) == "ERROR: option `-p/--procs` is missing an argument"
|
258 | 259 | @test readchomp(pipeline(ignorestatus(`$exename --startup-file=no --inline`),stderr=catcmd)) == "ERROR: option `--inline` is missing an argument"
|
@@ -287,3 +288,19 @@ let exename = `$(Base.julia_cmd())`
|
287 | 288 | @test readchomp(`$exename --precompiled=yes -E "Bool(Base.JLOptions().use_precompiled)"`) == "true"
|
288 | 289 | @test readchomp(`$exename --precompiled=no -E "Bool(Base.JLOptions().use_precompiled)"`) == "false"
|
289 | 290 | end
|
| 291 | + |
| 292 | +# backtrace contains type and line number info (esp. on windows #17179) |
| 293 | +for precomp in ("yes", "no") |
| 294 | + bt = readstring(pipeline(ignorestatus(`$(Base.julia_cmd()) --precompiled=$precomp |
| 295 | + -E 'include("____nonexistent_file")'`), stderr=catcmd)) |
| 296 | + @test contains(bt, "in include_from_node1") |
| 297 | + if is_windows() && Sys.WORD_SIZE == 32 && precomp == "yes" |
| 298 | + # fixme, issue #17251 |
| 299 | + @test_broken contains(bt, "in include_from_node1(::String) at $(joinpath(".","loading.jl"))") |
| 300 | + else |
| 301 | + @test contains(bt, "in include_from_node1(::String) at $(joinpath(".","loading.jl"))") |
| 302 | + end |
| 303 | + lno = match(r"at \.[/\\]loading.jl:(\d+)", bt) |
| 304 | + @test length(lno.captures) == 1 |
| 305 | + @test parse(Int, lno.captures[1]) > 0 |
| 306 | +end |
0 commit comments