From f039b40eb59a62cfe9d6b542655342c53a04b46f Mon Sep 17 00:00:00 2001
From: Mahmoud Bentriou <mahmoud.bentriou@centralesupelec.fr>
Date: Wed, 11 May 2022 23:49:21 +0200
Subject: [PATCH] Rewriting of some test code: using the fact that the package
 is better structured

---
 test/automaton_abc/distributed_R1.jl               | 14 +-------------
 ...distributed_abc_euclidean_distance_automaton.jl |  4 ----
 test/runtests.jl                                   |  4 ++++
 test/unit/distributed_simulation.jl                |  5 -----
 4 files changed, 5 insertions(+), 22 deletions(-)

diff --git a/test/automaton_abc/distributed_R1.jl b/test/automaton_abc/distributed_R1.jl
index e88621a..ab9338b 100644
--- a/test/automaton_abc/distributed_R1.jl
+++ b/test/automaton_abc/distributed_R1.jl
@@ -1,20 +1,8 @@
 
-using MarkovProcesses
 using Distributed
 addprocs(2)
-module_path = get_module_path()
-@everywhere module_path = $module_path
-@everywhere push!(LOAD_PATH, "$(module_path)/src")
 @everywhere using MarkovProcesses
-#=
-@everywhere begin
-    path_module = $(path_module)
-    push!(LOAD_PATH, path_module)
-    using MarkovProcesses
-    load_model("ER")
-    load_automaton("automaton_F")
-end
-=#
+
 load_model("ER")
 load_automaton("automaton_F")
 A_F_R1 = create_automaton_F(ER, 50.0, 75.0, 0.025, 0.05, :P)
diff --git a/test/automaton_abc/distributed_abc_euclidean_distance_automaton.jl b/test/automaton_abc/distributed_abc_euclidean_distance_automaton.jl
index d3263cb..2bfa8cd 100644
--- a/test/automaton_abc/distributed_abc_euclidean_distance_automaton.jl
+++ b/test/automaton_abc/distributed_abc_euclidean_distance_automaton.jl
@@ -1,10 +1,6 @@
 
-using MarkovProcesses
 using Distributed
 addprocs(2)
-module_path = get_module_path()
-@everywhere module_path = $module_path
-@everywhere push!(LOAD_PATH, "$(module_path)/src")
 @everywhere using MarkovProcesses
 import LinearAlgebra: dot
 
diff --git a/test/runtests.jl b/test/runtests.jl
index 708e808..32faa2d 100644
--- a/test/runtests.jl
+++ b/test/runtests.jl
@@ -1,4 +1,8 @@
 
+using Distributed
+using Test
+using MarkovProcesses
+
 include("run_unit.jl")
 include("run_simulation.jl")
 include("run_dist_lp.jl")
diff --git a/test/unit/distributed_simulation.jl b/test/unit/distributed_simulation.jl
index e3504ac..a4561a5 100644
--- a/test/unit/distributed_simulation.jl
+++ b/test/unit/distributed_simulation.jl
@@ -1,12 +1,7 @@
 
 using Distributed
 using MarkovProcesses
-# A bunch of code to define the package on the workers
-# because they are created after the execution of Julia
 addprocs(2)
-module_path = get_module_path()
-@everywhere module_path = $module_path
-@everywhere push!(LOAD_PATH, "$(module_path)/src")
 @everywhere using MarkovProcesses
 
 test_all = true
-- 
GitLab