From fff0c816fddce661878364465cd8d2d7286e7d7c Mon Sep 17 00:00:00 2001 From: Gary King <gwking@franz.com> Date: Sun, 6 Sep 2009 14:56:58 -0400 Subject: [PATCH] Tweaked many tests to remove many warnings --- test/run-tests.sh | 4 +- test/script-support.lisp | 2 +- test/test-force.script | 5 ++- test/test-nested-components.script | 2 +- test/test-package.script | 2 +- test/test-retry-loading-component-1.script | 2 +- test/test-static-and-serial.script | 5 ++- test/test-touch-system-1.script | 2 +- test/test-touch-system-2.script | 2 +- test/test-try-recompiling-1.script | 5 ++- test/test-version.script | 2 +- test/test1.script | 8 ++-- test/test2.script | 10 +++-- test/test3.script | 2 +- test/test4.script | 2 +- test/test8.script | 7 +++- test/test9.script | 6 ++- test/wild-module.script | 2 +- website/source/git.mmd | 47 ++++++++++++++++++++++ 19 files changed, 89 insertions(+), 28 deletions(-) create mode 100644 website/source/git.mmd diff --git a/test/run-tests.sh b/test/run-tests.sh index a29c2fb5f..bff1c3ced 100755 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -84,12 +84,12 @@ elif [ "$lisp" = "clisp" ] ; then elif [ "$lisp" = "allegro" ] ; then if type alisp ; then fasl_ext="fasl" - command="alisp -q --batch " + command="alisp -q -batch " fi elif [ "$lisp" = "allegromodern" ] ; then if type mlisp ; then fasl_ext="fasl" - command="mlisp -q --batch " + command="mlisp -q -batch " fi elif [ "$lisp" = "ccl" ] ; then if type ccl ; then diff --git a/test/script-support.lisp b/test/script-support.lisp index 64f482b91..46540fd43 100644 --- a/test/script-support.lisp +++ b/test/script-support.lisp @@ -27,7 +27,7 @@ (error "Don't know how to quit Lisp; wanting to use exit code ~a" return)) -(defmacro exit-on-error (&body body) +(defmacro quit-on-error (&body body) `(handler-case (progn ,@body (leave-lisp "Script succeeded" 0)) diff --git a/test/test-force.script b/test/test-force.script index 02612190e..4d211c66c 100644 --- a/test/test-force.script +++ b/test/test-force.script @@ -1,12 +1,13 @@ ;;; -*- Lisp -*- (load "script-support") (load "../asdf") -(exit-on-error +(quit-on-error (setf asdf:*central-registry* '(*default-pathname-defaults*)) (asdf:operate 'asdf:load-op 'test-force) - (defvar file1-date (file-write-date (compile-file-pathname "file1"))) + (defvar file1-date (file-write-date (compile-file-pathname "file1")))) +(quit-on-error ;; unforced, date should stay same (sleep 1) (asdf:operate 'asdf:load-op 'test-force) diff --git a/test/test-nested-components.script b/test/test-nested-components.script index 44ebe360a..0ec92eb19 100644 --- a/test/test-nested-components.script +++ b/test/test-nested-components.script @@ -6,7 +6,7 @@ (load "../asdf") (in-package #:common-lisp-user) -(exit-on-error +(quit-on-error (setf asdf:*central-registry* nil) (load (merge-pathnames "test-nested-components-1.asd")) (print diff --git a/test/test-package.script b/test/test-package.script index a452a8fd7..7fe534d67 100644 --- a/test/test-package.script +++ b/test/test-package.script @@ -2,7 +2,7 @@ ;;; -*- Lisp -*- (load "script-support") (load "../asdf") -(exit-on-error +(quit-on-error (defun module () 1) diff --git a/test/test-retry-loading-component-1.script b/test/test-retry-loading-component-1.script index a445cf015..995ef442c 100644 --- a/test/test-retry-loading-component-1.script +++ b/test/test-retry-loading-component-1.script @@ -9,7 +9,7 @@ ;#+allegro ;(trace excl.osi:command-output) (defvar *caught-error* nil) -(exit-on-error +(quit-on-error (when (probe-file "try-reloading-dependency.asd") (asdf:run-shell-command "rm -f ~A" (namestring "try-reloading-dependency.asd"))) diff --git a/test/test-static-and-serial.script b/test/test-static-and-serial.script index a61f0da9f..cd100f034 100644 --- a/test/test-static-and-serial.script +++ b/test/test-static-and-serial.script @@ -1,12 +1,13 @@ ;;; -*- Lisp -*- (load "script-support") (load "../asdf") -(exit-on-error +(quit-on-error (setf asdf:*central-registry* '(*default-pathname-defaults*)) (asdf:operate 'asdf:load-op 'static-and-serial) - (defvar file1-date (file-write-date (compile-file-pathname "file1"))) + (defvar file1-date (file-write-date (compile-file-pathname "file1")))) +(quit-on-error ;; cheat (setf asdf::*defined-systems* (make-hash-table :test 'equal)) diff --git a/test/test-touch-system-1.script b/test/test-touch-system-1.script index 7c3aa3abd..356c7a912 100644 --- a/test/test-touch-system-1.script +++ b/test/test-touch-system-1.script @@ -5,7 +5,7 @@ (load "script-support") (load "../asdf") -(exit-on-error +(quit-on-error (flet ((system-load-time (name) (let ((data (asdf::system-registered-p name))) (when data diff --git a/test/test-touch-system-2.script b/test/test-touch-system-2.script index 82511d2e0..56d5d829b 100644 --- a/test/test-touch-system-2.script +++ b/test/test-touch-system-2.script @@ -5,7 +5,7 @@ (load "script-support") (load "../asdf") -(exit-on-error +(quit-on-error (flet ((system-load-time (name) (let ((data (asdf::system-registered-p name))) (when data diff --git a/test/test-try-recompiling-1.script b/test/test-try-recompiling-1.script index e6630cc39..5ee2ccb17 100644 --- a/test/test-try-recompiling-1.script +++ b/test/test-try-recompiling-1.script @@ -4,11 +4,12 @@ (load "script-support") (load "../asdf") -(exit-on-error +(defvar *caught-error* nil) + +(quit-on-error (asdf:run-shell-command "rm -f ~A" (namestring (compile-file-pathname "try-recompiling-1"))) - (defvar *caught-error* nil) (setf asdf:*central-registry* '(*default-pathname-defaults*)) (handler-bind ((error (lambda (c) (setf *caught-error* t) diff --git a/test/test-version.script b/test/test-version.script index 76dbef279..5b4497c1c 100644 --- a/test/test-version.script +++ b/test/test-version.script @@ -8,7 +8,7 @@ (in-package :test-version-system) -(cl-user::exit-on-error +(cl-user::quit-on-error (defsystem :versioned-system-1 :pathname #.*default-pathname-defaults* :version "1.0") diff --git a/test/test1.script b/test/test1.script index 723b4a5b2..b6f2fc9e7 100644 --- a/test/test1.script +++ b/test/test1.script @@ -1,18 +1,20 @@ ;;; -*- Lisp -*- (load "script-support") (load "../asdf") -(exit-on-error +(quit-on-error (setf asdf:*central-registry* '(*default-pathname-defaults*)) (asdf:operate 'asdf:load-op 'test1) ;; test that it compiled - (defvar file1-date (file-write-date (compile-file-pathname "file1"))) + (defvar file1-date (file-write-date (compile-file-pathname "file1")))) + +(quit-on-error (assert (and file1-date (file-write-date (compile-file-pathname "file2"))))) ;; and loaded (assert test-package::*file1*) -(exit-on-error +(quit-on-error ;; now remove one output file and check that the other is _not_ ;; recompiled (sleep 1) ; mtime has 1-second granularity, so pause here for fast machines diff --git a/test/test2.script b/test/test2.script index 0ac277f29..781fd3178 100644 --- a/test/test2.script +++ b/test/test2.script @@ -1,7 +1,7 @@ ;;; -*- Lisp -*- (load "script-support") (load "../asdf") -(exit-on-error +(quit-on-error (setf asdf:*central-registry* '(*default-pathname-defaults*)) ;(trace asdf::perform) ;(trace asdf::find-component) @@ -13,10 +13,14 @@ (asdf:oos 'asdf:load-op 'test2b2) (asdf:missing-dependency (c) (format t "load failed as expected: - ~%~A~%" c)) - (:no-error (c) (error "should have failed, oops"))) + (:no-error (c) + (declare (ignore c)) + (error "should have failed, oops"))) (handler-case (asdf:oos 'asdf:load-op 'test2b3) (asdf:missing-dependency (c) (format t "load failed as expected: - ~%~A~%" c)) - (:no-error (c) (error "should have failed, oops"))) + (:no-error (c) + (declare (ignore c)) + (error "should have failed, oops"))) ) \ No newline at end of file diff --git a/test/test3.script b/test/test3.script index 2a53d49ea..3020fdac4 100644 --- a/test/test3.script +++ b/test/test3.script @@ -4,7 +4,7 @@ (load "script-support") (load "../asdf") (in-package :asdf) -(cl-user::exit-on-error +(cl-user::quit-on-error (let ((fasl1 (compile-file-pathname (merge-pathnames "file1"))) (fasl2 (compile-file-pathname (merge-pathnames "file2")))) (asdf:run-shell-command "rm -f ~A ~A" diff --git a/test/test4.script b/test/test4.script index be3186380..0c549fb86 100644 --- a/test/test4.script +++ b/test/test4.script @@ -3,7 +3,7 @@ (load "script-support") (load "../asdf") (in-package :asdf) -(cl-user::exit-on-error +(cl-user::quit-on-error (setf asdf:*central-registry* '(*default-pathname-defaults*)) (assert (not (component-property (find-system 'test3) :foo))) (assert (equal (component-property (find-system 'test3) :prop1) "value")) diff --git a/test/test8.script b/test/test8.script index 9950420d2..bf07b217f 100644 --- a/test/test8.script +++ b/test/test8.script @@ -6,14 +6,17 @@ (load "../asdf") (in-package #:common-lisp-user) -(exit-on-error +(quit-on-error (setf asdf:*central-registry* '(*default-pathname-defaults*)) (handler-case (asdf:oos 'asdf:load-op 'system-does-not-exist) (asdf:missing-component-of-version (c) + (declare (ignore c)) (error "Should not have gotten 'missing-component-of-version, dang")) (asdf:missing-component (c) (format t "got missing-component as expected: - ~%~A~%" c)) - (:no-error (c) (error "should have failed, oops")))) + (:no-error (c) + (declare (ignore c)) + (error "should have failed, oops")))) diff --git a/test/test9.script b/test/test9.script index bec42e762..f819c49f8 100644 --- a/test/test9.script +++ b/test/test9.script @@ -6,7 +6,7 @@ (load "../asdf") (in-package #:common-lisp-user) -(exit-on-error +(quit-on-error (setf asdf:*central-registry* nil) (load (merge-pathnames "test9-1.asd")) (load (merge-pathnames "test9-2.asd")) @@ -14,7 +14,9 @@ (asdf:oos 'asdf:load-op 'test9-1) (asdf:missing-component-of-version (c) (format t "got missing-component-of-version as expected: - ~%~A~%" c)) - (:no-error (c) (error "should have failed, oops")))) + (:no-error (c) + (declare (ignore c)) + (error "should have failed, oops")))) diff --git a/test/wild-module.script b/test/wild-module.script index 4a618007a..c45a95bfb 100644 --- a/test/wild-module.script +++ b/test/wild-module.script @@ -1,7 +1,7 @@ ;;; -*- Lisp -*- (load "script-support") (load "../asdf") -(exit-on-error +(quit-on-error (load "../asdf") (load "../wild-modules") diff --git a/website/source/git.mmd b/website/source/git.mmd new file mode 100644 index 000000000..35483d2b2 --- /dev/null +++ b/website/source/git.mmd @@ -0,0 +1,47 @@ +## git recipes + + + + > Alternatively, would someone please provide simple recipes for dealing + > with git? It's really far more complex than CVS, and I don't see + > obvious patterns of interaction to do simple things like restore + > synchronization with the central repo. + + git fetch origin + downloads latest commits + git reset --hard origin/master + nukes all local changes, synchronizing with the remote repo + +## git resources + +Here are a few links that might be helpful to people learning +git. Its culturally different than CVS; but once you learn +it, there's no turning back. The ability to experiment with +local branches, back up, rewrite history, and only publish +the sanitized history is quite liberating. + +* http://progit.org/book/ (recommended) +* http://tomayko.com/writings/the-thing-about-git +* http://git-scm.com/documentation +* http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html +* http://www.kernel.org/pub/software/scm/git/docs/everyday.html +* http://www.kernel.org/pub/software/scm/git/docs/user-manual.html + +My suggestions + +* always have `gitk --all` loaded for the repo you're working on + +* update (not reload) `gitk` after modifying any branches or + tags; this leaves the old objects displayed + +* `git reset --hard $OLDSHA1` can clean many messes, letting + you try again. + +* reload gitk to hide deleted branches you're comfortable + with losing + +* learn by playing around with local clones of a larger + repository + +* install some of the git contribs, especially + git-completion.bash and git-new-workdir -- GitLab