@@ -804,7 +804,7 @@ suite "nimble run":
804804 """ Testing `nimble run`: @["\"", "\'", "\t", "arg with spaces"] """
805805 )
806806
807- test " Compile flags before executable name" :
807+ test " Nimble options before executable name" :
808808 cd " run" :
809809 let (output, exitCode) = execNimble (
810810 " run" , # Run command invokation
@@ -818,7 +818,7 @@ suite "nimble run":
818818 echo output
819819 check output.contains (""" Testing `nimble run`: @["--test"] """ )
820820
821- test " Compile flags before --" :
821+ test " Nimble options before --" :
822822 cd " run" :
823823 let (output, exitCode) = execNimble (
824824 " run" , # Run command invokation
@@ -832,6 +832,72 @@ suite "nimble run":
832832 echo output
833833 check output.contains (""" Testing `nimble run`: @["--test"] """ )
834834
835+ test " Compilation flags before run command" :
836+ cd " run" :
837+ let (output, exitCode) = execNimble (
838+ " -d:sayWhee" , # Compile flag to define a conditional symbol
839+ " run" , # Run command invokation
840+ " --debug" , # Flag to enable debug verbosity in Nimble
841+ " --" , # Separator for arguments
842+ " --test" # First argument passed to the executed command
843+ )
844+ check exitCode == QuitSuccess
845+ check output.contains (" tests$1run$1$2 --test" %
846+ [$ DirSep , " run" .changeFileExt (ExeExt )])
847+ echo output
848+ check output.contains (""" Testing `nimble run`: @["--test"] """ )
849+ check output.contains (""" Whee! """ )
850+
851+ test " Compilation flags before executable name" :
852+ cd " run" :
853+ let (output, exitCode) = execNimble (
854+ " --debug" , # Flag to enable debug verbosity in Nimble
855+ " run" , # Run command invokation
856+ " -d:sayWhee" , # Compile flag to define a conditional symbol
857+ " run" , # The executable to run
858+ " --test" # First argument passed to the executed command
859+ )
860+ check exitCode == QuitSuccess
861+ check output.contains (" tests$1run$1$2 --test" %
862+ [$ DirSep , " run" .changeFileExt (ExeExt )])
863+ echo output
864+ check output.contains (""" Testing `nimble run`: @["--test"] """ )
865+ check output.contains (""" Whee! """ )
866+
867+ test " Compilation flags before --" :
868+ cd " run" :
869+ let (output, exitCode) = execNimble (
870+ " run" , # Run command invokation
871+ " -d:sayWhee" , # Compile flag to define a conditional symbol
872+ " --debug" , # Flag to enable debug verbosity in Nimble
873+ " --" , # Separator for arguments
874+ " --test" # First argument passed to the executed command
875+ )
876+ check exitCode == QuitSuccess
877+ check output.contains (" tests$1run$1$2 --test" %
878+ [$ DirSep , " run" .changeFileExt (ExeExt )])
879+ echo output
880+ check output.contains (""" Testing `nimble run`: @["--test"] """ )
881+ check output.contains (""" Whee! """ )
882+
883+ test " Order of compilation flags before and after run command" :
884+ cd " run" :
885+ let (output, exitCode) = execNimble (
886+ " -d:compileFlagBeforeRunCommand" , # Compile flag to define a conditional symbol
887+ " run" , # Run command invokation
888+ " -d:sayWhee" , # Compile flag to define a conditional symbol
889+ " --debug" , # Flag to enable debug verbosity in Nimble
890+ " --" , # Separator for arguments
891+ " --test" # First argument passed to the executed command
892+ )
893+ check exitCode == QuitSuccess
894+ check output.contains (" -d:compileFlagBeforeRunCommand -d:sayWhee" )
895+ check output.contains (" tests$1run$1$2 --test" %
896+ [$ DirSep , " run" .changeFileExt (ExeExt )])
897+ echo output
898+ check output.contains (""" Testing `nimble run`: @["--test"] """ )
899+ check output.contains (""" Whee! """ )
900+
835901suite " project local deps mode" :
836902 beforeSuite ()
837903
0 commit comments