-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from nlamirault/develop
Release 0.11.0
- Loading branch information
Showing
8 changed files
with
40 additions
and
2,560 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
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 | ||
|
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 |
---|---|---|
|
@@ -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 | ||
|
@@ -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." | ||
|
@@ -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) | ||
|
@@ -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." | ||
|
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 |
---|---|---|
@@ -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 | ||
|
@@ -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 () | ||
|
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 |
---|---|---|
@@ -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 | ||
|
@@ -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) | ||
|
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 |
---|---|---|
@@ -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 | ||
|
Oops, something went wrong.