before_install:
- export DISPLAY=:99.0
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x24
- - wget http://frank.kank.net/travissbcl/clnl/a66006d/$(git rev-parse HEAD)/travissbcl
+ - wget http://frank.kank.net/travissbcl/clnl/6e06e22/$(git rev-parse HEAD)/travissbcl
- chmod +x travissbcl
script:
- - ./travissbcl --dynamic-space-size 3072 --script bin/all.lisp
+ - ./travissbcl --dynamic-space-size 4096 --script bin/all.lisp
mkdir -p tmp/deps/
( cd tmp/deps &&
- tar zxf ../../deps/common-lisp/clnl-gltk_0.1.tar.gz &&
+ tar zxf ../../deps/common-lisp/clnl-gltk_0.2.tar.gz &&
tar zxf ../../deps/common-lisp/3b-cl-opengl-993d627.tar.gz &&
tar zxf ../../deps/common-lisp/alexandria-b1c6ee0.tar.gz &&
tar zxf ../../deps/common-lisp/babel_0.5.0.tar.gz &&
mkdir -p tmp/deps/
( cd tmp/deps &&
- tar zxf ../../deps/common-lisp/clnl-gltk_0.1.tar.gz &&
+ tar zxf ../../deps/common-lisp/clnl-gltk_0.2.tar.gz &&
tar zxf ../../deps/common-lisp/3b-cl-opengl-993d627.tar.gz &&
tar zxf ../../deps/common-lisp/alexandria-b1c6ee0.tar.gz &&
tar zxf ../../deps/common-lisp/babel_0.5.0.tar.gz &&
tar zxf ../../deps/common-lisp/nibbles-v0.12.tar.gz &&
tar zxf ../../deps/common-lisp/trivial-features_0.8.tar.gz &&
tar zxf ../../deps/common-lisp/style-checker_0.1.tar.gz &&
- tar zxf ../../deps/common-lisp/clnl-gltk_0.1.tar.gz &&
+ tar zxf ../../deps/common-lisp/clnl-gltk_0.2.tar.gz &&
tar zxf ../../deps/common-lisp/docgen_0.3.tar.gz &&
tar zxf ../../deps/common-lisp/ieee-floats-92e481a.tar.gz &&
tar zxf ../../deps/common-lisp/strictmath_0.1.tar.gz
mkdir -p tmp/deps/
( cd tmp/deps &&
- tar zxf ../../deps/common-lisp/clnl-gltk_0.1.tar.gz &&
+ tar zxf ../../deps/common-lisp/clnl-gltk_0.2.tar.gz &&
tar zxf ../../deps/common-lisp/3b-cl-opengl-993d627.tar.gz &&
tar zxf ../../deps/common-lisp/alexandria-b1c6ee0.tar.gz &&
tar zxf ../../deps/common-lisp/babel_0.5.0.tar.gz &&
to go
ask turtles [ fd 1 ]
end
+
+to create-and-move
+ if 40 < count turtles [ stop ]
+ crt 1
+ ask turtles [ fd 1 ]
+end
@#$#@#$#@
GRAPHICS-WINDOW
219
NIL
1
+BUTTON
+66
+276
+161
+309
+stopping
+create-and-move
+T
+1
+T
+OBSERVER
+NIL
+NIL
+NIL
+NIL
+1
+
@#$#@#$#@
## WHAT IS IT?
(loop
:while (find button *enabled-forever-buttons* :test #'equal)
; The sleep is necessary so that it gives other threads time
- :do (progn (clnl:run-commands (button-code button)) (sleep .001))))
+ :do
+ (let
+ ((result (funcall *current-callback* (button-code button))))
+ (when (eql :stop result)
+ (setf *enabled-forever-buttons* (remove button *enabled-forever-buttons* :test #'equal)))
+ (sleep .001))))
:name (format nil "Forever button: ~A" (button-display button))))
(t (funcall *current-callback* (button-code button)))))))
(defmacro defmodelreportertest (name model commands reporter value checksum)
`(defmodeltest (format nil "Model Reporter - ~A" ,name) ,model ,commands ,reporter ,value ,checksum))
-(defmacro defmodelfiletest (name file commands checksum)
+(defun wait-for-forever ()
+ (loop
+ :while
+ (find-if
+ (lambda (name) (cl-ppcre:scan "Forever button:" name))
+ (mapcar #'sb-thread:thread-name (sb-thread:list-all-threads)))
+ :do (sleep .1)))
+
+(defmacro defmodelfiletest (name file commands checksum &optional wait-for-forever)
`(defsimpletest
,(format nil "File Model - ~A" name)
(lambda ()
(declaim (sb-ext:muffle-conditions cl:warning))
(eval (clnl:model->single-form-lisp model :netlogo-callback (lambda (f) (setf callback f))))
(when ,(clnl-commands commands) (funcall callback ,(clnl-commands commands)))
+ ,(when wait-for-forever `(wait-for-forever))
(checksum= ,checksum (checksum-world)))
(let*
((pkg (make-package (gensym)))
(funcall (symbol-function (intern "BOOT-ME" pkg)))
(when ,(clnl-commands commands)
(funcall (symbol-function (intern "NETLOGO-CALLBACK" pkg)) ,(clnl-commands commands)))
+ ,(when wait-for-forever `(wait-for-forever))
(checksum= ,checksum (checksum-world))))))
(lambda ()
(let
(with-open-file (str ,file) (clnl-model:read-from-nlogo str))
:netlogo-callback (lambda (f) (setf callback f))))
(when ,(clnl-commands commands) (funcall callback ,(clnl-commands commands)))
+ ,(when wait-for-forever `(wait-for-forever))
(format nil "~A~A"
(clnl-nvm:export-world)
(checksum-world))))
(":button \"setup\" :button \"go\" 1" "crt 10 go ask turtles [ rt 90 ] go")
"4E0128F172B4D0085186E49FDBD7014F6E365ED7")
+(defmodelfiletest "UI 4" "resources/UI-test.nlogo"
+ (":button \"stopping\"" "repeat 80 [ create-and-move ]")
+ "749DC971517EDE9020BF125D0F362A978980272F"
+ t)
+
(defmodelfiletest "Wolf Sheep 1" "resources/models/Wolf Sheep Predation.nlogo"
"setup go go go go go go go go go go go go go go"
"9777CCF18935E52D8380C9C6DC02BFFBEE1F1149")