|
1 | 1 | using SafeTestsets |
2 | 2 |
|
3 | 3 | @safetestset "LUFactorization implementation" begin |
4 | | - using SciMLBase: successful_retcode |
| 4 | + using LinearAlgebra |
5 | 5 | include("linear_lu.jl") |
6 | | - @test successful_retcode(TestLUFactorization.solve_linear(1.0).retcode) |
| 6 | + sol = TestLUFactorization.solve_linear(1.0) |
| 7 | + @test sol.u ≈ [0.09090909090909091, 0.6363636363636364] |
7 | 8 | end |
8 | 9 |
|
9 | 10 | @safetestset "MKLLUFactorization implementation" begin |
10 | | - using SciMLBase: successful_retcode |
11 | | - include("linear_mkl.jl") |
12 | | - @test successful_retcode(TestMKLLUFactorization.solve_linear(1.0).retcode) |
| 11 | + using LinearAlgebra |
| 12 | + using LinearSolve |
| 13 | + # Only test if MKL is available |
| 14 | + if LinearSolve.usemkl(nothing) |
| 15 | + include("linear_mkl.jl") |
| 16 | + sol = TestMKLLUFactorization.solve_linear(1.0) |
| 17 | + @test sol.u ≈ [0.09090909090909091, 0.6363636363636364] |
| 18 | + else |
| 19 | + @test_skip "MKL not available" |
| 20 | + end |
13 | 21 | end |
14 | 22 |
|
15 | 23 | @safetestset "RFLUFactorization implementation" begin |
16 | | - using SciMLBase: successful_retcode |
| 24 | + using LinearAlgebra |
17 | 25 | include("linear_rf.jl") |
18 | | - @test successful_retcode(TestRFLUFactorization.solve_linear(1.0).retcode) |
| 26 | + sol = TestRFLUFactorization.solve_linear(1.0) |
| 27 | + @test sol.u ≈ [0.09090909090909091, 0.6363636363636364] |
19 | 28 | end |
20 | 29 |
|
21 | 30 | @safetestset "Run trim" begin |
|
44 | 53 | ) |
45 | 54 | @test isfile(JULIAC) |
46 | 55 |
|
47 | | - for (mainfile, expectedtopass) in [ |
| 56 | + using LinearSolve |
| 57 | + # Build list of tests to run, conditionally including MKL |
| 58 | + test_files = [ |
48 | 59 | ("main_lu.jl", true), |
49 | | - ("main_mkl.jl", true), |
50 | 60 | ("main_rf.jl", true) |
51 | 61 | ] |
| 62 | + if LinearSolve.usemkl(nothing) |
| 63 | + push!(test_files, ("main_mkl.jl", true)) |
| 64 | + end |
| 65 | + |
| 66 | + for (mainfile, expectedtopass) in test_files |
52 | 67 | binpath = tempname() |
53 | 68 | cmd = `$(Base.julia_cmd()) --project=. --depwarn=error $(JULIAC) --experimental --trim=unsafe-warn --output-exe $(binpath) $(mainfile)` |
54 | 69 |
|
|
0 commit comments