From f72077549c2352a73b8dae603d6e4fe7df03080c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Sun, 7 Aug 2016 17:19:01 +0200 Subject: [PATCH] tests: simplify make target --- src/tests/Makefile.in | 41 ++++++++--------------------------------- src/tests/config.lsp.in | 41 +++++++++++++---------------------------- src/tests/doit.lsp | 10 ++++++++++ 3 files changed, 31 insertions(+), 61 deletions(-) create mode 100644 src/tests/doit.lsp diff --git a/src/tests/Makefile.in b/src/tests/Makefile.in index 7cc820c83..7189030a7 100755 --- a/src/tests/Makefile.in +++ b/src/tests/Makefile.in @@ -3,40 +3,15 @@ ECL=@prefix@/@bindir@/ecl@EXEEXT@ -all: show-fails +.PHONY: all -.PHONY: do-regressions cleanup clean-sources update +all: check -BUGS_FILES := $(shell find ../../src/tests/regressions/ -type f) +check: config.lsp + $(ECL) -norc -load config.lsp \ + -eval '(ecl-tests::run-regressions-tests)' \ + -eval '(ext:quit)' \ + 2>&1 | tee check.log -regressions.log: config.lsp - $(MAKE) do-regressions - -do-regressions: regressions config.lsp - $(ECL) -norc -load config.lsp -eval '(ecl-tests::run-regressions-tests)' -eval '(ext:quit)' 2>&1 | tee regressions.log - -show-fails: regressions.log - tail -n 16 regressions.log - -# -# Create directories -# -regressions: config.lsp $(BUGS_FILES) - $(ECL) -norc -load config.lsp -eval '(ecl-tests::ensure-regressions)' -eval '(ext:quit)' < /dev/null - -# -# Cleanup -# clean: - rm -rf regressions.log - -clean-sources: - test -f config.lsp.in || rm -rf bugs - rm -rf regressions - -distclean: clean-sources clean - rm -rf cache - -update: clean-sources - $(MAKE) regressions - + rm -rf regressions.log cache diff --git a/src/tests/config.lsp.in b/src/tests/config.lsp.in index 3d535ab95..4ab1e8c8f 100755 --- a/src/tests/config.lsp.in +++ b/src/tests/config.lsp.in @@ -3,6 +3,7 @@ ;;; ;;; (c) 2011, Juan Jose Garcia-Ripoll +;;; (c) 2016, Daniel KochmaƄski ;;; ;;; Set up the test environment. ;;; @@ -23,32 +24,26 @@ (defvar *test-sources* (merge-pathnames "tests/" *ecl-sources*)) (defvar *here* (merge-pathnames "@builddir@/")) - (defvar *cache* (merge-pathnames "./cache/" *here*)) -(defvar *test-image* (or (ext:getenv "TEST_IMAGE") - #+windows - (namestring (truename #+windows "sys:ecl.exe")) - #-windows - "@prefix@/bin/ecl")) +(defvar *test-image* + (or (ext:getenv "TEST_IMAGE") + #+windows (namestring (truename "sys:ecl.exe")) + #-windows "@prefix@/bin/ecl")) (defvar *test-image-args* - (cond ((search "ecl" *test-image*) - '("-norc" "-eval" "(print (ext:getenv \"ECLDIR\"))" - ;#+windows "-eval" #+windows "(require :cmp)" - )) - ((search "sbcl" *test-image*) - '("--no-userinit" "--no-sysinit")) - (t - '()))) + `("-norc" + "-eval" "(print (ext:getenv \"ECLDIR\"))" + "-eval" "(ignore-errors (require :cmp))" + "-load" ,(namestring (merge-pathnames "doit.lsp" *test-sources*)) + "-eval" "(quit)")) #+ecl (ext:setenv "ECLDIR" (namestring (truename "SYS:"))) (defvar *test-name* (or (ext:getenv "TEST_NAME") "ecl")) -(defvar *output-directory* *here*) -(defvar *regressions-sources* (merge-pathnames "regressions/" *test-sources*)) -(defvar *regressions-sandbox* (merge-pathnames "regressions/" *here*)) +(defvar *regressions-sources* *test-sources*) +(defvar *regressions-sandbox* *here*) (defvar *wild-inferiors* (make-pathname :name :wild :type :wild :version :wild @@ -68,19 +63,10 @@ (merge-pathnames "**/*.*" (lisp-system-directory))))) -(require :cmp) - ;;; ;;; PREPARATION OF DIRECTORIES AND FILES ;;; -(defun setup-asdf () - (require :asdf) - (ensure-directories-exist *cache*) - (setf (symbol-value (read-from-string "asdf::*user-cache*")) - (list *cache* :implementation))) - - (defun delete-everything (path) ;; Recursively run through children (labels ((recursive-deletion (path) @@ -116,7 +102,6 @@ (unless (probe-file *regressions-sandbox*) (copy-directory *regressions-sources* *regressions-sandbox*))) - (defun cleanup-directory (path) (loop for i in (directory (merge-pathnames *wild-inferiors* path)) @@ -136,7 +121,7 @@ (ext:chdir *regressions-sandbox*) (ext:run-program *test-image* *test-image-args* - :input (merge-pathnames "doit.lsp" *regressions-sandbox*) + :input nil ; (merge-pathnames "doit.lsp" *regressions-sources*) :output t :error :output)) (ext:chdir *here*))) diff --git a/src/tests/doit.lsp b/src/tests/doit.lsp new file mode 100644 index 000000000..48c23f2df --- /dev/null +++ b/src/tests/doit.lsp @@ -0,0 +1,10 @@ +(eval-when (:compile-toplevel :load-toplevel :execute) + (require :asdf)) + +(let ((cache (merge-pathnames "./cache/" *default-pathname-defaults*))) + (ensure-directories-exist cache) + (setf asdf:*user-cache* cache) + (asdf:load-asd (merge-pathnames "ecl-tests.asd" *load-pathname*))) + +(asdf:operate 'asdf:load-source-op 'ecl-tests) +(2am-ecl:run 'cl-test::regressions)