#BUGFIX by stefan
class: RegressionTests::PipeStreamTest
comment/format in: #testReadCheckPipe5
changed:
#testReadCheckPipe4
#testReadPipe6
#testReadPipe7
https://expeccoalm.exept.de/D249620
Fix for windows
--- a/RegressionTests__PipeStreamTest.st Wed Mar 21 14:12:57 2018 +0100
+++ b/RegressionTests__PipeStreamTest.st Tue Apr 10 17:06:16 2018 +0200
@@ -72,19 +72,25 @@
"readCheck a pipe.
Do this and interrupt the reading thread heavily"
- | s p count|
+ | cmd s p count|
- s := PipeStream readingFrom:'sleep 3'.
+ OperatingSystem isMSWINDOWSlike ifTrue:[
+ cmd := 'waitfor /T 3 pause'.
+ ] ifFalse:[
+ cmd := 'sleep 3'.
+ ].
+
+ s := PipeStream readingFrom:cmd.
p := [
- s readWait.
- ' --- testReadCheckPipe4: readWait finished' printCR.
+ s readWait.
+ ' --- testReadCheckPipe4: readWait finished' printCR.
] forkAt:7.
count := 0.
[p isDead] whileFalse:[
- Delay waitForMilliseconds:5.
- p interruptWith:[count := count + 1].
+ Delay waitForMilliseconds:5.
+ p interruptWith:[count := count + 1].
].
(' --- testReadCheckPipe4: readWait interrupted <1p> times' expandMacrosWith:count) printCR.
@@ -104,20 +110,25 @@
"readCheck a pipe.
Do this and interrupt the reading thread heavily"
- | s p count line|
+ | s p count line cmd|
- s := PipeStream readingFrom:'sleep 3; echo hello'.
+ OperatingSystem isMSWINDOWSlike ifTrue:[
+ cmd := 'waitfor /T 3 pause & echo hello'.
+ ] ifFalse:[
+ cmd := 'sleep 3; echo hello'.
+ ].
+ s := PipeStream readingFrom:cmd.
p := [
- s readWait.
- line := s nextLine.
- ' --- testReadCheckPipe5: readWait finished' printCR.
+ s readWait.
+ line := s nextLine.
+ ' --- testReadCheckPipe5: readWait finished' printCR.
] forkAt:7.
count := 0.
[p isDead] whileFalse:[
- Delay waitForMilliseconds:5.
- p interruptWith:[count := count + 1].
+ Delay waitForMilliseconds:5.
+ p interruptWith:[count := count + 1].
].
(' --- testReadCheckPipe5: readWait interrupted <1p> times' expandMacrosWith:count) printCR.
@@ -138,27 +149,33 @@
"read a pipe.
Do this and interrupt the reading thread heavily"
- | s p count error line |
+ | s p count error line cmd|
error := nil.
"/ self createTestFile.
- s := PipeStream readingFrom:'sleep 3'.
+ OperatingSystem isMSWINDOWSlike ifTrue:[
+ cmd := 'waitfor /T 3 pause'.
+ ] ifFalse:[
+ cmd := 'sleep 3'.
+ ].
+
+ s := PipeStream readingFrom:cmd.
p := [
- [
- line := s nextLine.
- "/ line printCR.
- ] on: Error do:[:ex|
- error := ex.
- ]
+ [
+ line := s nextLine.
+ "/ line printCR.
+ ] on: Error do:[:ex|
+ error := ex.
+ ]
] forkAt:7.
count := 0.
[p isDead] whileFalse:[
- Delay waitForMilliseconds:5.
- p interruptWith:[count := count + 1].
+ Delay waitForMilliseconds:5.
+ p interruptWith:[count := count + 1].
].
(' --- testReadPipe6: read interrupted <1p> times' expandMacrosWith:count) printCR.
@@ -180,23 +197,28 @@
"read a pipe.
Do this and interrupt the reading thread heavily"
- |s p count error line |
+ |s p count error line cmd|
- s := PipeStream readingFrom:'sleep 3; echo hello'.
+ OperatingSystem isMSWINDOWSlike ifTrue:[
+ cmd := 'waitfor /T 3 pause & echo hello'.
+ ] ifFalse:[
+ cmd := 'sleep 3; echo hello'.
+ ].
+ s := PipeStream readingFrom:cmd.
p := [
- [
- line := s nextLine.
- "/ line printCR.
- ] on: Error do:[:ex|
- error := ex.
- ]
+ [
+ line := s nextLine.
+ "/ line printCR.
+ ] on: Error do:[:ex|
+ error := ex.
+ ]
] forkAt:7.
count := 0.
[p isDead] whileFalse:[
- Delay waitForMilliseconds:5.
- p interruptWith:[count := count + 1].
+ Delay waitForMilliseconds:5.
+ p interruptWith:[count := count + 1].
].
(' --- read interrupted <1p> times' expandMacrosWith:count) printCR.
@@ -219,3 +241,4 @@
version
^ '$Header$'
! !
+