README: README.textile
ln -s README.md README
-PHONY=check clean dist distclean test check-short check-terse install-short
+PHONY=check check_copyrights clean dist distclean test check-short check-terse install-short
if MAINTAINER_MODE
#: Run "make install"
install-short:
$(MAKE) install 2>&1 | $(RUBY) make-check-filter.rb
+
+CR_EXCEPTIONS=copyright_exceptions
+#: Check for GNU Copyrights.
+check_copyrights:
+ @echo "Compute exceptions >$(CR_EXCEPTIONS)~"
+ @export LANG=C; \
+ find . -name '.git' -prune -o -name '*.el' -print0 | \
+ xargs -0 grep -L 'Free Software Foundation, Inc' | \
+ grep -v '\(\.dir-locals\|.-\(pkg\|autoloads\)\)\.el$$'; \
+ find . -name '.git' -prune -o -name '*.el' -print | \
+ while read f; do \
+ fquoted="$$(echo $$f|tr '|' '_')"; \
+ sed -n -e '/[Cc]opyright.*, *[1-9][-0-9]*,\?$$/N' \
+ -e '/Free Software Foundation/d' \
+ -e "s|^\\(.*[Cc]opyright\\)|$$fquoted:\\1|p" \
+ "$$f"; \
+ done | sort >$(CR_EXCEPTIONS)~
+ diff -u "$(CR_EXCEPTIONS)" "$(CR_EXCEPTIONS)~"
+;;; test-simple.el --- Simple Unit Test Framework for Emacs Lisp
+;; Copyright (C) 2015 Free Software Foundation, Inc
+
+;; Author: Rocky Bernstein <rocky@gnu.org>
+;; URL: http://github.com/rocky/emacs-test-simple
+;; Keywords: unit-test
+;; Version: 1.0
+
+;; 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/>.
(defun gcd(a b)
"Greatest Common Divisor of A and B"
;; Make a < b
- (if (> a b)
+ (if (> a b)
(let ((c a))
(setq a b)
(setq b c)))
- (cond
+ (cond
((< a 0) nil)
((or (= 0 (- b a)) (= a 1)) a)
(t (gcd (- b a) a))
+;;; test-simple.el --- Simple Unit Test Framework for Emacs Lisp
+;; Copyright (C) 2015 Free Software Foundation, Inc
+
+;; Author: Rocky Bernstein <rocky@gnu.org>
+;; URL: http://github.com/rocky/emacs-test-simple
+;; Keywords: unit-test
+;; Version: 1.0
+
+;; 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/>.
(require 'test-simple)
(test-simple-start)
-(assert-t (load-file "./gcd.el")
+(assert-t (load-file "./gcd.el")
"Can't load gcd.el - are you in the right directory?" )
(note "degenereate cases")
(assert-equal 1 (gcd 3 5) "gcd(3,5)")
(assert-equal 8 (gcd 8 32) "gcd(8,32)")
-(assert-raises error (gcd "a" 32)
+(assert-raises error (gcd "a" 32)
"Passing a string value should raise an error")
(end-tests)
;;; test-simple.el --- Simple Unit Test Framework for Emacs Lisp
;; Rewritten from Phil Hagelberg's behave.el by rocky
-;; Copyright (C) 2010, 2012-2013, 2014 Rocky Bernstein
+;; Copyright (C) 2015 Free Software Foundation, Inc
-;; Author: Rocky Bernstein
+;; Author: Rocky Bernstein <rocky@gnu.org>
;; URL: http://github.com/rocky/emacs-test-simple
;; Keywords: unit-test
;; Version: 1.0
-;; 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
+;;; test-simple.el --- Simple Unit Test Framework for Emacs Lisp
+;; Copyright (C) 2015 Free Software Foundation, Inc
+
+;; Author: Rocky Bernstein <rocky@gnu.org>
+;; URL: http://github.com/rocky/emacs-test-simple
+;; Keywords: unit-test
+;; Version: 1.0
+
+;; 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/>.
(require 'cl)
(load-file "../test-simple.el")
(test-simple-start "test-simple.el")
+;;; test-simple.el --- Simple Unit Test Framework for Emacs Lisp
+;; Copyright (C) 2015 Free Software Foundation, Inc
+
+;; Author: Rocky Bernstein <rocky@gnu.org>
+;; URL: http://github.com/rocky/emacs-test-simple
+;; Keywords: unit-test
+;; Version: 1.0
+
+;; 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/>.
(require 'cl)
(load-file "../test-simple.el")
(test-simple-clear)
+;;; test-simple.el --- Simple Unit Test Framework for Emacs Lisp
+;; Copyright (C) 2015 Free Software Foundation, Inc
+
+;; Author: Rocky Bernstein <rocky@gnu.org>
+;; URL: http://github.com/rocky/emacs-test-simple
+;; Keywords: unit-test
+;; Version: 1.0
+
+;; 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/>.
(require 'cl)
(load-file "../test-simple.el")
;; We don't do this or test-simple-start