Skip to content

Commit

Permalink
Merge pull request #35 from nlamirault/develop
Browse files Browse the repository at this point in the history
Release 0.11.0
  • Loading branch information
nlamirault committed Feb 26, 2016
2 parents 57f894e + b94185a commit dce5efb
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 2,560 deletions.
5 changes: 5 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# gotest.el ChangeLog

# Version 0.11.0 (02/26/2016)

- #34: Fix gb project detection (thanks dougm)
- `FIX` CircleCI build (Emacs24 as default version)

# Version 0.10.0 (01/25/2016)

- #32: Can't install package in melpa stable
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2014, 2015 Nicolas Lamirault <[email protected]>
# Copyright (C) 2014, 2015, 2016 Nicolas Lamirault <[email protected]>

# 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
Expand Down
1 change: 1 addition & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies:
- sudo add-apt-repository -y ppa:ubuntu-elisp/ppa
- sudo apt-get update
- sudo apt-get install -qq emacs24-nox emacs-snapshot
- sudo update-alternatives --set emacs /usr/bin/emacs24-nox
- curl -fsSkL "https://raw.github.com/cask/cask/master/go" | python
- export PATH="${HOME}/.cask/bin:$PATH"
test:
Expand Down
19 changes: 10 additions & 9 deletions gotest.el
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

;; Author: Nicolas Lamirault <[email protected]>
;; URL: https://github.com/nlamirault/gotest.el
;; Version: 0.10.0
;; Version: 0.11.0
;; Keywords: languages, go, tests

;; Package-Requires: ((emacs "24.3") (s "1.11.0") (f "0.17.3") (go-mode "1.3.1"))

;; Copyright (C) 2014, 2015 Nicolas Lamirault <[email protected]>
;; Copyright (C) 2014, 2015, 2016 Nicolas Lamirault <[email protected]>

;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License
Expand Down Expand Up @@ -45,7 +45,7 @@
:type 'boolean
:group 'gotest)

(defcustom gb-command "gb"
(defcustom go-test-gb-command "gb"
"The 'gb' command.
A project based build tool for the Go programming language.
See https://getgb.io."
Expand Down Expand Up @@ -206,7 +206,7 @@ When `ENV' concatenate before command."
(defun go-test--gb-get-program (args)
"Return the command to launch unit test using GB..
`ARGS' corresponds to go command line arguments."
(s-concat gb-command " test " args))
(s-concat go-test-gb-command " test " args))


(defun go-test--get-arguments (defaults history)
Expand Down Expand Up @@ -391,11 +391,12 @@ For example, if the current buffer is `foo.go', the buffer for

(defun go-test--is-gb-project ()
"Check if project use GB or not."
(let* ((root-dir (go-test--get-root-directory))
(vendor-dir (s-concat root-dir "vendor"))
(manifest (s-concat vendor-dir "/manifest")))
(and (f-dir? vendor-dir)
(f-exists? manifest))))
(let* ((go-test-gb-command (executable-find go-test-gb-command))
(default-directory (if go-test-gb-command (go-test--get-root-directory))))
(and go-test-gb-command
default-directory
(f-dir? "src")
(f-exists? "vendor/manifest"))))

(defun go-test--cleanup (buffer)
"Clean up the old go-test process BUFFER when a similar process is run."
Expand Down
19 changes: 18 additions & 1 deletion test/gotest-test.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; gotest-test.el --- Tests for gotest.el

;; Copyright (C) 2014, 2015 Nicolas Lamirault <[email protected]>
;; Copyright (C) 2014, 2015, 2016 Nicolas Lamirault <[email protected]>

;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License
Expand Down Expand Up @@ -106,6 +106,23 @@
(s-concat testsuite-buffer-name " -foo"))
(go-test--go-run-get-program (go-test--go-run-arguments))))))))

(ert-deftest test-go-test--is-gb-project ()
:tags '(arguments)
(with-test-sandbox
(let ((go-test-gb-command "a-program-name-that-does-not-exist"))
(should (null (go-test--is-gb-project))))
(let ((go-test-gb-command "go"))
(should (null (go-test--is-gb-project))))
(let ((go-test-gb-command "go")
(default-directory (expand-file-name "test/.cask/gb-fake-project")))
(make-directory "src" t)
(make-directory "vendor" t)
(with-temp-buffer
(write-file "Makefile")
(write-file "vendor/manifest"))
(with-current-buffer (find-file-noselect "Makefile")
(should (go-test--is-gb-project))))))

;; Find

(ert-deftest test-go-test-get-current-test ()
Expand Down
8 changes: 4 additions & 4 deletions test/gotest-version-test.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; gotest-version-test.el --- Tests for version information

;; Copyright (C) 2014, 2015 Nicolas Lamirault <[email protected]>
;; Copyright (C) 2014, 2015, 2016 Nicolas Lamirault <[email protected]>

;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License
Expand All @@ -24,11 +24,11 @@

(require 'test-helper)

(ert-deftest phpunit-mode-library-version ()
(ert-deftest test-go-test-library-version ()
:expected-result (if (executable-find "cask") :passed :failed)
(let* ((cask-version (car (process-lines "cask" "version"))))
(let* ((cask-version (car (last (process-lines "cask" "version")))))
(message "gotest.el Cask version: %s" cask-version)
(should (string= "0.10.0" cask-version))))
(should (string= "0.11.0" cask-version))))


(provide 'gotest-version-test)
Expand Down
2 changes: 1 addition & 1 deletion test/test-helper.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;; test-helper.el --- Test helpers for gotest.el

;; Copyright (C) 2014, 2015 Nicolas Lamirault <[email protected]>
;; Copyright (C) 2014, 2015, 2016 Nicolas Lamirault <[email protected]>

;; Author: Nicolas Lamirault <[email protected]>
;; Homepage: https://github.com/nlamirault/gotest.el
Expand Down
Loading

0 comments on commit dce5efb

Please sign in to comment.