File: runtests.jl

package info (click to toggle)
julia 1.5.3%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 91,132 kB
  • sloc: lisp: 278,486; ansic: 60,186; cpp: 29,801; sh: 2,403; makefile: 1,998; pascal: 1,313; objc: 647; javascript: 516; asm: 226; python: 161; xml: 34
file content (30 lines) | stat: -rw-r--r-- 1,018 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# This file is a part of Julia. License is MIT: https://julialang.org/license

using Test, Random
using SuiteSparse, LinearAlgebra, SparseArrays

if Base.USE_GPL_LIBS
    include("umfpack.jl")
    include("cholmod.jl")
    include("spqr.jl")

    # Test multithreaded execution
    let p, cmd = `$(Base.julia_cmd()) --depwarn=error --startup-file=no threads.jl`
        # test both nthreads==1 and nthreads>1. spawn a process to test whichever
        # case we are not running currently.
        other_nthreads = Threads.nthreads() == 1 ? 4 : 1
        p = run(
                pipeline(
                    setenv(
                        cmd,
                        "JULIA_NUM_THREADS" => other_nthreads,
                        dir=@__DIR__()),
                    stdout = stdout,
                    stderr = stderr),
                wait = false)
        include("threads.jl")
        if !success(p)
            error("SuiteSparse threads test failed with nthreads == $other_nthreads")
        end
    end
end