Skip to content

Commit

Permalink
Set up SynthDiag tests to respect newARGS for passing in test flags f…
Browse files Browse the repository at this point in the history
…rom within a julia session
  • Loading branch information
eldond committed Jul 12, 2024
1 parent 3de107b commit 0de7081
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ using DelimitedFiles: readdlm
using Interpolations: linear_interpolation

function parse_commandline()
# Define newARGS = ["--yourflag"] to run only tests on your flags when including runtests.jl
localARGS = @isdefined(newARGS) ? newARGS : ARGS # Thanks https://stackoverflow.com/a/44978474/6605826
s = ArgParse.ArgParseSettings(; description="Run tests. Default is all tests.")

ArgParse.add_arg_table!(s,
Expand All @@ -23,7 +25,7 @@ function parse_commandline()
Dict(:help => "Test only gas injection",
:action => :store_true),
)
args = ArgParse.parse_args(s)
args = ArgParse.parse_args(localARGS, s)
if !any(values(args)) # If no flags are set, run all tests
for k keys(args)
args[k] = true
Expand Down

0 comments on commit 0de7081

Please sign in to comment.