File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,32 @@ using Pkg
33
33
@test ! prefer_clang (Platform (" x86_64" , " linux" ; sanitize= " thread" ))
34
34
end
35
35
36
+ @testset " with_logfile" begin
37
+ mktempdir () do dir
38
+ logfile = joinpath (dir, " dir" , " logfile.txt" )
39
+ with_logfile (logfile) do io
40
+ print (io, logfile)
41
+ end
42
+ @test readchomp (logfile) == logfile
43
+ # Test writing on an existing file
44
+ with_logfile (logfile) do io
45
+ print (io, logfile * logfile)
46
+ end
47
+ @test readchomp (logfile) == logfile * logfile
48
+
49
+ # Test using a Prefix as argument
50
+ prefix = Prefix (dir)
51
+ subdir = " my_package"
52
+ ldir = logdir (prefix; subdir)
53
+ name = " logfile.txt"
54
+ logfile = joinpath (ldir, name)
55
+ with_logfile (prefix, name; subdir) do io
56
+ print (io, logfile)
57
+ end
58
+ @test readchomp (logfile) == logfile
59
+ end
60
+ end
61
+
36
62
# Are we using docker? If so, test that the docker runner works...
37
63
@testset " Runner utilities" begin
38
64
# Test that is_ecryptfs works for something we're certain isn't encrypted
You can’t perform that action at this time.
0 commit comments