mirror of
https://github.com/roswell/roswell.git
synced 2026-09-10 07:16:17 -04:00
test roswell's functions
This commit is contained in:
parent
57cf146236
commit
d1c7a5bd9e
|
|
@ -86,7 +86,8 @@ script:
|
||||||
- if [ "$METHOD" = "brew" ] || [ "$METHOD" = "ci" ]; then ros version; fi
|
- if [ "$METHOD" = "brew" ] || [ "$METHOD" = "ci" ]; then ros version; fi
|
||||||
- if [ "$METHOD" = "brew" ] || [ "$METHOD" = "ci" ]; then ros version=t run; fi
|
- if [ "$METHOD" = "brew" ] || [ "$METHOD" = "ci" ]; then ros version=t run; fi
|
||||||
- if [ "$METHOD" = "brew" ] || [ "$METHOD" = "ci" ]; then ros config; fi
|
- if [ "$METHOD" = "brew" ] || [ "$METHOD" = "ci" ]; then ros config; fi
|
||||||
- if [ "$METHOD" = "brew" ] || [ "$METHOD" = "ci" ]; then ros -s prove-asdf -s quri-test -e "(asdf:test-system :quri-test)"; fi
|
- if [ "$METHOD" = "brew" ] || [ "$METHOD" = "ci" ]; then ros install prove; fi
|
||||||
|
- if [ "$METHOD" = "brew" ] || [ "$METHOD" = "ci" ]; then run-prove roswell-test.asd; fi
|
||||||
- if [ "$METHOD" = "ci" ]; then ros -q run && [`ros -q run 2>&1` == ""]; fi
|
- if [ "$METHOD" = "ci" ]; then ros -q run && [`ros -q run 2>&1` == ""]; fi
|
||||||
- if [ "$METHOD" = "ci" ] && [ "$LISP" = "sbcl-bin" ]; then [`ros -e "(ros:ignore-shebang)" -e '(loop for x in (directory "src/lisp/*.ros") do (load x))' 2>&1` == ""]; fi
|
- if [ "$METHOD" = "ci" ] && [ "$LISP" = "sbcl-bin" ]; then [`ros -e "(ros:ignore-shebang)" -e '(loop for x in (directory "src/lisp/*.ros") do (load x))' 2>&1` == ""]; fi
|
||||||
- if [ x$TRAVIS_TAG != x ] && [ $METHOD = debian ]; then ros ./scripts/debian.ros; fi
|
- if [ x$TRAVIS_TAG != x ] && [ $METHOD = debian ]; then ros ./scripts/debian.ros; fi
|
||||||
|
|
|
||||||
19
roswell-test.asd
Normal file
19
roswell-test.asd
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
#-asdf
|
||||||
|
(require :asdf)
|
||||||
|
|
||||||
|
(in-package :cl-user)
|
||||||
|
(defpackage roswell-test-asd
|
||||||
|
(:use :cl :asdf))
|
||||||
|
(in-package :roswell-test-asd)
|
||||||
|
|
||||||
|
(defsystem roswell-test
|
||||||
|
:author "SANO Masatoshi"
|
||||||
|
:license "MIT"
|
||||||
|
:depends-on (:prove)
|
||||||
|
:components ((:module "t"
|
||||||
|
:components
|
||||||
|
((:file "ros"))))
|
||||||
|
:defsystem-depends-on (:prove-asdf)
|
||||||
|
:perform (test-op :after (op c)
|
||||||
|
(funcall (intern #.(string :run-test-system) :prove-asdf) c)
|
||||||
|
(asdf:clear-system c)))
|
||||||
43
t/ros.lisp
Normal file
43
t/ros.lisp
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
(in-package :cl-user)
|
||||||
|
(defpackage roswell-test
|
||||||
|
(:use :cl
|
||||||
|
:ros
|
||||||
|
:prove)
|
||||||
|
(:shadowing-import-from :ros :run))
|
||||||
|
(in-package :roswell-test)
|
||||||
|
|
||||||
|
(plan nil)
|
||||||
|
|
||||||
|
(ok (getenv "USER") "(getenv \"USER\")")
|
||||||
|
(ok (not (getenv "NON_EXITS_ENV")) "(getenv \"NON_EXITS_ENV\") return nil if key not exist")
|
||||||
|
(is (progn
|
||||||
|
(setenv "NON_EXITS_ENV" "hoge")
|
||||||
|
(getenv "NON_EXITS_ENV"))
|
||||||
|
"hoge"
|
||||||
|
"(setenv \"NON_EXITS_ENV\")")
|
||||||
|
|
||||||
|
(ok (progn
|
||||||
|
(unsetenv "NON_EXITS_ENV")
|
||||||
|
(not (getenv "NON_EXITS_ENV")))
|
||||||
|
"(unsetenv \"NON_EXITS_ENV\")")
|
||||||
|
|
||||||
|
(ok (not (zerop (length (roswell '("roswell-internal-use" "uname") :string :trim))))
|
||||||
|
"ros:roswell uname return something")
|
||||||
|
|
||||||
|
(ok (every (lambda (x) (or (digit-char-p x)
|
||||||
|
(eql x #\.))) (version))
|
||||||
|
"ros:version returns [0-9.]*")
|
||||||
|
|
||||||
|
(ok (opt "impl") "(ros:opt \"impl\") return something")
|
||||||
|
|
||||||
|
#+(and test are required someday)
|
||||||
|
(ros:ensure-using-downloaded-asdf
|
||||||
|
ros:exec
|
||||||
|
ros:ignore-shebang
|
||||||
|
ros:quicklisp
|
||||||
|
ros:quit
|
||||||
|
ros:script
|
||||||
|
ros:util
|
||||||
|
ros:with-lock-held)
|
||||||
|
|
||||||
|
(finalize)
|
||||||
Loading…
Reference in a new issue