Skip to content

Commit ff3ef26

Browse files
committed
fixup! Add test that optimization_clean doesn't trim, marked broken
1 parent 076b9f0 commit ff3ef26

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

test/trim/runtests.jl

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ end
1414
using JET
1515
using SciMLBase: successful_retcode
1616
include("optimization_trimmable.jl")
17-
@test successful_retcode(TestModuleClean.minimize(1.0).retcode)
17+
@test successful_retcode(TestModuleTrimmable.minimize(1.0).retcode)
1818
# can't use `@test_opt` macro here because it would try to eval before
1919
# `using JET` is processed
2020
test_opt(TestModuleTrimmable.minimize, (typeof(1.0),))
@@ -44,8 +44,10 @@ end
4444
)
4545
@test isfile(JULIAC)
4646

47-
for (mainfile, shouldpass) in [("main_trimmable.jl", true),
48-
("main_clean.jl", false)]
47+
for (mainfile, expectedtopass) in [
48+
("main_trimmable.jl", true),
49+
("main_clean.jl", false),
50+
]
4951
binpath = tempname()
5052
cmd = `$(Base.julia_cmd()) --project=. --depwarn=error $(JULIAC) --experimental --trim=unsafe-warn --output-exe $(binpath) $(mainfile)`
5153

@@ -58,12 +60,12 @@ end
5860
# Instead we use `_execute` to also capture `stdout` and `stderr`.
5961
# @test success(setenv(cmd, clean_env))
6062
trimcall = _execute(setenv(cmd, clean_env; dir = @__DIR__))
61-
if trimcall.exitcode != 0 && shouldpass
63+
if trimcall.exitcode != 0 && expectedtopass
6264
@show trimcall.stdout
6365
@show trimcall.stderr
6466
end
65-
@test trimcall.exitcode == 0 broken=!shouldpass
66-
@test isfile(binpath) broken=!shouldpass
67-
@test success(`$(binpath) 1.0`) broken=!shouldpass
67+
@test trimcall.exitcode == 0 broken = !expectedtopass
68+
@test isfile(binpath) broken = !expectedtopass
69+
@test success(`$(binpath) 1.0`) broken = !expectedtopass
6870
end
6971
end

0 commit comments

Comments
 (0)