callback-error: don't use -e until we fix issue #245

db4
Slava Pestov 2011-10-10 21:25:50 -07:00
parent df7ee85daf
commit ae286fb7ef
1 changed files with 20 additions and 15 deletions

View File

@ -1,17 +1,19 @@
USING: accessors io io.encodings.ascii io.launcher kernel make USING: accessors io io.encodings.ascii io.files io.files.temp
sequences system tools.test ; io.launcher kernel make sequences system tools.test ;
IN: compiler.tests.callback-error IN: compiler.tests.callback-error
: run-vm-with-script ( string -- lines ) : callback-error-script ( -- path )
[ <process> ] dip "callback-error-script" temp-file ;
[ vm , , ] { } make >>command
: run-vm-with-script ( -- lines )
<process>
[ vm , callback-error-script , ] { } make >>command
+closed+ >>stdin +closed+ >>stdin
+stdout+ >>stderr +stdout+ >>stderr
ascii <process-reader> stream-lines ; ascii <process-reader> stream-lines ;
! Callback error from initial thread [ ] [
[ t ] [ """USING: alien alien.c-types alien.syntax kernel ;
"""-e=USING: alien alien.c-types alien.syntax kernel ;
IN: scratchpad IN: scratchpad
: callback-death ( -- callback ) : callback-death ( -- callback )
@ -21,13 +23,14 @@ IN: compiler.tests.callback-error
void { } cdecl alien-indirect ; void { } cdecl alien-indirect ;
callback-death callback-invoke""" callback-death callback-invoke"""
run-vm-with-script callback-error-script ascii set-file-contents
"\"Error!\"" swap member?
] unit-test ] unit-test
! Callback error from another thread ! Callback error from initial thread
[ t ] [ [ t ] [ run-vm-with-script "\"Error!\"" swap member? ] unit-test
"""-e=USING: alien alien.c-types alien.syntax kernel threads ;
[ ] [
"""USING: alien alien.c-types alien.syntax kernel threads ;
IN: scratchpad IN: scratchpad
: callback-death ( -- callback ) : callback-death ( -- callback )
@ -38,6 +41,8 @@ IN: compiler.tests.callback-error
[ callback-death callback-invoke ] in-thread [ callback-death callback-invoke ] in-thread
stop""" stop"""
run-vm-with-script callback-error-script ascii set-file-contents
"\"Error!\"" swap member?
] unit-test ] unit-test
! Callback error from another thread
[ t ] [ run-vm-with-script "\"Error!\"" swap member? ] unit-test