Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions test/qa/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[deps]
AllocCheck = "9b6a8646-10ed-4001-bbdc-1d2f46dfbb1a"
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
FindFirstFunctions = "64ca27bc-2ba2-4a57-88aa-44e436879224"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Expand All @@ -11,8 +10,8 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
[compat]
AllocCheck = "0.1, 0.2"
Aqua = "0.8"
ExplicitImports = "1.14"
FindFirstFunctions = "1, 2.1, 3"
JET = "0.9, 0.10, 0.11"
SafeTestsets = "0.0.1, 0.1"
SciMLTesting = "1"
SciMLTesting = "1.6"
Test = "1.10"
22 changes: 22 additions & 0 deletions test/qa/qa.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using SciMLTesting, FindFirstFunctions, JET, Test

run_qa(
FindFirstFunctions;
explicit_imports = true,
ei_kwargs = (;
# All six are Base internals accessed by qualification (GC.@preserve,
# Base.@propagate_inbounds, Base.Order, Base.RefValue, Base.libllvm_version,
# Base.llvmcall). They are not public API, so ExplicitImports flags the
# qualified accesses; there is no public replacement. Source pkg: Base.
all_qualified_accesses_are_public = (;
ignore = (
Symbol("@preserve"),
Symbol("@propagate_inbounds"),
:Order,
:RefValue,
:libllvm_version,
:llvmcall,
),
),
),
)
25 changes: 6 additions & 19 deletions test/qa/qa_tests.jl → test/qa/static_analysis_tests.jl
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
using FindFirstFunctions, Aqua, ExplicitImports, JET, AllocCheck, Test

@testset "Aqua" begin
Aqua.find_persistent_tasks_deps(FindFirstFunctions)
Aqua.test_ambiguities(FindFirstFunctions, recursive = false)
Aqua.test_deps_compat(FindFirstFunctions)
Aqua.test_piracies(FindFirstFunctions)
Aqua.test_project_extras(FindFirstFunctions)
Aqua.test_stale_deps(FindFirstFunctions)
Aqua.test_unbound_args(FindFirstFunctions)
Aqua.test_undefined_exports(FindFirstFunctions)
end
using FindFirstFunctions, JET, AllocCheck, Test

@testset "ExplicitImports" begin
@test check_no_implicit_imports(FindFirstFunctions) === nothing
@test check_no_stale_explicit_imports(FindFirstFunctions) === nothing
end
# Beyond the package-wide JET pass in run_qa (qa.jl), assert type stability on the
# specific hot-path call signatures, and assert they allocate nothing — guarantees
# `JET.test_package` / `Aqua` do not make on their own.

@testset "JET static analysis" begin
vec_int64 = Int64[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
@testset "JET static analysis (hot-path signatures)" begin
vec_float64 = Float64[1.0, 2.0, 3.0, 4.0, 5.0]

# findfirstequal - fast SIMD-based search
Expand Down Expand Up @@ -126,7 +113,7 @@ end
end

@testset "searchsorted_last via enum tag" begin
# Each kind on Int64 / Float64 dense vectors: no allocations.
# Each kind on Int64 dense vectors: no allocations.
for kind in (
KIND_BINARY_BRACKET, KIND_LINEAR_SCAN,
KIND_BRACKET_GALLOP, KIND_EXP_FROM_LEFT,
Expand Down
Loading