From e5973433f07ef1a375053dc189c42be7934e7b02 Mon Sep 17 00:00:00 2001 From: Brujo Benavides Date: Wed, 30 Oct 2024 16:52:22 +0100 Subject: [PATCH] update - Add compatibility with OTP 26 and 27 (#66) * update- Add compatibility with OTP 26 and 27 * update- Also for Windows --- .github/workflows/ci.yaml | 4 ++-- rebar.config.script | 10 ++++++++++ test/typer_core_SUITE.erl | 3 +-- 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 rebar.config.script diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b0cb372..8a3021f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - otp: [25] + otp: [25, 26, 27] rebar: [3.24] steps: - uses: actions/checkout@v4 @@ -33,7 +33,7 @@ jobs: runs-on: windows-latest strategy: matrix: - otp: [25] + otp: [25, 26, 27] rebar: [3.24] steps: - uses: actions/checkout@v4 diff --git a/rebar.config.script b/rebar.config.script new file mode 100644 index 0000000..46d8ba1 --- /dev/null +++ b/rebar.config.script @@ -0,0 +1,10 @@ +case string:to_integer( + erlang:system_info(otp_release)) +of + {N, _} when N >= 26 -> + {value, {dialyzer, DOpts}, Config} = lists:keytake(dialyzer, 1, CONFIG), + {value, {warnings, Warnings}, OtherDOpts} = lists:keytake(warnings, 1, DOpts), + [{dialyzer, [{warnings, [no_unknown | Warnings]} | OtherDOpts]} | Config]; + _ -> + CONFIG +end. diff --git a/test/typer_core_SUITE.erl b/test/typer_core_SUITE.erl index 5eed629..c667c35 100644 --- a/test/typer_core_SUITE.erl +++ b/test/typer_core_SUITE.erl @@ -36,8 +36,7 @@ empty(_) -> bad_plt(_) -> ct:comment("With an invalid plt.. we get an error"), - [{abort, - <<"typer: Dialyzer's PLT is missing or is not up-to-date; please (re)create it">>}] = + [{abort, <<"typer: ", _Message/binary>>}] = run_typer(#{files_r => [abs_test_path("single_file")], plt => "bad.plt"}), {comment, ""}.