Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not run test code on compile, but run when load #523

Merged
merged 3 commits into from
Sep 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions irteus/test/all-robots-objects.l
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
'("robots" "objects" "scenes")
'(make-all-robots make-all-objects make-all-scenes))

(run-all-tests)
(exit)
(eval-when (load eval)
(run-all-tests)
(exit))
6 changes: 4 additions & 2 deletions irteus/test/coords.l
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@
(format *error-output* "~A gc:~A, vmrss:~A -> ~A~%" j (sys::gc) vmrss-orig vmrss)
(assert (< vmrss (* 2 vmrss-orig)) "make-coords quaternion2matrix")))

(run-all-tests)
(exit)

(eval-when (load eval)
(run-all-tests)
(exit))
5 changes: 3 additions & 2 deletions irteus/test/geo.l
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
-0.2))
)

(run-all-tests)
(exit)
(eval-when (load eval)
(run-all-tests)
(exit))

18 changes: 11 additions & 7 deletions irteus/test/graph.l
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,16 @@
"(send directed-graph :clear-nodes) success")
))


(defclass costed-node
:super node)
(defmethod costed-node
(:cost () 0))
(deftest test-graph ()
(defmethod node
(:cost () 0))
;; re-define method within defun is not working with compile
;; (defmethod node
;; (:cost () 0))
(let ((gr (instance graph :init)) ar
(a (instance node :init 'a)) (b (instance node :init 'b)))
(a (instance costed-node :init 'a)) (b (instance costed-node :init 'b)))
(send gr :add-node a)
(send gr :add-node b)
(setq ar (send gr :add-arc-from-to a b))
Expand Down Expand Up @@ -119,6 +123,6 @@
))


(run-all-tests)

(exit)
(eval-when (load eval)
(run-all-tests)
(exit))
5 changes: 3 additions & 2 deletions irteus/test/interpolator.l
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,6 @@
(print (length r2))
|#

(run-all-tests)
(exit)
(eval-when (load eval)
(run-all-tests)
(exit))
5 changes: 3 additions & 2 deletions irteus/test/irteus-demo.l
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,6 @@
(assert
(look-at-ik-all)))

(run-all-tests)
(exit)
(eval-when (load eval)
(run-all-tests)
(exit))
5 changes: 3 additions & 2 deletions irteus/test/joint.l
Original file line number Diff line number Diff line change
Expand Up @@ -289,5 +289,6 @@
(deftest test-make-joint-min-max-table-margin-5deg
(assert (test-make-joint-min-max-table-common :margin 5)))

(run-all-tests)
(exit)
(eval-when (load eval)
(run-all-tests)
(exit))
5 changes: 3 additions & 2 deletions irteus/test/mathtest.l
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,6 @@
(assert (eps-matrix= (m* m6 vec) (m* vec (diagonal val))) "ql-decompose")
))

(run-all-tests)
(exit)
(eval-when (load eval)
(run-all-tests)
(exit))
5 changes: 3 additions & 2 deletions irteus/test/matrix.l
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,6 @@
(apply #'concatenate-matrix-column-naive-impl mats))))
))

(run-all-tests)
(exit)
(eval-when (load eval)
(run-all-tests)
(exit))
5 changes: 3 additions & 2 deletions irteus/test/read-img.l
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
))
))

(run-all-tests)
(exit)
(eval-when (load eval)
(run-all-tests)
(exit))

5 changes: 3 additions & 2 deletions irteus/test/rendering.l
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"image transposed twice must be the same as original image")
)

(run-all-tests)
(exit)
(eval-when (load eval)
(run-all-tests)
(exit))

5 changes: 3 additions & 2 deletions irteus/test/robot-model-usage.l
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,6 @@
))


(run-all-tests)
(exit)
(eval-when (load eval)
(run-all-tests)
(exit))
9 changes: 7 additions & 2 deletions irteus/test/test-irt-motion.l
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,7 @@
(assert (every #'identity
(mapcar #'(lambda (dc) (test-load-ik-debug-information-log-common dc)) '(t :always :always-with-debug-log nil)))))

(eval-when (eval) ;; redefine method within class is not run for compiled code)
(deftest test-all-for-arm-robot-static-1
(assert
(test-all-for-sample-multidof-arm-robot :static-p t :fix-pos #f(0 0 0))))
Expand All @@ -934,6 +935,7 @@
(deftest test-all-for-sample-robot-static-2
(assert
(test-all-for-sample-robot :static-p t :fix-pos #f(100 200 300))))
)

(deftest test-self-collision-check-IK-test
(assert
Expand Down Expand Up @@ -1135,6 +1137,7 @@
)

;; Check :cog-translation-axis dimension bug
(eval-when (eval) ;; redefine method within class is not run for compiled code)
(deftest test-cog-translation-axis-dim
(unwind-protect
(progn
Expand Down Expand Up @@ -1175,6 +1178,8 @@
(dif-pos dif-rot &rest args &key ik-args &allow-other-keys)
(send* self :inverse-kinematics-loop-org dif-pos dif-rot :ik-args ik-args args)))
))
)

(run-all-tests)
(exit 0)
(eval-when (load eval)
(run-all-tests)
(exit 0))
5 changes: 3 additions & 2 deletions irteus/test/test-pointcloud.l
Original file line number Diff line number Diff line change
Expand Up @@ -294,5 +294,6 @@
(move-origin-to-check)
)

(run-all-tests)
(exit)
(eval-when (load eval)
(run-all-tests)
(exit))
5 changes: 3 additions & 2 deletions irteus/test/transparent.l
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@
(assert (< vmrss (* 4 vmrss-orig)) "check memory leak")
)))

(run-all-tests)
(exit)
(eval-when (load eval)
(run-all-tests)
(exit))