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

WIP: update tests #131

Closed
wants to merge 2 commits into from
Closed

WIP: update tests #131

wants to merge 2 commits into from

Conversation

dunn
Copy link

@dunn dunn commented Apr 2, 2017

I marked this as Work In Progress since I don't know the code well enough to be sure I didn't break anything. But now I can run make check, so this fixes #119.

(require 'test (expand-file-name "../test.el"
twittering-test-dir))
(setq twittering-test-dir (file-name-directory
(or load-file-name buffer-file-name)))
Copy link
Author

Choose a reason for hiding this comment

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

Falling back to buffer-file-name lets us run this interactively.

(dolist (file-name (directory-files twittering-test-dir))
(when (string-match "^test-" file-name)
(let ((file-name (expand-file-name file-name twittering-test-dir)))
(load file-name))))

(test-run-all-cases)

(let* ((fail-count (cdr (assoc 'fail test-last-summary)))
Copy link
Author

Choose a reason for hiding this comment

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

test-last-summary was removed from test.el in 0.9.1.

(end-of-buffer)
(search-backward-regexp "" nil t)
(beginning-of-buffer)
(while (search-forward-regexp "\\b\\([0-9]+\\) pass\\b" nil t)
Copy link
Author

Choose a reason for hiding this comment

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

At some point test.el changed *test-result* to be a read-only buffer, so none of this code seems to work anymore.

(twittering-user-agent))
)
(progn
(setq twittering-user-agent-function 'twittering-user-agent-default-function)
Copy link
Author

Choose a reason for hiding this comment

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

From what I can tell the tests aren't always run in the exact order that the forms are given, so (setq twittering-user-agent-function (lambda () "foo user agent")) was being evaluated before the

(test-assert-string-equal (format "Emacs/%d.%d Twittering-mode/%s" [...]

test, causing it to fail.

@dunn dunn mentioned this pull request Apr 2, 2017
@tarsius
Copy link

tarsius commented Apr 18, 2017

Do you need anything from me before you can merge this?

@dunn
Copy link
Author

dunn commented Apr 18, 2017

I don't have commit rights; I'm waiting to hear from @cvmat

@tarsius
Copy link

tarsius commented Apr 18, 2017

Ah! Sorry for the noise.

@dunn dunn closed this Oct 19, 2017
@dunn dunn deleted the tests branch October 19, 2017 19:21
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.

make check fails on OSX
2 participants