-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow rustic-compile to accept a command argument #59
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -85,12 +85,25 @@ | |||
|
||||
(ert-deftest rustic-test-compile () | ||||
(let* ((dir (rustic-babel-generate-project t))) | ||||
(should-not compilation-directory) | ||||
(should-not compilation-arguments) | ||||
(setq compilation-arguments "cargo fmt") | ||||
(let* ((default-directory dir) | ||||
(proc (rustic-compile "cargo fmt"))) | ||||
(should (process-live-p proc)) | ||||
(while (eq (process-status proc) 'run) | ||||
(sit-for 0.1)) | ||||
(should (string= compilation-directory dir)) | ||||
(let ((proc (rustic-recompile))) | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we doing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The previous code does have it rustic/test/rustic-compile-test.el Line 98 in 0d79e4c
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added a new test for compiling interactively rather than via lisp, so the diff looks a little weird. |
||||
(while (eq (process-status proc) 'run) | ||||
(sit-for 0.1))) | ||||
(should (string= (car compilation-arguments) "cargo fmt")) | ||||
(should (string= compilation-directory dir)))) | ||||
(setq compilation-directory nil) | ||||
(setq compilation-arguments nil)) | ||||
|
||||
(ert-deftest rustic-test-compile-interactive () | ||||
(let* ((dir (rustic-babel-generate-project t))) | ||||
(let* ((default-directory dir) | ||||
(compilation-read-command nil) | ||||
(proc (rustic-compile))) | ||||
(proc (call-interactively 'rustic-compile))) | ||||
(should (process-live-p proc)) | ||||
(while (eq (process-status proc) 'run) | ||||
(sit-for 0.1)) | ||||
|
@@ -107,10 +120,9 @@ | |||
(let* ((string "fn main() { let s = 1;}") | ||||
(buf (rustic-test-count-error-helper-new string)) | ||||
(default-directory (file-name-directory (buffer-file-name buf))) | ||||
(rustic-format-trigger nil) | ||||
(compilation-read-command nil)) | ||||
(rustic-format-trigger nil)) | ||||
(with-current-buffer buf | ||||
(let* ((proc (rustic-compile)) | ||||
(let* ((proc (rustic-compile "cargo build")) | ||||
(buffer (process-buffer proc))) | ||||
(while (eq (process-status proc) 'run) | ||||
(sit-for 0.01)) | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new behavior is nice!