1
1
using PkgEval
2
2
using Test
3
3
4
- # determine the version to use
5
- const version = get (ENV , " JULIA_VERSION " , string (VERSION ))
6
- @info " Testing with Julia $version "
7
- const julia = PkgEval. obtain_julia (version ):: VersionNumber
8
- @info " Resolved to Julia v$julia "
9
- const install = PkgEval. prepare_julia (julia )
4
+ # determine which Julia to use
5
+ const julia_spec = get (ENV , " JULIA_SPEC " , string (VERSION ))
6
+ @info " Testing with Julia $julia_spec "
7
+ const julia_version = PkgEval. obtain_julia (julia_spec ):: VersionNumber
8
+ @info " Resolved to Julia v$julia_version "
9
+ const julia_install = PkgEval. prepare_julia (julia_version )
10
10
11
11
@testset " sandbox" begin
12
12
PkgEval. prepare_runner ()
13
13
mktemp () do path, io
14
- PkgEval. run_sandboxed_julia (install , ` -e 'print(1337)'` ; stdout = io,
14
+ PkgEval. run_sandboxed_julia (julia_install , ` -e 'print(1337)'` ; stdout = io,
15
15
tty= false , interactive= false )
16
16
close (io)
17
17
@test read (path, String) == " 1337"
18
18
end
19
19
20
20
# print versioninfo so we can verify in CI logs that the correct version is used
21
- PkgEval. run_sandboxed_julia (install , ` -e 'using InteractiveUtils; versioninfo()'` ;
21
+ PkgEval. run_sandboxed_julia (julia_install , ` -e 'using InteractiveUtils; versioninfo()'` ;
22
22
tty= false , interactive= false )
23
23
end
24
24
@@ -30,13 +30,23 @@ const pkgnames = ["TimerOutputs", "Crayons", "Example", "Gtk"]
30
30
pkgs = PkgEval. read_pkgs (pkgnames)
31
31
32
32
# timeouts
33
- results = PkgEval. run ([julia], pkgs; time_limit = 0.1 )
33
+ results = PkgEval. run ([Configuration ( julia= julia_version) ], pkgs; time_limit = 0.1 )
34
34
@test all (results. status .== :kill )
35
35
end
36
36
37
37
@testset " main entrypoint" begin
38
- results = PkgEval. run ([julia], pkgnames)
39
- if ! (version == " master" || version == " nightly" )
38
+ results = PkgEval. run ([Configuration (julia= julia_version)], pkgnames)
39
+ if ! (julia_version == " master" || julia_version == " nightly" )
40
+ @test all (results. status .== :ok )
41
+ for result in eachrow (results)
42
+ @test occursin (" Testing $(result. name) tests passed" , result. log)
43
+ end
44
+ end
45
+ end
46
+
47
+ @testset " PackageCompiler" begin
48
+ results = PkgEval. run ([Configuration (julia= julia_version, compiled= true )], [" Example" ])
49
+ if ! (julia_version == " master" || julia_version == " nightly" )
40
50
@test all (results. status .== :ok )
41
51
for result in eachrow (results)
42
52
@test occursin (" Testing $(result. name) tests passed" , result. log)
52
62
end
53
63
54
64
PkgEval. purge ()
55
- rm (install ; recursive= true )
65
+ rm (julia_install ; recursive= true )
0 commit comments