using Pkg

supporting_dir = @__DIR__
test_dir = dirname(supporting_dir)
@assert basename(test_dir) == "test"
project_root_dir = dirname(test_dir) # <- pigeons dir
Pkg.activate("$test_dir/supporting/env-pigeons+dynamicppl")
Pkg.develop(PackageSpec(path=project_root_dir))

using Test
if VERSION < v"1.9"
    @test_throws "UndefVarError: toy_mvn_target not defined" pigeons(target = toy_mvn_target(1))
else
    @test_throws "UndefVarError: `toy_mvn_target` not defined" pigeons(target = toy_mvn_target(1))
end

using Pigeons
pigeons(target = toy_mvn_target(1), n_rounds = 2)

@test_throws "MethodError: no method matching toy_stan_target(::Int64)" pigeons(target = toy_stan_target(2))

@test_throws "MethodError: no method matching toy_turing_target(::Int64)" pigeons(target = Pigeons.toy_turing_target(2))

using DynamicPPL
pigeons(target = Pigeons.toy_turing_target(2), n_rounds = 2)
