Skip to content

Commit a6796f2

Browse files
committed
fixed roundtrip testing, and makes it run only if f# can and has been built.
1 parent c07af37 commit a6796f2

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/test/scala/f0/FSharpIntegrationTest.scala

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/**
21
package f0
32
import Readers._
43
import Writers._
@@ -53,23 +52,24 @@ object FSharpIntegrationTest extends Properties("FSharpIntegrationTest"){
5352
// make sure that we can write and read to files
5453
property("read and write to file") = secure {
5554
// writes to f0/test/data-from-scala.dat
56-
val filename = "../test/data-from-scala.dat"
55+
val filename = "test/data-from-scala.dat"
5756
val f = new java.io.File(filename); f.delete(); f.createNewFile()
5857
values ?= writeAndReadAllValues(Sinks.toFile(filename), Sources.fromFile(filename))
5958
}
6059

6160
// finally, do the integration testing
62-
property("write to and then read from f# process") = secure {
63-
val p = Runtime.getRuntime.exec( "../fsharp/f0/RoundTripTester/bin/Debug/RoundTripTester.exe")
64-
val result = writeAndReadAllValues(Sinks.toProcess(p), Sources.fromProcess(p))
65-
//println(result)
66-
values ?= result
67-
}
61+
val fSharpRoundTripTester = "fsharp/f0/RoundTripTester/bin/Debug/RoundTripTester.exe"
62+
property("write to and then read from f# process") =
63+
new java.io.File(fSharpRoundTripTester).exists ==> secure {
64+
val p = Runtime.getRuntime.exec(fSharpRoundTripTester)
65+
val result = writeAndReadAllValues(Sinks.toProcess(p), Sources.fromProcess(p))
66+
//println(result)
67+
values ?= result
68+
}
6869

6970
// writes all the 'values' to the given sink,
7071
// then reads them all back in from the given source
7172
def writeAndReadAllValues(sink:Sink, source: => Source) = {
7273
writer.bind(sink)(values); sink.close; reader.bind(source).get
7374
}
7475
}
75-
**/

0 commit comments

Comments
 (0)