io.monitors: Run each set of monitors tests in its own directory. Fixes #1106.

db4
Doug Coleman 2015-05-19 10:50:17 -07:00
parent a66bed77b3
commit 0962b4a697
1 changed files with 80 additions and 84 deletions

View File

@ -6,6 +6,7 @@ io.pathnames accessors concurrency.promises ;
IN: io.monitors.tests
os { windows linux macosx } member? [
[
[
[ "monitor-test" temp-file delete-tree ] ignore-errors
@ -33,21 +34,18 @@ os { windows linux macosx } member? [
[ t ] [ "monitor-test/a2/a1/a4.txt" temp-file exists? ] unit-test
[ ] [ "m" get dispose ] unit-test
] with-unique-directory delete-tree
] with-monitors
[
[
[ "monitor-test" temp-file delete-tree ] ignore-errors
[ ] [ "monitor-test/xyz" temp-file make-directories ] unit-test
[ ] [ "monitor-test" temp-file t <monitor> "m" set ] unit-test
[ ] [ 1 <count-down> "b" set ] unit-test
[ ] [ 1 <count-down> "c1" set ] unit-test
[ ] [ 1 <count-down> "c2" set ] unit-test
[ ] [
[
"b" get count-down
@ -60,7 +58,6 @@ os { windows linux macosx } member? [
] loop
"c1" get count-down
[
"m" get next-change path>>
dup print flush
@ -73,21 +70,16 @@ os { windows linux macosx } member? [
] unit-test
[ ] [ "b" get await ] unit-test
[ ] [ "monitor-test/xyz/test.txt" temp-file touch-file ] unit-test
[ ] [ "c1" get 1 minutes await-timeout ] unit-test
[ ] [ "monitor-test/subdir/blah/yxy" temp-file make-directories ] unit-test
[ ] [ "monitor-test/subdir/blah/yxy/test.txt" temp-file touch-file ] unit-test
[ ] [ "c2" get 1 minutes await-timeout ] unit-test
! Dispose twice
[ ] [ "m" get dispose ] unit-test
[ ] [ "m" get dispose ] unit-test
] with-unique-directory delete-tree
] with-monitors
! Out-of-scope disposal should not fail
@ -95,6 +87,7 @@ os { windows linux macosx } member? [
[ ] [ [ "" resource-path t <monitor> ] with-monitors dispose ] unit-test
! Timeouts
[
[
[ ] [ "monitor-timeout-test" temp-file make-directories ] unit-test
@ -109,10 +102,12 @@ os { windows linux macosx } member? [
[ ] [ 3 seconds "m" get set-timeout ] unit-test
[ [ t ] [ "m" get next-change drop ] while ] must-fail
[ ] [ "m" get dispose ] unit-test
] with-unique-directory delete-tree
] with-monitors
! Disposing a monitor should throw an error in any threads
! waiting on notifications
[
[
[ ] [
<promise> "p" set
@ -128,5 +123,6 @@ os { windows linux macosx } member? [
[ ] [ 1 seconds sleep ] unit-test
[ ] [ "m" get dispose ] unit-test
[ t ] [ "p" get 10 seconds ?promise-timeout already-disposed? ] unit-test
] with-unique-directory delete-tree
] with-monitors
] when