Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
b48c2352
Commit
b48c2352
authored
10 years ago
by
Raymond Toy
Browse files
Options
Downloads
Patches
Plain Diff
Add function to run selected tests. Makes it a bit easier to run a
selected set instead of all tests.
parent
074f4d0b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/run-tests.lisp
+20
-4
20 additions, 4 deletions
tests/run-tests.lisp
with
20 additions
and
4 deletions
tests/run-tests.lisp
+
20
−
4
View file @
b48c2352
...
@@ -5,6 +5,11 @@
...
@@ -5,6 +5,11 @@
;;;;
;;;;
;;;; lisp -noinit -load tests/run-tests.lisp -eval '(cmucl-test-runner:run-all-tests)'
;;;; lisp -noinit -load tests/run-tests.lisp -eval '(cmucl-test-runner:run-all-tests)'
;;;;
;;;;
;;;;
;;;; To run selected tests:
;;;;
;;;; lisp -noinit -load tests/run-tests.lisp -eval '(progn (cmucl-test-runner:load-test-files) (cmucl-test-runner:run-test <list>))'
;;;;
;;;; Note that you cannot run these tests from a binary created during
;;;; Note that you cannot run these tests from a binary created during
;;;; a build process. You must run
;;;; a build process. You must run
;;;;
;;;;
...
@@ -25,6 +30,7 @@
...
@@ -25,6 +30,7 @@
#:load-test-files
#:load-test-files
#:run-loaded-tests
#:run-loaded-tests
#:run-all-tests
#:run-all-tests
#:run-test
#:print-test-results
))
#:print-test-results
))
(
in-package
:cmucl-test-runner
)
(
in-package
:cmucl-test-runner
)
...
@@ -65,8 +71,16 @@
...
@@ -65,8 +71,16 @@
test-results
))
test-results
))
(
nreverse
test-results
)))
(
nreverse
test-results
)))
;; Run selected tests
(
defun
run-test
(
&rest
tests
)
(
let
(
test-results
)
(
dolist
(
test
tests
)
(
push
(
lisp-unit:run-tests
:all
test
)
test-results
))
(
print-test-results
(
nreverse
test-results
)
:verbose
t
)))
;; Print out a summary of test results produced from RUN-LOADED-TESTS.
;; Print out a summary of test results produced from RUN-LOADED-TESTS.
(
defun
print-test-results
(
results
&key
verbose
)
(
defun
print-test-results
(
results
&key
verbose
exitp
)
(
let
((
passed
0
)
(
let
((
passed
0
)
(
failed
0
)
(
failed
0
)
(
execute-errors
0
)
(
execute-errors
0
)
...
@@ -106,9 +120,11 @@
...
@@ -106,9 +120,11 @@
(
format
t
"~2&Execute failures: ~S~%"
execute-error-tests
)
(
format
t
"~2&Execute failures: ~S~%"
execute-error-tests
)
(
dolist
(
result
results
)
(
dolist
(
result
results
)
(
lisp-unit:print-errors
result
)))
(
lisp-unit:print-errors
result
)))
(
unix:unix-exit
1
))
(
when
exitp
(
unix:unix-exit
1
)))
(
t
(
t
(
unix:unix-exit
0
)))))
(
when
exitp
(
unix:unix-exit
0
))))))
;; Look through all the files in the TEST-DIRECTORY and load them.
;; Look through all the files in the TEST-DIRECTORY and load them.
;; Then run all of the tests. For each file, it ia assumed that a
;; Then run all of the tests. For each file, it ia assumed that a
...
@@ -116,7 +132,7 @@
...
@@ -116,7 +132,7 @@
;; pathname-name of the file.
;; pathname-name of the file.
(
defun
run-all-tests
(
&key
(
test-directory
#P"tests/"
)
(
verbose
t
))
(
defun
run-all-tests
(
&key
(
test-directory
#P"tests/"
)
(
verbose
t
))
(
load-test-files
test-directory
)
(
load-test-files
test-directory
)
(
print-test-results
(
run-loaded-tests
)
:verbose
t
))
(
print-test-results
(
run-loaded-tests
)
:verbose
t
:exitp
t
))
;;(run-all-tests)
;;(run-all-tests)
;;(quit)
;;(quit)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment