Skip to content

Commit ac438ee

Browse files
Test to build and run particlesmc in CLI (#51)
1 parent e168e04 commit ac438ee

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ Statistics = "1.9"
3232
TOML = "1"
3333
Test = "1.9"
3434
julia = "1.9"
35+
Pkg = "1.9"
3536

3637
[extras]
3738
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
3839
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
3940
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
41+
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
4042

4143
[targets]
42-
test = ["Test", "DelimitedFiles", "Aqua"]
44+
test = ["Test", "DelimitedFiles", "Aqua", "Pkg"]

test/runtests.jl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ using StaticArrays
55
using Distributions
66
using ComponentArrays
77
using DelimitedFiles
8+
using Pkg
9+
10+
@testset "Running from CLI" begin
11+
Pkg.build("ParticlesMC")
12+
path_sep = Sys.iswindows() ? ";" : ":"
13+
julia_bin = expanduser("~/.julia/bin")
14+
ENV["PATH"] = ENV["PATH"] * path_sep * julia_bin
15+
@test success(`bash -c "command -v particlesmc"`)
16+
@test success(`particlesmc params.toml`)
17+
end
18+
819

920
@testset "Potential energy test" begin
1021
# Test inital configuration
@@ -165,4 +176,6 @@ end
165176
energy_ll = readdlm(path_energy_ll)[:, 2]
166177
@test isapprox(energy_el, energy_ll, atol=1e-6)
167178

168-
end
179+
end
180+
181+

0 commit comments

Comments
 (0)