From 1dc2dfbd7c2a0763ec5a790ed6af17de6e14de66 Mon Sep 17 00:00:00 2001 From: Guillaume Dalle <22795598+gdalle@users.noreply.github.com> Date: Sun, 29 Sep 2024 09:19:45 +0200 Subject: [PATCH] Put HMMBase in extension of HMMTest --- .github/workflows/test.yml | 15 +++++++++------ libs/HMMTest/Project.toml | 7 ++++++- .../{src/hmmbase.jl => ext/HMMTestHMMBaseExt.jl} | 14 +++++++++++++- libs/HMMTest/src/HMMTest.jl | 3 ++- 4 files changed, 30 insertions(+), 9 deletions(-) rename libs/HMMTest/{src/hmmbase.jl => ext/HMMTestHMMBaseExt.jl} (88%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e4240b49..ace1c011 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,7 +3,7 @@ on: push: branches: - main - tags: ['*'] + tags: ["*"] pull_request: concurrency: # Skip intermediate builds: always. @@ -18,10 +18,13 @@ jobs: fail-fast: false matrix: version: - - '1.9' - - '1' - os: - - ubuntu-latest + - "1.9" + - "1" + test_suite: + - "normal" + - "hmmbase" + env: + JULIA_HMM_TEST_SUITE: ${{ matrix.test_suite }} steps: - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v2 @@ -36,4 +39,4 @@ jobs: with: files: lcov.info token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true \ No newline at end of file + fail_ci_if_error: true diff --git a/libs/HMMTest/Project.toml b/libs/HMMTest/Project.toml index 5e576d83..90312674 100644 --- a/libs/HMMTest/Project.toml +++ b/libs/HMMTest/Project.toml @@ -5,9 +5,14 @@ version = "0.1.0" [deps] BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" -HMMBase = "b2b3ca75-8444-5ffa-85e6-af70e2b64fe7" HiddenMarkovModels = "84ca31d5-effc-45e0-bfda-5a68cd981f47" JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[weakdeps] +HMMBase = "b2b3ca75-8444-5ffa-85e6-af70e2b64fe7" + +[extensions] +HMMTestHMMBaseExt = "HMMBase" \ No newline at end of file diff --git a/libs/HMMTest/src/hmmbase.jl b/libs/HMMTest/ext/HMMTestHMMBaseExt.jl similarity index 88% rename from libs/HMMTest/src/hmmbase.jl rename to libs/HMMTest/ext/HMMTestHMMBaseExt.jl index 808e2e0c..e397cf8f 100644 --- a/libs/HMMTest/src/hmmbase.jl +++ b/libs/HMMTest/ext/HMMTestHMMBaseExt.jl @@ -1,5 +1,14 @@ +module HMMTestHMMBaseExt -function test_identical_hmmbase( +using HiddenMarkovModels +import HiddenMarkovModels as HMMs +using HMMBase: HMMBase +using HMMTest: HMMTest +using Random: AbstractRNG +using Statistics: mean +using Test: @test, @testset, @test_broken + +function HMMTest.test_identical_hmmbase( rng::AbstractRNG, hmm::AbstractHMM, T::Integer; @@ -54,3 +63,6 @@ function test_identical_hmmbase( end end end + + +end diff --git a/libs/HMMTest/src/HMMTest.jl b/libs/HMMTest/src/HMMTest.jl index 26951ceb..7a9a07ab 100644 --- a/libs/HMMTest/src/HMMTest.jl +++ b/libs/HMMTest/src/HMMTest.jl @@ -9,6 +9,8 @@ using Random: AbstractRNG using Statistics: mean using Test: @test, @testset, @test_broken +function test_identical_hmmbase end # in extension + export transpose_hmm export test_equal_hmms, test_coherent_algorithms export test_identical_hmmbase @@ -18,7 +20,6 @@ export test_type_stability include("utils.jl") include("coherence.jl") include("allocations.jl") -include("hmmbase.jl") include("jet.jl") end