Skip to content

Commit

Permalink
Added sub-module for examples
Browse files Browse the repository at this point in the history
  • Loading branch information
peremato committed Jan 19, 2024
1 parent 8d35361 commit e9b4907
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.8'
- '1.9'
- '1' # Leave this line unchanged. '1' will automatically expand to the latest stable 1.x release of Julia.
os:
- ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "examples"]
path = examples
url = https://github.com/JuliaHEP/G4Examples.jl.git
1 change: 1 addition & 0 deletions examples
Submodule examples added at 05e332
22 changes: 10 additions & 12 deletions test/testExamples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,19 @@ end
#---change the working directory
cd(dirname(dirname(pathof(Geant4))))

# Basic examples
# All examples should be used for testing to ensure that the release is working correctly
instantiate("examples")
@test run(`julia --project=examples examples/basic/B2/B2a.jl`, devnull, devnull).exitcode == 0
@test run(`julia --project=examples examples/basic/B1/B1.jl`, devnull, devnull).exitcode == 0
@test run(`julia --project=examples examples/basic/B1/B1vis.jl`, devnull, devnull).exitcode == 0
@test run(`julia --project=examples examples/basic/B2/B2aVis.jl`, devnull, devnull).exitcode == 0

@test run(`julia --project=examples examples/extended/RE03/RE03.jl`, devnull, devnull).exitcode == 0
@test run(`julia --project=examples examples/TestEm3/TestEm3.jl`, devnull, devnull).exitcode == 0
@test run(`julia --project=examples examples/Scintillation/Scintillation.jl`, devnull, devnull).exitcode == 0
@test run(`julia --project=examples examples/extended/GPS/GPS.jl`, devnull, devnull).exitcode == 0
@test run(`julia --project=examples examples/extended/TestEm3/TestEm3.jl`, devnull, devnull).exitcode == 0
@test run(`julia --project=examples examples/extended/TestEm3/TestEm3Vis.jl`, devnull, devnull).exitcode == 0

@test run(`julia --project=examples examples/advanced/Scintillation/Scintillation.jl`, devnull, devnull).exitcode == 0
@test run(`julia --project=examples examples/advanced/HBC30/HBC30.jl`, devnull, devnull).exitcode == 0

if VERSION > v"1.9" # The module extension mechanism only works from 1.9
# Visualization
instantiate("ext/G4Vis/examples")
@test run(`julia --project=ext/G4Vis/examples ext/G4Vis/examples/HBC30/HBC30.jl`, devnull, devnull).exitcode == 0
@test run(`julia --project=ext/G4Vis/examples ext/G4Vis/examples/B1vis.jl`, devnull, devnull).exitcode == 0
@test run(`julia --project=ext/G4Vis/examples ext/G4Vis/examples/B2aVis.jl`, devnull, devnull).exitcode == 0
@test run(`julia --project=ext/G4Vis/examples ext/G4Vis/examples/TestEm3Vis.jl`, devnull, devnull).exitcode == 0
@test run(`julia --project=examples/extended/GPS/GPS.jl`, devnull, devnull).exitcode == 0
end
end

0 comments on commit e9b4907

Please sign in to comment.