Skip to content

Commit

Permalink
Add activate_legend_test_data_config
Browse files Browse the repository at this point in the history
  • Loading branch information
oschulz committed Apr 15, 2024
1 parent 3e3b4ac commit 351507e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/LegendTestData.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,16 @@ legend_test_data_path() = joinpath(artifact"legend_testdata", "legend-exp-legend
export legend_test_data_path


"""
activate_legend_test_data_config()
Set environment variable `"LEGEND_DATA_CONFIG"` to the LEGEND test data
configuration
"""
function activate_legend_test_data_config()
testdata_dir = joinpath(legend_test_data_path(), "data", "legend")
ENV["LEGEND_DATA_CONFIG"] = joinpath(testdata_dir, "config.json")
end
export activate_legend_test_data_config

end # module
5 changes: 5 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,9 @@ using Test
@test crystal_metadata.impurity_measurements.distance_from_seed_end_mm == [0, 14, 30, 50, 80]
end

@testset "Test data config" begin
ENV["LEGEND_DATA_CONFIG"] = ""
activate_legend_test_data_config()
@test isfile(ENV["LEGEND_DATA_CONFIG"])
end
end # testset

0 comments on commit 351507e

Please sign in to comment.