-
Notifications
You must be signed in to change notification settings - Fork 17
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
Running tests yields "buttercup requires `lexical-binding' to be t" #74
Comments
@rndusr Those files didn't have the I am working on a branch related to #68 . I just made a commit to solve the issue that you mentioned. See rodrigomorales1@d03067e This issue should be solved when my changes get merged. |
Right. I looked at the subed/* files and not at the tests/* files. My mistake.
But if I add `;; -*- lexical-binding: t; eval: (buttercup-minor-mode) -*-` or
`;; -*- eval: (buttercup-minor-mode); lexical-binding: t; -*-`, nothing
changes. I'm still getting the same errors.
|
@rndusr I'm not getting those errors with the commit I just made in my branch. See proof below.
|
I can't figure out which branch the commit you linked belongs to. My guess would Not sure if there is something weird going on or it's just me being a git with If I make the changes in your commit manually, which is easy enough, there is no Anyway, my main reason for running the tests was to work on #71, but that seems |
subed-waveform should now handle the case where the stop time + subed-waveform-preview-msecs-after might extend past the end of the file. * subed/subed-waveform.el (subed-waveform-ffprobe-executable): New. (subed-waveform-file-duration-ms-cache): New. (subed-waveform-ffprobe-duration-ms): New, calculates duration. (subed-waveform-file-duration-ms): New function for caching the duration. (subed-waveform-clear-file-duration-ms-cache): New. (subed-mpv): Add advice around subed-mpv-play-from-file for now; ideally change this to a hook later on. (subed-waveform--image-parameters): Move to a separate function for easier testing. (subed-waveform--make-overlay): Do the calculations in subed-waveform--image-parameters. (subed-waveform--update-bars): Use the actual stop time if needed. * tests/test-subed-waveform.el: New. * Set lexical-binding: t in tests/* files Thanks to rodrigomorales1 and rndusr for bug reports and pull requests! Related: - #68 - #75 - #74
Great, does rodrigomorales1's fix make the main branch work for you now? |
Still the same issue with `make test`:
$ git clone --depth=1 https://github.com/sachac/subed.git
Cloning into 'subed'...
remote: Enumerating objects: 47, done.
remote: Counting objects: 100% (47/47), done.
remote: Compressing objects: 100% (42/42), done.
remote: Total 47 (delta 9), reused 26 (delta 4), pack-reused 0
Receiving objects: 100% (47/47), 219.17 KiB | 3.91 MiB/s, done.
Resolving deltas: 100% (9/9), done.
$ cd subed
$ make test
emacs --quick --batch --eval "(progn (setq generated-autoload-file (expand-file-name \"subed-autoloads.el\" \"subed\") backup-inhibited t) \
(update-directory-autoloads \"./subed\"))"
Package autoload is deprecated
INFO Scraping files for subed-autoloads.el...
INFO Scraping files for subed-autoloads.el...done
mkdir -p coverage
UNDERCOVER_FORCE=true emacs -batch -L . -f package-initialize -f buttercup-run-discover
Loading /etc/emacs/site-start.d/00debian.el (source)...
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell (native compiled elisp)...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
Loading /tmp/subed/tests/undercover-init.el (source)...
Loading /tmp/subed/tests/undercover-init.el (source)...
Loading /tmp/subed/tests/undercover-init.el (source)...
Eager macro-expansion failure: (buttercup-dynamic-binding-error . "buttercup requires `lexical-binding' to be t")
make: *** [Makefile:17: test-coverage] Error 255
If I uninstall package-lint, the other tests run fine, but I'm getting the macro-expansion-failure
for test-subed-mpv.el, test-subed-srt.el and test-subed-tsv.el.
test-subed-common.el runs fine even though the first three lines are identical.
$ diff <(head -n4 tests/test-subed-common.el) <(head -n4 tests/test-subed-mpv.el)
4c4
< (require 'subed-srt)
---
(require 'subed-mpv)
`make test-only` runs all tests successfully but I'm getting these two errors:
Error: (file-missing "Opening output file" "No such file or directory" "/tmp/coverage/.resultset.json")
Error in kill-emacs-hook (subed-mpv-kill): (error "Process mock client process does not exist")
I'd be happy to help debug this, but as I said, it's fine if this stays broken for me.
|
@rndusr Could you execute this one-liner and post the output in a new comment?
I executed that command on my system and the tests run successfully, some warnings were shown and an error was thrown because I uninstalled
I'd be happy to find the root cause that is making your system have a different behavior. |
Thank you for helping me investigate this.
$ rm -rf /tmp/subed && cd /tmp && git clone --branch main --depth 1 'https://github.com/sachac/subed' && cd /tmp/subed && make test
Cloning into 'subed'...
remote: Enumerating objects: 47, done.
remote: Counting objects: 100% (47/47), done.
remote: Compressing objects: 100% (42/42), done.
remote: Total 47 (delta 9), reused 26 (delta 4), pack-reused 0
Receiving objects: 100% (47/47), 219.17 KiB | 3.98 MiB/s, done.
Resolving deltas: 100% (9/9), done.
emacs --quick --batch --eval "(progn (setq generated-autoload-file (expand-file-name \"subed-autoloads.el\" \"subed\") backup-inhibited t) \
(update-directory-autoloads \"./subed\"))"
Package autoload is deprecated
INFO Scraping files for subed-autoloads.el...
INFO Scraping files for subed-autoloads.el...done
mkdir -p coverage
UNDERCOVER_FORCE=true emacs -batch -L . -f package-initialize -f buttercup-run-discover
Loading /etc/emacs/site-start.d/00debian.el (source)...
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell (native compiled elisp)...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
Loading /tmp/subed/tests/undercover-init.el (source)...
Loading /tmp/subed/tests/undercover-init.el (source)...
Loading /tmp/subed/tests/undercover-init.el (source)...
Eager macro-expansion failure: (buttercup-dynamic-binding-error . "buttercup requires `lexical-binding' to be t")
make: *** [Makefile:17: test-coverage] Error 255
$ echo $?
2
Looks pretty much like yours except I'm not getting any of these "Required package is unavailable"
messages. I assume that has something to do with your ~/.emacs.d?
And you are missing the loading of several Debian-specific .el files. 00debian.el only sets
gnus-nntpserver-file and mail-host-address. The ispell stuff also seems unrelated to me.
I've also tried adding --no-init-file, but it doesn't make any difference.
I'm stumped.
|
Hmm... @rndusr, is this still happening for you? (No rush, please check when it's convenient for you.) Sorry about it! |
OK, so I've installed subed via package.el from melpa and the tests run fine now. Everything is
green.
I'm getting this output from `make test-coverage`, but it seems to be only a warning:
mkdir -p coverage
UNDERCOVER_FORCE=true emacs -Q -batch -L . -f package-initialize -f buttercup-run-discover
Unable to activate package ‘undercover’.
Required package ‘dash-2.0.0’ is unavailable
I have dash installed as a Debian package because other packages depend on it, and the -Q switch in
the emacs command line implies --no-site-file, which prevents loading of dash, so this seems to be
expected.
…------------------------------------------------------------
But I got 371 lines of compile warnings when I installed subed. I'm not sure how relevant most of
them are. For example, these seem to be caused by me not having org-mode installed (I know, I'm a
heathen):
In org-subed-store-link:
ol-subed.el:41:5: Warning: reference to free variable ‘org-store-link-plist’
In end of data:
ol-subed.el:59:4: Warning: the function ‘org-link-set-parameters’ is not known
to be defined.
ol-subed.el:39:6: Warning: the function ‘org-link-add-props’ is not known to
be defined.
ol-subed.el:32:6: Warning: the function ‘org-link-store-props’ is not known to
be defined.
But I'm also getting stuff like this:
subed-common.el:250:68: Warning: Unused lexical argument `sub-id'
subed-common.el:428:54: Warning: Unused lexical argument `comment'
subed-common.el:428:2: Warning: argument ‘_’ not left unused
subed-common.el:434:2: Warning: defalias `subed--set-subtitle-time-start'
docstring has wrong usage of unescaped single quotes (use \= or different
quoting)
Weirdly, when I run `make compile`, I only get 4 "docstring wider than 80 characters" and no other
warnings.
Do you get any warnings if you install subed via package.el like a normal user?
|
I'm trying to run the tests with
make test
, and most of then run fine, butthere seems to be something wrong with these three files:
The first line of these files contains the
-*- lexical-binding: t; -*-
likeall the other files that don't have this issue.
This happens with and without undercover and package-lint installed.
The text was updated successfully, but these errors were encountered: