Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Servant to provide our test ELPA server
- Loading branch information
Showing
15 changed files
with
101 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
;;; app.el --- Cask: Stub ELPA server for integration tests -*- lexical-binding: t; -*- | ||
|
||
;; Copyright (C) 2012, 2013 Johan Andersson | ||
|
||
;; Author: Johan Andersson <johan.rejeep@gmail.com> | ||
;; Maintainer: Johan Andersson <johan.rejeep@gmail.com> | ||
;; URL: http://github.com/cask/cask | ||
|
||
;; This file is NOT part of GNU Emacs. | ||
|
||
;; This program is free software; you can redistribute it and/or modify | ||
;; it under the terms of the GNU General Public License as published by | ||
;; the Free Software Foundation, either version 3 of the License, or | ||
;; (at your option) any later version. | ||
|
||
;; This program is distributed in the hope that it will be useful, | ||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
;; GNU General Public License for more details. | ||
|
||
;; You should have received a copy of the GNU General Public License | ||
;; along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
;;; Commentary: | ||
|
||
;; A simple stub ELPA server for Cask's integration tests. | ||
|
||
;;; Code: | ||
|
||
(require 'f) | ||
(require 'servant) | ||
(require 'rx) | ||
|
||
(let* ((port 9191) | ||
(host "127.0.0.1") | ||
(directory (f-parent (f-this-file))) | ||
(tmp-directory (f-join directory "tmp")) | ||
(routes (--map | ||
(cons (format "^.*//%s/\\(.*\\)$" (regexp-quote it)) | ||
(servant-make-elnode-handler (f-join directory it))) | ||
'("packages" "new-packages")))) | ||
|
||
(global-set-key (kbd "q") (lambda () | ||
(interactive) | ||
(elnode-stop port) | ||
(kill-emacs 0))) | ||
|
||
(insert | ||
(format "Running (fake) ELPA server on port %d... Press `q' to quit." port)) | ||
|
||
(elnode-start (lambda (httpcon) (elnode-hostpath-dispatcher httpcon routes)) | ||
:port port :host host) | ||
|
||
(when noninteractive | ||
(f-mkdir tmp-directory) | ||
(with-temp-file (f-join tmp-directory "servant.pid") | ||
(insert (format "%s" (emacs-pid)))) | ||
;; Start "event loop". | ||
(while t | ||
;; We need `while' due to http://stackoverflow.com/questions/14698081/ | ||
(sit-for 10)))) | ||
|
||
;;; app.el ends here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
;;; foo.el --- Foo -*- lexical-binding: t; -*- | ||
|
||
;; Version: 0.0.2 | ||
|
||
(provide 'foo) | ||
|
||
;;; foo.el ends here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
;;; bar.el --- bar -*- lexical-binding: t; -*- | ||
|
||
;; Version: 0.0.2 | ||
|
||
(provide 'bar) | ||
|
||
;;; bar.el ends here |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
;;; foo.el --- Foo -*- lexical-binding: t; -*- | ||
|
||
;; Version: 0.0.1 | ||
|
||
(provide 'foo) | ||
|
||
;;; foo.el ends here |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
;;; qux.el --- Qux -*- lexical-binding: t; -*- | ||
|
||
;; Version: 0.0.4 | ||
|
||
(defun hello () | ||
(princ "Hello from QUX, which is a BAZ dependency")) | ||
|
||
(provide 'qux) | ||
|
||
;;; qux.el ends here |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.