From 3bd358fa9c169ecb7f93fe32af4c520fc704b6d4 Mon Sep 17 00:00:00 2001 From: Joshua Lampert Date: Thu, 14 Mar 2024 18:16:21 +0100 Subject: [PATCH 1/3] add Aqua and ExplicitImports testing --- README.md | 1 + src/LibP4est.jl | 2 +- test/Project.toml | 4 ++++ test/runtests.jl | 2 ++ test/test_aqua.jl | 14 ++++++++++++++ 5 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 test/test_aqua.jl diff --git a/README.md b/README.md index d021f53..8048da1 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ [![Build Status](https://github.com/trixi-framework/P4est.jl/workflows/CI/badge.svg)](https://github.com/trixi-framework/P4est.jl/actions?query=workflow%3ACI) [![Codecov](https://codecov.io/gh/trixi-framework/P4est.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/trixi-framework/P4est.jl) [![Coveralls](https://coveralls.io/repos/github/trixi-framework/P4est.jl/badge.svg?branch=main)](https://coveralls.io/github/trixi-framework/P4est.jl?branch=main) +[![Aqua QA](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl) [![License: MIT](https://img.shields.io/badge/License-MIT-success.svg)](https://opensource.org/licenses/MIT) [![Downloads](https://shields.io/endpoint?url=https://pkgs.genieframework.com/api/v1/badge/P4est)](https://pkgs.genieframework.com?packages=P4est) diff --git a/src/LibP4est.jl b/src/LibP4est.jl index edb376d..2ece866 100644 --- a/src/LibP4est.jl +++ b/src/LibP4est.jl @@ -1,6 +1,6 @@ module LibP4est -using CEnum +using CEnum: CEnum, @cenum to_c_type(t::Type) = t to_c_type_pairs(va_list) = map(enumerate(to_c_type.(va_list))) do (ind, type) diff --git a/test/Project.toml b/test/Project.toml index a7997c6..916a84e 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -1,9 +1,13 @@ [deps] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7" MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195" MPIPreferences = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [compat] +Aqua = "0.7, 0.8" +ExplicitImports = "1.0.1" MPI = "0.20" MPIPreferences = "0.1.3" Test = "1" diff --git a/test/runtests.jl b/test/runtests.jl index d97bb1f..60054af 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -6,11 +6,13 @@ using Test # everything and perform the tests. using MPI: MPI, mpiexec using P4est +using ExplicitImports import MPIPreferences @info "Testing P4est.jl with" MPIPreferences.binary MPIPreferences.abi @time @testset "P4est.jl tests" begin + include("test_aqua.jl") # For some weird reason, the MPI tests must come first since they fail # otherwise with a custom MPI installation. @time @testset "MPI" begin diff --git a/test/test_aqua.jl b/test/test_aqua.jl new file mode 100644 index 0000000..cd768b6 --- /dev/null +++ b/test/test_aqua.jl @@ -0,0 +1,14 @@ +module TestAqua + +using Aqua +using ExplicitImports: check_no_implicit_imports, check_no_stale_explicit_imports +using Test +using P4est + +@testset "Aqua.jl" begin + Aqua.test_all(P4est; unbound_args = false) + @test isnothing(check_no_implicit_imports(P4est)) + @test isnothing(check_no_stale_explicit_imports(P4est; ignore=(:PointerWrapper,))) +end + +end #module From d2426d8b3220828e9a90adadd68bc5c8ec397d79 Mon Sep 17 00:00:00 2001 From: Joshua Lampert Date: Thu, 14 Mar 2024 18:22:40 +0100 Subject: [PATCH 2/3] format --- test/test_aqua.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_aqua.jl b/test/test_aqua.jl index cd768b6..70e4bde 100644 --- a/test/test_aqua.jl +++ b/test/test_aqua.jl @@ -8,7 +8,7 @@ using P4est @testset "Aqua.jl" begin Aqua.test_all(P4est; unbound_args = false) @test isnothing(check_no_implicit_imports(P4est)) - @test isnothing(check_no_stale_explicit_imports(P4est; ignore=(:PointerWrapper,))) + @test isnothing(check_no_stale_explicit_imports(P4est; ignore = (:PointerWrapper,))) end end #module From fc54f63290b38e230061b5f858c446c981b54b03 Mon Sep 17 00:00:00 2001 From: Joshua Lampert Date: Thu, 14 Mar 2024 20:53:11 +0100 Subject: [PATCH 3/3] remove ExplicitImports.jl again --- test/Project.toml | 2 -- test/runtests.jl | 1 - test/test_aqua.jl | 3 --- 3 files changed, 6 deletions(-) diff --git a/test/Project.toml b/test/Project.toml index 916a84e..b3d2bde 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -1,13 +1,11 @@ [deps] Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" -ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7" MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195" MPIPreferences = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [compat] Aqua = "0.7, 0.8" -ExplicitImports = "1.0.1" MPI = "0.20" MPIPreferences = "0.1.3" Test = "1" diff --git a/test/runtests.jl b/test/runtests.jl index 60054af..c93cd3f 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -6,7 +6,6 @@ using Test # everything and perform the tests. using MPI: MPI, mpiexec using P4est -using ExplicitImports import MPIPreferences @info "Testing P4est.jl with" MPIPreferences.binary MPIPreferences.abi diff --git a/test/test_aqua.jl b/test/test_aqua.jl index 70e4bde..48f59b8 100644 --- a/test/test_aqua.jl +++ b/test/test_aqua.jl @@ -1,14 +1,11 @@ module TestAqua using Aqua -using ExplicitImports: check_no_implicit_imports, check_no_stale_explicit_imports using Test using P4est @testset "Aqua.jl" begin Aqua.test_all(P4est; unbound_args = false) - @test isnothing(check_no_implicit_imports(P4est)) - @test isnothing(check_no_stale_explicit_imports(P4est; ignore = (:PointerWrapper,))) end end #module