Skip to content

Commit

Permalink
Let test commands be configurable via cargo-process--command-test--ad…
Browse files Browse the repository at this point in the history
…ditional-args variable

For example, " -- --nocapture" value(instead of default nil) could be used for controlling println! stdout verbosity level of successfull tests
  • Loading branch information
nfedyashev authored Oct 12, 2022
1 parent 7bd3682 commit e85ea9f
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions cargo-process.el
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@
"Subcommand used by `cargo-process-current-file-tests'."
:type 'string)

(defcustom cargo-process--command-test--additional-args nil
"Subcommand used by `cargo-process--command-test', `cargo-process--command-current-test` and `cargo-process--command-current-file-tests`.")

(defcustom cargo-process--command-update "update"
"Subcommand used by `cargo-process-update'."
:type 'string)
Expand Down Expand Up @@ -691,7 +694,7 @@ any) as the default if none is entered."
With the prefix argument, modify the command's invocation.
Cargo: Run the tests."
(interactive)
(cargo-process--start "Test" cargo-process--command-test))
(cargo-process--start "Test" cargo-process--command-test nil nil cargo-process--command-test--additional-args))

;;;###autoload
(defun cargo-process-current-test ()
Expand All @@ -702,17 +705,24 @@ Cargo: Run the tests."
(cargo-process--start "Test"
(concat cargo-process--command-current-test
" "
(cargo-process--get-current-test-fullname))))
(cargo-process--get-current-test-fullname))
nil
nil
cargo-process--command-test--additional-args))

;;;###autoload
(defun cargo-process-current-file-tests ()
"Run the Cargo test command for the current file.
With the prefix argument, modify the command's invocation.
Cargo: Run the tests."
(interactive)
(cargo-process--start "Test" (concat cargo-process--command-current-file-tests
" "
(cargo-process--get-current-mod))))
(cargo-process--start "Test"
(concat cargo-process--command-current-file-tests
" "
(cargo-process--get-current-mod))
nil
nil
cargo-process--command-test--additional-args))

;;;###autoload
(defun cargo-process-update ()
Expand Down

0 comments on commit e85ea9f

Please sign in to comment.