Skip to content
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

Add option to hide compilation buffer if all tests pass #49

Merged

Conversation

mallt
Copy link
Contributor

@mallt mallt commented Mar 9, 2017

This PR adds an option that will hide the compilation buffer if all tests pass and show the test result summary and time passed in the echo area:
phpunit-hide

Thanks!

phpunit.el Outdated
(or (s-contains? "Time" x)))
buffer-lines))))
(delete-windows-on buffer)
(message "%s" (concat ok-msg " " time-msg))))))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

message is similar to C's printf.

(message "%s %s" ok-msg time-msg)

@zonuexe
Copy link
Collaborator

zonuexe commented Mar 10, 2017

@mallt
Nice work!

I have some points to review, so please wait a while.
And please forgive me for conflicting with #48 🙇

@mallt
Copy link
Contributor Author

mallt commented Mar 10, 2017

Thanks @zonuexe!
No problem, I will merge the changes of #48 then after it is finished and resubmit this PR.

@zonuexe
Copy link
Collaborator

zonuexe commented Mar 10, 2017

Maybe, follows test will be success always.

<?php

final class OKTest extends \PHPUnit_Framework_TestCase
{
    public function test()
    {
        $this->assertSame(1, 2, "OK");
    }
}
-*- mode: compilation; default-directory: "~/repo/php/TetoSQL/" -*-
Compilation started at Fri Mar 10 18:54:46

stty cols 182; ~/repo/php/TetoSQL/vendor/bin/phpunit tests/OKTest.php
PHPUnit 4.8.35 by Sebastian Bergmann and contributors.
Warning:	No whitelist configured for code coverage

F

Time: 1.14 seconds, Memory: 6.00MB

There was 1 failure:

1) QueryTest::test
OK
Failed asserting that 2 is identical to 1.

/Users/megurine/repo/php/TetoSQL/tests/OKTest.php:7

FAILURES!
Tests: 1, Assertions: 1, Failures: 1.

Compilation exited abnormally with code 1 at Fri Mar 10 18:54:48

@mallt
Copy link
Contributor Author

mallt commented Mar 10, 2017

Yes good point, I will try to make the check a bit more intelligent, thanks!

phpunit.el Outdated
(let* ((buffer-string (buffer-substring-no-properties
(point-min) (point-max)))
(buffer-lines (s-lines buffer-string)))
(when-let ((ok-msg (car (cl-remove-if-not
Copy link
Collaborator

@zonuexe zonuexe Mar 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if-let and when-let are added in Emacs 25. Perhaps we should continue to support Emacs 24.3 for a while.

@zonuexe zonuexe changed the base branch from master to develop March 10, 2017 11:56
@zonuexe
Copy link
Collaborator

zonuexe commented Mar 14, 2017

@mallt
Sorry to make you wait. Please git rebase origin/develop.

@mallt
Copy link
Contributor Author

mallt commented Apr 19, 2017

@zonuexe Thanks a lot for the comments, and sorry for the delay! I hope to update this PR soon.

@mallt mallt force-pushed the hide-compil-buffer-if-tests-pass branch from 4e2c244 to 9b68ba2 Compare April 28, 2017 20:43
@nlamirault nlamirault merged commit 4690158 into nlamirault:develop Nov 27, 2017
@nlamirault
Copy link
Owner

Sorry for delay.

@mallt
Copy link
Contributor Author

mallt commented Nov 27, 2017

Thanks!

@zonuexe
Copy link
Collaborator

zonuexe commented Nov 29, 2017

@mallt Sorry to miss it, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants