Skip to content

Conversation

MicahChalmer
Copy link
Contributor

There was a bit more to this than I initially expected...

The rust-mode code has a few things in it that show intent to keep it compatible with emacs 23 as well as emacs 24, so the .travis.yml file here tests it against emacs 23, 24 and the latest snapshot build. To make it successfully test on emacs 23 I had to change the test code (though not the actual rust-mode code under test) to eliminate some use of forms that were newly introduced in emacs 24.

The way it installs emacs in the Travis VM is taken from the example at https://github.com/rolandwalker/emacs-travis. Other repos seem using the same approach as well--a very well known one is Magit.

There are a few unfortunate things about it:

  1. The PPA that it uses to get emacs 24 now proclaims itself deprecated, although for the time being it still works.
  2. Because it uses apt-get to install emacs, it can't use Travis's new container infrastructure. The Travis team appears to be working on lifting this limitation, so this seems to be only a temporary problem.

An alternative approach would be to have it download an emacs source tarball right from a GNU mirror, and rebuild emacs from source each time. That would eliminate dependency on no-longer-interested third parties, but would also complicate the configuration in this repo and might make the travis builds take a while. (I haven't tried it, so I can't really say for sure.)

Here is a successful Travis run with this version from my own fork.

Commit a8fad0f broke the ERT tests by removing trailing whitespace
inside the test strings.  Fix the tests, and replace some line endings
inside strings with explicit "\n" to avoid having further significant
trailing whitespace in the code.
The new recommended style is to use the "cl-" prefixed versions, but
they do not exist in emacs 23.  We still want to stay compatible with
that, so use plain "loop" rather than "cl-loop" to allow the tests to
work with both old and new versions.

ALso "pcase" was introduced in emacs 24, so stop using it to remain
compatible with emacs 23.
@nikomatsakis
Copy link
Contributor

This looks pretty reasonable, and it'd be awesome to have travis running the unit tests.

nikomatsakis added a commit that referenced this pull request Feb 6, 2015
Add travis config (and make tests runnable on emacs 23)
@nikomatsakis nikomatsakis merged commit 351cc91 into rust-lang:master Feb 6, 2015
@nikomatsakis
Copy link
Contributor

@MicahChalmer what else is needed to get travis going?

@MicahChalmer
Copy link
Contributor Author

All it needs now is for someone with admin access on this repo to go to travis-ci.org and flip the switch.

@huonw
Copy link
Contributor

huonw commented Feb 6, 2015

Done.

@huonw
Copy link
Contributor

huonw commented Feb 6, 2015

Looks like it works great, thanks @MicahChalmer: #24, https://travis-ci.org/rust-lang/rust-mode/builds/49740310 (tests seem to fail on emac23?).

@MicahChalmer MicahChalmer deleted the add-travis branch February 8, 2015 00:52
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.

4 participants