[Pkg-cli-apps-commits] [fsharp] 33/71: updates to tests/fsharp/core to allow execution of most tests as a single all.exe, for use on Linux/OSX/Mono/Android/iOS

Christopher Halse Rogers raof-guest at moszumanska.debian.org
Fri Jan 17 05:18:13 UTC 2014


This is an automated email from the git hooks/post-receive script.

raof-guest pushed a commit to tag 3.1.0
in repository fsharp.

commit 2994a5fe4ef80d6ae6cfe75d3c69254ebaf786ad
Author: Don Syme <donsyme at fastmail.fm>
Date:   Fri Nov 29 17:35:11 2013 +0000

    updates to tests/fsharp/core to allow execution of most tests as a single all.exe, for use on Linux/OSX/Mono/Android/iOS
---
 src/all-vs2013.sln                                 |  4 --
 tests/fsharp/core/access/test.fsx                  | 33 ++++++++----
 tests/fsharp/core/apporder/test.fsx                | 29 ++++++++---
 tests/fsharp/core/array/test.fsx                   | 34 +++++++++----
 tests/fsharp/core/attributes/test.fsx              | 37 +++++++++-----
 tests/fsharp/core/comprehensions/test-hw.fsx       | 37 ++++++++++----
 tests/fsharp/core/comprehensions/test.fsx          | 42 ++++++++++++----
 tests/fsharp/core/control/test.fsx                 | 30 ++++++-----
 tests/fsharp/core/controlChamenos/test.fsx         |  2 +-
 tests/fsharp/core/controlMailbox/test.fsx          |  2 +-
 tests/fsharp/core/csext/test.fsx                   | 37 ++++++++++----
 tests/fsharp/core/csfromfs/classes.fs              |  2 +-
 tests/fsharp/core/csfromfs/collections.fs          |  2 +-
 tests/fsharp/core/csfromfs/events.fs               |  2 +-
 tests/fsharp/core/csfromfs/fields.fs               |  2 +-
 tests/fsharp/core/csfromfs/indexers.fs             |  2 +-
 tests/fsharp/core/csfromfs/methods.fs              |  2 +-
 tests/fsharp/core/csfromfs/properties.fs           |  2 +-
 tests/fsharp/core/events/test.fs                   |  2 +-
 tests/fsharp/core/fsfromfsviacs/test.fsx           | 34 +++++++++----
 tests/fsharp/core/innerpoly/test.fsx               | 39 ++++++++++-----
 tests/fsharp/core/int32/test.fsx                   | 35 +++++++++----
 tests/fsharp/core/lazy/test.fsx                    | 35 +++++++++----
 tests/fsharp/core/letrec/test.fsx                  | 38 +++++++-------
 tests/fsharp/core/libtest/test.fsx                 | 22 +++++---
 tests/fsharp/core/lift/test.fsx                    | 35 ++++++++++---
 tests/fsharp/core/longnames/test.fsx               | 37 ++++++++++----
 tests/fsharp/core/map/test.fsx                     | 34 ++++++++++---
 tests/fsharp/core/math/lalgebra/test.fsx           | 36 ++++++++++----
 tests/fsharp/core/math/lapack/test.fsx             | 36 ++++++++++----
 tests/fsharp/core/math/numbers/test.fsx            | 39 +++++++++++----
 tests/fsharp/core/math/numbersVS2008/test.fsx      | 40 +++++++++++----
 tests/fsharp/core/measures/test.fsx                | 38 ++++++++++----
 tests/fsharp/core/members/basics/test-hw.fsx       | 58 ++++++++++++++++++----
 tests/fsharp/core/members/basics/test.fs           | 37 ++++++++++----
 tests/fsharp/core/members/console/test.fsx         |  5 +-
 tests/fsharp/core/members/ctree/test.fsx           | 39 +++++++++++----
 tests/fsharp/core/members/factors/test.fsx         | 40 +++++++++++----
 tests/fsharp/core/members/incremental/test-hw.fsx  | 38 +++++++++++---
 tests/fsharp/core/members/incremental/test.fsx     | 39 ++++++++++++---
 tests/fsharp/core/members/ops/test.fsx             | 40 +++++++++++----
 tests/fsharp/core/namespaces/test.fs               | 35 +++++++++----
 tests/fsharp/core/nested/test.fsx                  | 37 ++++++++++----
 tests/fsharp/core/patterns/test.fsx                | 35 +++++++++----
 .../fsharp/core/portable/portablelibrary1/test.fsx | 38 +++++++++-----
 tests/fsharp/core/printf/test.fsx                  | 43 ++++++++--------
 tests/fsharp/core/queriesCustomQueryOps/test.fsx   | 34 +++++++++----
 .../core/queriesLeafExpressionConvert/test.fsx     | 32 ++++++++----
 .../fsharp/core/queriesNullableOperators/test.fsx  | 32 ++++++++----
 tests/fsharp/core/queriesOverIEnumerable/test.fsx  | 33 ++++++++----
 tests/fsharp/core/queriesOverIQueryable/test.fsx   | 32 ++++++++----
 .../test-part2.fs                                  | 22 ++++++--
 .../queriesOverIQueryableLinqToEntities/test.fsx   | 19 +++++--
 .../queriesOverIQueryableLinqToSql/test-part2.fs   | 19 +++++--
 .../core/queriesOverIQueryableLinqToSql/test.fsx   | 23 ++++++---
 tests/fsharp/core/queriesOverOData/test.fsx        | 19 +++++--
 tests/fsharp/core/quotes/test.fsx                  | 31 +++++++++---
 tests/fsharp/core/quotesDebugInfo/test.fsx         | 22 +++++---
 tests/fsharp/core/reflect/test2.fs                 | 34 +++++++++----
 tests/fsharp/core/seq/test.fsx                     | 27 +++++++---
 tests/fsharp/core/subtype/test.fsx                 | 37 ++++++++++----
 tests/fsharp/core/syntax/test.fsx                  | 20 +++++---
 tests/fsharp/core/tlr/test.fsx                     | 34 ++++++++++---
 .../fsharp/core/topinit/test_deterministic_init.fs |  2 +-
 tests/fsharp/core/unicode/test.fsx                 | 33 +++++++++---
 65 files changed, 1292 insertions(+), 498 deletions(-)

diff --git a/src/all-vs2013.sln b/src/all-vs2013.sln
index 52b7480..7400bce 100644
--- a/src/all-vs2013.sln
+++ b/src/all-vs2013.sln
@@ -14,8 +14,6 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Fsc", "fsharp\Fsc\Fsc.fspro
 EndProject
 Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler", "fsharp\FSharp.Compiler\FSharp.Compiler.fsproj", "{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}"
 EndProject
-Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.Silverlight", "fsharp\FSharp.Compiler.Silverlight\FSharp.Compiler.Silverlight.fsproj", "{A90A57BE-C2BD-4CB9-87DC-C0D18820FF6B}"
-EndProject
 Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Core", "fsharp\FSharp.Core\FSharp.Core.fsproj", "{DED3BBD7-53F4-428A-8C9F-27968E768605}"
 EndProject
 Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Build", "fsharp\FSharp.Build\FSharp.Build.fsproj", "{702A7979-BCF9-4C41-853E-3ADFC9897890}"
@@ -40,8 +38,6 @@ Global
 		{C94C257C-3C0A-4858-B5D8-D746498D1F08}.Release|Any CPU.ActiveCfg = Release|x86
 		{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|Any CPU.ActiveCfg = Debug|x86
 		{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Any CPU.ActiveCfg = Release|x86
-		{A90A57BE-C2BD-4CB9-87DC-C0D18820FF6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{A90A57BE-C2BD-4CB9-87DC-C0D18820FF6B}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{DED3BBD7-53F4-428A-8C9F-27968E768605}.Debug|Any CPU.ActiveCfg = Debug|x86
 		{DED3BBD7-53F4-428A-8C9F-27968E768605}.Release|Any CPU.ActiveCfg = Release|x86
 		{702A7979-BCF9-4C41-853E-3ADFC9897890}.Debug|Any CPU.ActiveCfg = Debug|x86
diff --git a/tests/fsharp/core/access/test.fsx b/tests/fsharp/core/access/test.fsx
index 5c76953..ea25ba3 100644
--- a/tests/fsharp/core/access/test.fsx
+++ b/tests/fsharp/core/access/test.fsx
@@ -1,13 +1,20 @@
 // #Regression #Conformance #Accessibility #SignatureFiles #Regression #Records #Unions 
-#if Portable
+#if ALL_IN_ONE
 module Core_access
 #endif
 
 #light
-let failures = ref false
-let report_failure () = 
-  stderr.WriteLine " NO"; failures := true
-let test s b = stderr.Write(s:string);  if b then stderr.WriteLine " OK" else report_failure() 
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
 
 (*--------------------*)
 
@@ -261,9 +268,17 @@ module RestrictedRecordsAndUnionsUsingPrivateAndInternalTypes =
     (*--------------------*)  
 
 
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
 let aa =
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
 
-do (stdout.WriteLine "Test Passed"; 
-    System.IO.File.WriteAllText("test.ok","ok"); 
-    exit 0)
diff --git a/tests/fsharp/core/apporder/test.fsx b/tests/fsharp/core/apporder/test.fsx
index 90c641e..3af1d46 100644
--- a/tests/fsharp/core/apporder/test.fsx
+++ b/tests/fsharp/core/apporder/test.fsx
@@ -1,12 +1,16 @@
 // #Conformance #Constants #Recursion #LetBindings #MemberDefinitions #Mutable 
-#if Portable
+#if ALL_IN_ONE
 module Core_apporder
 #endif
 
 #light
-let failures = ref false
-let report_failure (s) = 
-  stderr.WriteLine ("NO: " + s); failures := true; failwith ""
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
 let test s b = if b then () else report_failure(s) 
 
 (* TEST SUITE FOR Int32 *)
@@ -930,9 +934,18 @@ module MemberAppOrder =
     check "cwkneccewi" state [3;2;5;4]
     check "nvroirv" (sprintf "%d %d %d %d %d" foo.A foo.B foo.X foo.Y foo.Z) "4 5 3 2 99"
 
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
 let aa =
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
+
 
diff --git a/tests/fsharp/core/array/test.fsx b/tests/fsharp/core/array/test.fsx
index 8ba1bd0..5d3d211 100644
--- a/tests/fsharp/core/array/test.fsx
+++ b/tests/fsharp/core/array/test.fsx
@@ -1,13 +1,21 @@
 // #Conformance #Arrays #Stress #Structs #Mutable #ControlFlow #LetBindings 
-#if Portable
+#if ALL_IN_ONE
 module Core_array
 #endif
 
 #light
-let mutable failures = []
-let report_failure (s) = 
-  stderr.WriteLine " NO"; failures <- s :: failures
-let test s b = stderr.Write(s:string);  if b then stderr.WriteLine " OK" else report_failure() 
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
+
 let check s b1 b2 = test s (b1 = b2)
 
 
@@ -1312,9 +1320,17 @@ module bug6447 =
     do check "bug6447_hash_a2" (hash a2) 10727    
 #endif    
     
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
 let aa =
-  if not failures.IsEmpty then (stdout.WriteLine "Test Failed"; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
 
diff --git a/tests/fsharp/core/attributes/test.fsx b/tests/fsharp/core/attributes/test.fsx
index 655e51c..a60b18b 100644
--- a/tests/fsharp/core/attributes/test.fsx
+++ b/tests/fsharp/core/attributes/test.fsx
@@ -2,7 +2,7 @@
 (*-------------------------------------------------------------------------
 !* attribute tests
  *------------------------------------------------------------------------- *)
-#if Portable
+#if ALL_IN_ONE
 module Core_attributes
 #endif
 #light
@@ -14,9 +14,17 @@ module Core_attributes
 #r "cslib.dll"
 #endif
 
-let mutable failures : string list = []
-let report_failure msg = 
-  printf "\n................TEST '%s' FAILED...............\n" msg; failures <- failures @ [msg]
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
 
 let check (s:string) e r = 
   if r = e then  stdout.WriteLine (s+": YES") 
@@ -1304,12 +1312,17 @@ module AttributeTestsOnExtensionProperties =
  *------------------------------------------------------------------------- *)
 
 
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
 let aa =
-  match failures with
-  | [] -> () 
-  | _ ->
-        stdout.WriteLine "Test Failed"; exit 1
-
-do (stdout.WriteLine "Test Passed"; 
-    System.IO.File.WriteAllText("test.ok","ok"); 
-    exit 0)
\ No newline at end of file
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
+
diff --git a/tests/fsharp/core/comprehensions/test-hw.fsx b/tests/fsharp/core/comprehensions/test-hw.fsx
index fea86ae..3bdfd09 100644
--- a/tests/fsharp/core/comprehensions/test-hw.fsx
+++ b/tests/fsharp/core/comprehensions/test-hw.fsx
@@ -7,10 +7,19 @@ open System.Text.RegularExpressions
 open System.IO
 open System.Xml
 
-let failures = ref false
-let report_failure () = 
-  stderr.WriteLine " NO"; failures := true
-let test s b = stderr.Write(s:string);  if b then stderr.WriteLine " OK" else report_failure() 
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
+
+let check s b1 b2 = test s (b1 = b2)
 
 
 let argv = System.Environment.GetCommandLineArgs() 
@@ -501,11 +510,6 @@ let rec allFiles dir =
     seq { for file in Directory.GetFiles(dir) do yield file
           for subdir in Directory.GetDirectories dir do yield! (allFiles subdir) }
 
-let _ = 
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
 
 module Attempt = 
     type Attempt<'a> = (unit -> 'a option)
@@ -1047,3 +1051,18 @@ module TryFinallySequenceExpressionTests =
        with _ -> ()
 
     testve937() 
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
+let aa =
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
+
diff --git a/tests/fsharp/core/comprehensions/test.fsx b/tests/fsharp/core/comprehensions/test.fsx
index 3cea280..eccaa33 100644
--- a/tests/fsharp/core/comprehensions/test.fsx
+++ b/tests/fsharp/core/comprehensions/test.fsx
@@ -1,12 +1,19 @@
 // #Conformance #Sequences #Regression #ControlFlow #SyntacticSugar #ComputationExpressions 
-#if Portable
+#if ALL_IN_ONE
 module Core_comprehensions
 #endif
 #light
-let failures = ref false
-let report_failure () = 
-  stderr.WriteLine " NO"; failures := true
-let test s b = stderr.Write(s:string);  if b then stderr.WriteLine " OK" else report_failure() 
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
 
 
 #if NetCore
@@ -629,7 +636,7 @@ let pickering() =
 printf "Regressions: 1017\n"
 
 let fails f = try f() |> ignore; false with e -> true
-let check str x = if x then printf "OK: %s\n" str  else (printf "FAILED: %s\n" str;  report_failure ())
+let check str x = if x then printf "OK: %s\n" str  else (printf "FAILED: %s\n" str;  report_failure (str))
 
 let rec steps x dx n = if n=0 then [] else x :: steps (x+dx) dx (n-1)
 
@@ -866,9 +873,12 @@ module MoreSequenceSyntaxTests =
                             return 2 }  
         let x0m = async { printfn "hello" }
 
+#if ALL_IN_ONE
+#else
         let f103 () = 
             async { do! Async.SwitchToNewThread()
                     do! Async.SwitchToNewThread() }
+#endif
 
 
     module AmbiguityTests1 = 
@@ -969,6 +979,8 @@ module SyncMonad =
            sync { printfn "hello" }
 
 
+#if ALL_IN_ONE
+#else
     type ThreadBuilder () = 
         inherit SyncBuilder()
         member x.Run(f) = async { do! Async.SwitchToNewThread()
@@ -1021,6 +1033,7 @@ module SyncMonad =
                        return 2 }  
         let x0m : unit = 
            thread { printfn "hello" }
+#endif
    
 module ContMonad = 
     type Cont<'a> = (('a -> unit) * (exn -> unit) -> unit)
@@ -1475,8 +1488,17 @@ module EnumPatternWithFunkyTypes_FSharp_1_0_13904 =
     // This is allowed - 'a is known to be "bool"
     let s = seq { for i in T true -> i }
 
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
 let aa =
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
\ No newline at end of file
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
+
diff --git a/tests/fsharp/core/control/test.fsx b/tests/fsharp/core/control/test.fsx
index 2386fcb..dcaf638 100644
--- a/tests/fsharp/core/control/test.fsx
+++ b/tests/fsharp/core/control/test.fsx
@@ -1,5 +1,5 @@
 // #Regression #Conformance #ComputationExpressions #Async #Regression #Events #Stress
-#if Portable
+#if ALL_IN_ONE
 module Core_control
 #endif
 #light
@@ -2047,19 +2047,17 @@ module Bug391710 =
         check "Bug391710" true false
         printfn "%s" (e.ToString())
 
-#if Portable
-let aa = if not failures.IsEmpty then exit 1 else stdout.WriteLine "Test Passed"; exit 0
+#if ALL_IN_ONE
+let RUN() = failures
 #else
-let _ = 
-  if not failures.IsEmpty then (stdout.WriteLine("Test Failed, failures = {0}", failures); exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        log "ALL OK, HAPPY HOLIDAYS, MERRY CHRISTMAS!"
-        System.IO.File.WriteAllText("test.ok","ok"); 
-// debug: why is the fsi test failing?  is it because test.ok does not exist?
-        if System.IO.File.Exists("test.ok") then
-            stdout.WriteLine ("test.ok found at {0}", System.IO.FileInfo("test.ok").FullName)
-        else
-            stdout.WriteLine ("test.ok not found")
-        exit 0)
-
-#endif
\ No newline at end of file
+let aa =
+  if not failures.IsEmpty then 
+      stdout.WriteLine "Test Failed"
+      exit 1
+  else   
+      stdout.WriteLine "Test Passed"
+      log "ALL OK, HAPPY HOLIDAYS, MERRY CHRISTMAS!"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+#endif
+
diff --git a/tests/fsharp/core/controlChamenos/test.fsx b/tests/fsharp/core/controlChamenos/test.fsx
index ce0ff01..66735dd 100644
--- a/tests/fsharp/core/controlChamenos/test.fsx
+++ b/tests/fsharp/core/controlChamenos/test.fsx
@@ -1,5 +1,5 @@
 // #Conformance #ComputationExpressions #Async 
-#if Portable
+#if ALL_IN_ONE
 module Core_controlChamenos
 #endif
 #light
diff --git a/tests/fsharp/core/controlMailbox/test.fsx b/tests/fsharp/core/controlMailbox/test.fsx
index 8288ffc..293d702 100644
--- a/tests/fsharp/core/controlMailbox/test.fsx
+++ b/tests/fsharp/core/controlMailbox/test.fsx
@@ -1,5 +1,5 @@
 // #Regression #Conformance #ComputationExpressions #Async #Regression #Events #Stress 
-#if Portable
+#if ALL_IN_ONE
 module Core_controlMailBox
 #endif
 #light
diff --git a/tests/fsharp/core/csext/test.fsx b/tests/fsharp/core/csext/test.fsx
index 7e5cbe8..6784ba3 100644
--- a/tests/fsharp/core/csext/test.fsx
+++ b/tests/fsharp/core/csext/test.fsx
@@ -1,14 +1,23 @@
 // #Conformance #Structs #Interop 
-#if Portable
+#if ALL_IN_ONE
 module Core_csext
 #endif
 #light
 
 
-let failures = ref false
-let report_failure () = 
-  stderr.WriteLine " NO"; failures := true
-let test s b = stderr.Write(s:string);  if b then stderr.WriteLine " OK" else report_failure() 
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
+
+let check s b1 b2 = test s (b1 = b2)
 
 
 open System.Linq
@@ -45,9 +54,19 @@ type Struct(i:int) =
 
 (*--------------------*)  
 
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
 let aa =
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
+
+
 
-do (stdout.WriteLine "Test Passed"; 
-    System.IO.File.WriteAllText("test.ok","ok"); 
-    exit 0)
\ No newline at end of file
diff --git a/tests/fsharp/core/csfromfs/classes.fs b/tests/fsharp/core/csfromfs/classes.fs
index 9a7c643..1c8cc4f 100644
--- a/tests/fsharp/core/csfromfs/classes.fs
+++ b/tests/fsharp/core/csfromfs/classes.fs
@@ -344,7 +344,7 @@ end
 let _ = 
   if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
   else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
+        System.IO.File.ALL_IN_ONE; 
         exit 0)
 
 
diff --git a/tests/fsharp/core/csfromfs/collections.fs b/tests/fsharp/core/csfromfs/collections.fs
index 66cc2c5..68de3b5 100644
--- a/tests/fsharp/core/csfromfs/collections.fs
+++ b/tests/fsharp/core/csfromfs/collections.fs
@@ -32,7 +32,7 @@ let _ = test "fewoij332" (genericList.Item(1) = 1)
 let _ = 
   if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
   else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
+        System.IO.File.ALL_IN_ONE; 
         exit 0)
 
 
diff --git a/tests/fsharp/core/csfromfs/events.fs b/tests/fsharp/core/csfromfs/events.fs
index bc6c78e..16cd969 100644
--- a/tests/fsharp/core/csfromfs/events.fs
+++ b/tests/fsharp/core/csfromfs/events.fs
@@ -70,5 +70,5 @@ let testEvents =
 let _ = 
   if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
   else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
+        System.IO.File.ALL_IN_ONE; 
         exit 0)
diff --git a/tests/fsharp/core/csfromfs/fields.fs b/tests/fsharp/core/csfromfs/fields.fs
index 4db547a..0b772fb 100644
--- a/tests/fsharp/core/csfromfs/fields.fs
+++ b/tests/fsharp/core/csfromfs/fields.fs
@@ -110,5 +110,5 @@ end
 let _ = 
   if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
   else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
+        System.IO.File.ALL_IN_ONE; 
         exit 0)
diff --git a/tests/fsharp/core/csfromfs/indexers.fs b/tests/fsharp/core/csfromfs/indexers.fs
index 9b63eff..be7be78 100644
--- a/tests/fsharp/core/csfromfs/indexers.fs
+++ b/tests/fsharp/core/csfromfs/indexers.fs
@@ -29,5 +29,5 @@ let testIndexers =
 let _ = 
   if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
   else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
+        System.IO.File.ALL_IN_ONE; 
         exit 0)
diff --git a/tests/fsharp/core/csfromfs/methods.fs b/tests/fsharp/core/csfromfs/methods.fs
index 575ef6e..c933ceb 100644
--- a/tests/fsharp/core/csfromfs/methods.fs
+++ b/tests/fsharp/core/csfromfs/methods.fs
@@ -140,7 +140,7 @@ end
 let _ = 
   if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
   else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
+        System.IO.File.ALL_IN_ONE; 
         exit 0)
 
 
diff --git a/tests/fsharp/core/csfromfs/properties.fs b/tests/fsharp/core/csfromfs/properties.fs
index 68f3eef..1e8d7fd 100644
--- a/tests/fsharp/core/csfromfs/properties.fs
+++ b/tests/fsharp/core/csfromfs/properties.fs
@@ -120,5 +120,5 @@ module FSharp_1_0_Bug_6389_Example4 =
 let _ = 
   if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
   else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
+        System.IO.File.ALL_IN_ONE; 
         exit 0)
diff --git a/tests/fsharp/core/events/test.fs b/tests/fsharp/core/events/test.fs
index f4ffaf3..2aac4f6 100644
--- a/tests/fsharp/core/events/test.fs
+++ b/tests/fsharp/core/events/test.fs
@@ -548,5 +548,5 @@ module EventWithNonPublicDelegateTypes_DevDiv271288 =
 let _ = 
   if failures.Length > 0 then (printfn "Tests Failed: %A" failures; exit 1) 
   else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
+        System.IO.File.ALL_IN_ONE; 
         exit 0)
diff --git a/tests/fsharp/core/fsfromfsviacs/test.fsx b/tests/fsharp/core/fsfromfsviacs/test.fsx
index 58cc486..dd74608 100644
--- a/tests/fsharp/core/fsfromfsviacs/test.fsx
+++ b/tests/fsharp/core/fsfromfsviacs/test.fsx
@@ -1,10 +1,17 @@
 // #Conformance #Interop #Unions 
 open Lib
 
-let failures = ref false
-let report_failure () = 
-  stderr.WriteLine " NO"; failures := true
-let test s b = stderr.Write(s:string);  if b then stderr.WriteLine " OK" else report_failure() 
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
 
 let r1 = Lib2.r1
 let r2 = Lib2.r2
@@ -47,8 +54,17 @@ let _ = test "fejio2dw" (Lib2.rr1 = ref r1)
 
 *)
 
-let _ = 
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
+let aa =
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
+
diff --git a/tests/fsharp/core/innerpoly/test.fsx b/tests/fsharp/core/innerpoly/test.fsx
index d0c220a..6510794 100644
--- a/tests/fsharp/core/innerpoly/test.fsx
+++ b/tests/fsharp/core/innerpoly/test.fsx
@@ -1,11 +1,21 @@
 // #Conformance #Regression #LetBindings #TypeInference 
-#if Portable
+#if ALL_IN_ONE
 module Core_innerpoly
 #endif
 
-let failures = ref false
-let report_failure () = stderr.WriteLine " NO"; failures := true
-let test s b = stderr.Write(s:string);  if b then stderr.WriteLine " OK" else report_failure() 
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
+
+let check s b1 b2 = test s (b1 = b2)
 
 
 
@@ -381,12 +391,17 @@ module InnerGenericBindingsInComputationExpressions = begin
     f()
 end
 
-#if Portable
-let aa = 
-    if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
-    else (stdout.WriteLine "Test Passed"; exit 0)
+#if ALL_IN_ONE
+let RUN() = !failures
 #else
-do (stdout.WriteLine "Test Passed"; 
-    System.IO.File.WriteAllText("test.ok","ok"); 
-    exit 0)
-#endif
\ No newline at end of file
+let aa =
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
+
diff --git a/tests/fsharp/core/int32/test.fsx b/tests/fsharp/core/int32/test.fsx
index a964ca9..f3197bb 100644
--- a/tests/fsharp/core/int32/test.fsx
+++ b/tests/fsharp/core/int32/test.fsx
@@ -1,14 +1,22 @@
 // #Conformance #Constants 
-#if Portable 
+#if ALL_IN_ONE
 module Core_int32
 #endif
 
 #light
 
-let failures = ref false
-let report_failure (s) = 
-  stderr.WriteLine ("NO: " + s); failures := true; failwith ""
-let test s b = if b then () else report_failure(s) 
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
+
 
 (* TEST SUITE FOR Int32 *)
 
@@ -393,8 +401,17 @@ module MinMaxAbsNative = begin
            
 end
 
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
 let aa =
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
\ No newline at end of file
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
+
diff --git a/tests/fsharp/core/lazy/test.fsx b/tests/fsharp/core/lazy/test.fsx
index 9f6e2e2..35554cc 100644
--- a/tests/fsharp/core/lazy/test.fsx
+++ b/tests/fsharp/core/lazy/test.fsx
@@ -1,12 +1,21 @@
 // #Conformance #Regression 
-#if Portable 
+#if ALL_IN_ONE
 module Core_lazy
 #endif
 
-let failures = ref false
-let report_failure () = 
-  stderr.WriteLine " NO"; failures := true
-let test s b = stderr.Write(s:string);  if b then stderr.WriteLine " OK" else report_failure() 
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
+
+let check s b1 b2 = test s (b1 = b2)
 
 
 
@@ -77,9 +86,17 @@ let x1 : System.IObservable<int> = null
 let x2 : System.IObserver<int> = null
 let x3 : System.Lazy<int> = null
 
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
 let aa =
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
 
-do (stdout.WriteLine "Test Passed"; 
-    System.IO.File.WriteAllText("test.ok","ok"); 
-    exit 0)
\ No newline at end of file
diff --git a/tests/fsharp/core/letrec/test.fsx b/tests/fsharp/core/letrec/test.fsx
index 831996c..6093305 100644
--- a/tests/fsharp/core/letrec/test.fsx
+++ b/tests/fsharp/core/letrec/test.fsx
@@ -1,11 +1,15 @@
 // #Conformance #LetBindings #Recursion #TypeInference #ObjectConstructors #Classes #Records 
-#if Portable
+#if ALL_IN_ONE
 module Core_letrec
 #endif
 
-let failures = ref false
-let report_failure s = 
-  stderr.WriteLine ("FAIL: "+s); failures := true
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
 
 
 
@@ -25,8 +29,7 @@ do SetCulture()
 
 let test t s1 s2 = 
   if s1 <> s2 then 
-    (stderr.WriteLine ("test "+t+" failed");
-     failures := true)
+    report_failure ("test "+t+" failed")
   else
     stdout.WriteLine ("test "+t+" succeeded")   
 
@@ -641,16 +644,17 @@ module BasicPermutations =
           override x.Foo a = base.Foo(a)
 
 
-#if Portable
-let aa = 
-    if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
-    else (stdout.WriteLine "Test Passed"; exit 0)
+#if ALL_IN_ONE
+let RUN() = !failures
 #else
-do 
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
-
+let aa =
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
 
-do (stdout.WriteLine "Test Passed"; 
-    System.IO.File.WriteAllText("test.ok","ok"); 
-    exit 0)
-#endif
\ No newline at end of file
diff --git a/tests/fsharp/core/libtest/test.fsx b/tests/fsharp/core/libtest/test.fsx
index b5185ac..5e26c0e 100644
--- a/tests/fsharp/core/libtest/test.fsx
+++ b/tests/fsharp/core/libtest/test.fsx
@@ -1,5 +1,5 @@
 // #Regression #Conformance #Regression #Exceptions #Constants #LetBindings #Lists #Collections #Stress #Sequences #Optimizations #Records #Unions 
-#if Portable
+#if ALL_IN_ONE
 module Core_libtest
 #endif
 
@@ -61,9 +61,9 @@ CONTENTS-END-LINE:
 #nowarn "62"
 #nowarn "44"
 
-let mutable failures = []
+let failures = ref []
 let reportFailure s = 
-  stdout.WriteLine "\n................TEST FAILED...............\n"; failures <- failures @ [s]
+  stdout.WriteLine "\n................TEST FAILED...............\n"; failures := !failures @ [s]
 
 (* TEST SUITE FOR STANDARD LIBRARY *)
 
@@ -5116,9 +5116,17 @@ module Regression_139182 =
 !* wrap up
  *--------------------------------------------------------------------------- *)
 
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
 let aa =
-  if not failures.IsEmpty then (printfn "Test Failed, failures = %A" failures; exit 1) 
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
 
-do (stdout.WriteLine "Test Passed"; 
-    System.IO.File.WriteAllText("test.ok","ok"); 
-    exit 0)
\ No newline at end of file
diff --git a/tests/fsharp/core/lift/test.fsx b/tests/fsharp/core/lift/test.fsx
index 4d5f54f..0c8af91 100644
--- a/tests/fsharp/core/lift/test.fsx
+++ b/tests/fsharp/core/lift/test.fsx
@@ -1,10 +1,20 @@
 // #Conformance #Regression 
-#if Portable
+#if ALL_IN_ONE
 module Core_lift
 #endif
-let failures = ref false
-let report_failure s  = 
-  stderr.WriteLine ("NO: test "^s^" failed"); failures := true
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
+
+let check s b1 b2 = test s (b1 = b2)
 
 
 #if NetCore
@@ -61,9 +71,18 @@ let test2947 () =
 
 let _ = test2947()
 
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
 let aa =
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
 
-do (stdout.WriteLine "Test Passed"; 
-    System.IO.File.WriteAllText("test.ok","ok"); 
-    exit 0)
\ No newline at end of file
diff --git a/tests/fsharp/core/longnames/test.fsx b/tests/fsharp/core/longnames/test.fsx
index e4b1b87..29db75c 100644
--- a/tests/fsharp/core/longnames/test.fsx
+++ b/tests/fsharp/core/longnames/test.fsx
@@ -1,11 +1,20 @@
 // #Conformance #ObjectConstructors 
-#if Portable
+#if ALL_IN_ONE
 module Core_longnames
 #endif
-let failures = ref false
-let report_failure () = 
-  stderr.WriteLine " NO"; failures := true
-let test s b = stderr.Write(s:string);  if b then stderr.WriteLine " OK" else report_failure() 
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
+
+let check s b1 b2 = test s (b1 = b2)
 
 #if NetCore
 #else
@@ -413,10 +422,18 @@ module TestsForUsingTypeNamesAsValuesWhenTheTypeHasAConstructor = begin
 
 end
 
-let aa =
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
 
-do (stdout.WriteLine "Test Passed"; 
-    System.IO.File.WriteAllText("test.ok","ok"); 
-    exit 0)
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
+let aa =
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
 
diff --git a/tests/fsharp/core/map/test.fsx b/tests/fsharp/core/map/test.fsx
index dc855c9..a526ede 100644
--- a/tests/fsharp/core/map/test.fsx
+++ b/tests/fsharp/core/map/test.fsx
@@ -1,12 +1,20 @@
 // #Conformance #Regression #Collections 
-#if Portable
+#if ALL_IN_ONE
 module Core_map
 #endif
 
 #light
-let failures = ref false
-let report_failure () = failures := true
-let test s b = if b then stdout.WriteLine ("OK: "+s) else (stdout.WriteLine (" FAILED: "+s); report_failure() )
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
 
 #if NetCore
 #else
@@ -165,8 +173,18 @@ module Bug_FSharp_1_0_6307 =
     // below does not parse
     let t = typeof<global.System.Int32>
 
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
 let aa =
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
\ No newline at end of file
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
+
diff --git a/tests/fsharp/core/math/lalgebra/test.fsx b/tests/fsharp/core/math/lalgebra/test.fsx
index 73207f9..b98a6a1 100644
--- a/tests/fsharp/core/math/lalgebra/test.fsx
+++ b/tests/fsharp/core/math/lalgebra/test.fsx
@@ -9,10 +9,17 @@
 //CONTENTS-END-LINE:
 //----------------------------------------------------------------------------
 
-let failures = ref false
-let report_failure () = 
-  stderr.WriteLine " NO"; failures := true
-let test s b = stderr.Write(s:string);  if b then stderr.WriteLine " OK" else report_failure();;
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
 
 #nowarn "0049";;
 
@@ -301,8 +308,19 @@ RegressionTest "Netlib" maxDimension
 //! Finish
 //--------  
 
-let _ = 
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
+let aa =
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
+
+
diff --git a/tests/fsharp/core/math/lapack/test.fsx b/tests/fsharp/core/math/lapack/test.fsx
index 7932618..90d2020 100644
--- a/tests/fsharp/core/math/lapack/test.fsx
+++ b/tests/fsharp/core/math/lapack/test.fsx
@@ -16,10 +16,19 @@
 #nowarn "0051"  // suppress warnings about the use of byref features to interoperate with native code
 #nowarn "0049"  // turn off warnings about using upper case identifiers for variables (e.g. matrices)
 
-let failures = ref false
-let report_failure () = 
-  stderr.WriteLine " NO"; failures := true
-let test s b = stderr.Write(s:string);  if b then stderr.WriteLine " OK" else report_failure() 
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
+
+let check s b1 b2 = test s (b1 = b2)
 
 //namespace Microsoft.FSharp.Math.Bindings.LAPACK
 
@@ -66,10 +75,19 @@ module AdhocNativeTests = begin
     do dd.GetChars(&&b, 0, &&c, 0, true) // sanity check to make sure method can be called
 end
 
-let _ = 
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
+let aa =
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
 
 
diff --git a/tests/fsharp/core/math/numbers/test.fsx b/tests/fsharp/core/math/numbers/test.fsx
index 14c7d82..4e1978d 100644
--- a/tests/fsharp/core/math/numbers/test.fsx
+++ b/tests/fsharp/core/math/numbers/test.fsx
@@ -5,17 +5,26 @@
 #nowarn "62";;
 #nowarn "35";;
                            
-let failures = ref false
-let report_failure () = 
-  stderr.WriteLine " NO"; failures := true
-let test s b = stderr.Write(s:string);  if b then stderr.WriteLine " OK" else report_failure()
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
+
+let check s b1 b2 = test s (b1 = b2)
 
 (* START *)
 
 open Microsoft.FSharp.Math
 let throws f = try f() |> ignore; false with e -> true
 // Test functions
-let fail() = report_failure()//failwith "Failed"
+let fail() = report_failure("Failed")
 let checkEq desc a b = if a<>b then printf "Failed %s. %A <> %A\n" desc a b; fail()
 
 #if FIXED_3481
@@ -269,8 +278,18 @@ checkEq "negative32s" negative32s
 
 (* END *)  
 
-let _ = 
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
+let aa =
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
+
diff --git a/tests/fsharp/core/math/numbersVS2008/test.fsx b/tests/fsharp/core/math/numbersVS2008/test.fsx
index 05112e0..9148a13 100644
--- a/tests/fsharp/core/math/numbersVS2008/test.fsx
+++ b/tests/fsharp/core/math/numbersVS2008/test.fsx
@@ -12,17 +12,26 @@
 // *** DO NOT ADD TESTS THAT WORK ON BOTH DEV10 and VS2008 TO THIS FILE ***
 //
 
-let failures = ref false
-let report_failure () = 
-  stderr.WriteLine " NO"; failures := true
-let test s b = stderr.Write(s:string);  if b then stderr.WriteLine " OK" else report_failure()
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
+
+let check s b1 b2 = test s (b1 = b2)
 
 (* START *)
 
 // Misc construction.
 open Microsoft.FSharp.Math
 open System.Numerics
-let fail() = report_failure()//failwith "Failed"
+let fail() = report_failure("Failed")
 let checkEq desc a b = if a<>b then printf "Failed %s. %A <> %A\n" desc a b; fail()
 
 // Regression 3481: Tables
@@ -252,8 +261,19 @@ checkEq "BigInt.ToInt64 positives" negative64s (List.map (triple64 -1I) [0 .. 64
 
 (* END *)  
 
-let _ = 
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
+let aa =
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
+
+
diff --git a/tests/fsharp/core/measures/test.fsx b/tests/fsharp/core/measures/test.fsx
index c816107..127dee2 100644
--- a/tests/fsharp/core/measures/test.fsx
+++ b/tests/fsharp/core/measures/test.fsx
@@ -1,13 +1,20 @@
 // #Conformance #UnitsOfMeasure #Constants 
-#if Portable
+#if ALL_IN_ONE
 module Core_measures
 #endif
 #light
 
-let failures = ref false
-let report_failure (s) = 
-  stderr.WriteLine ("NO: " + s); failures := true; failwith ""
-let test s b = if b then () else report_failure(s) 
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
 
 (* TEST SUITE FOR Operators on units-of-measure *)
 
@@ -609,8 +616,21 @@ module WrappedFloatTypeTest =
     let c31 =  C<1>.Mul (C<1>(0.5),C<1>(2.0))
     let c32 =  C<kg>.Mul (C<kg>(0.5<kg>),C<kg>(2.0<kg>))
 
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
 let aa =
-    if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
-    else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
\ No newline at end of file
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+#if Portable
+#else
+      System.IO.File.WriteAllText("test.ok","ok")
+#endif
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
+
diff --git a/tests/fsharp/core/members/basics/test-hw.fsx b/tests/fsharp/core/members/basics/test-hw.fsx
index 686f77d..5c45d9b 100644
--- a/tests/fsharp/core/members/basics/test-hw.fsx
+++ b/tests/fsharp/core/members/basics/test-hw.fsx
@@ -1,12 +1,25 @@
 // #Regression #Conformance #SignatureFiles #Classes #ObjectConstructors #ObjectOrientedTypes #Fields #MemberDefinitions #MethodsAndProperties #Unions #InterfacesAndImplementations #Events #Overloading #Recursion #Regression 
 #light
 
+#if ALL_IN_ONE
+module Core_members_basics
+#else
 module Tests
+#endif
+
+
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
 
-let mutable failures = []
-let report_failure s = 
-  stderr.WriteLine " NO"; failures <- s :: failures
-let test s b = stderr.Write(s:string);  if b then stderr.WriteLine " OK" else report_failure s
 let check s v1 v2 = test s (v1 = v2)
 
 //--------------------------------------------------------------
@@ -44,13 +57,19 @@ test "fweoew093" ((f(1)).b = 2)
 
 open System
 open System.Collections
+#if Portable
+#else
 open System.Windows.Forms
+#endif
 
 //-----------------------------------------
 // Some simple object-expression tests
 
 let x0 = { new System.Object() with member __.GetHashCode() = 3 }
+#if Portable
+#else
 let x1 = { new System.Windows.Forms.Form() with member __.GetHashCode() = 3 }
+#endif
 
 //-----------------------------------------
 // Test defining an F# class
@@ -963,6 +982,8 @@ let [<DontPressThisButton("Please don't press this again")>] button () = 1
 // Test we can use base calls
 
 
+#if Portable
+#else
 open System.Windows.Forms
 
 type MyCanvas2 = 
@@ -974,6 +995,7 @@ type MyCanvas2 =
   end
 
 let form2 = new MyCanvas2()
+#endif
 
 
 //---------------------------------------------------------------------
@@ -1761,12 +1783,18 @@ module DefaultConstructorConstraints = begin
   let x1 = (f1() : obj)
   let x2 = (f1() : int)
   let x3 = (f1() : DateTime)
+#if Portable
+#else
   let x4 = (f1() : System.Windows.Forms.Form)
+#endif
   let f2 () = f1()
   let y1 = (f2() : obj)
   let y2 = (f2() : int)
   let y3 = (f2() : DateTime)
+#if Portable
+#else
   let y4 = (f2() : System.Windows.Forms.Form)
+#endif
   
 end
 
@@ -2007,6 +2035,8 @@ module T1 =
 
     Vector2D(1.0,1.0) = Vector2D(1.0,1.0)
 
+#if Portable
+#else
 module Ex5 = 
     open System.Drawing
     type Label(?text,?font) =
@@ -2018,6 +2048,7 @@ module Ex5 =
     Label(text="Hello World")
     Label(font=new Font(FontFamily.GenericMonospace,36.0f),
           text="Hello World")
+#endif
 
 module Ex6 = 
     type IShape =
@@ -5569,9 +5600,18 @@ module Devdiv2_5385_repro2 =
     printfn "test passed ok without NullReferenceException"
 
 
-let _ = 
-  if not failures.IsEmpty then (eprintfn "Test Failed, failures = %A" failures; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
+let aa =
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
 
diff --git a/tests/fsharp/core/members/basics/test.fs b/tests/fsharp/core/members/basics/test.fs
index 4fbd8f4..ed10b37 100644
--- a/tests/fsharp/core/members/basics/test.fs
+++ b/tests/fsharp/core/members/basics/test.fs
@@ -4,11 +4,19 @@ module Global
 
 #nowarn "62"
 
-let failures = ref false
-let report_failure () = 
-  stderr.WriteLine " NO"; failures := true
-let test s b = stderr.Write(s:string);  if b then stderr.WriteLine " OK" else report_failure() 
-let check s b1 b2 = if b1 = b2  then eprintfn "%s: OK, b1 = %A, b2 = %A" s b1 b2 else (eprintfn "FAIL %s: b1 = %A, b2 = %A" s b1 b2; report_failure())
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
+
+let check s b1 b2 = test s (b1 = b2)
 
 //--------------------------------------------------------------
 // Test defining a record using object-expression syntax
@@ -3358,9 +3366,18 @@ module AutoProps_2 = begin
     check "autoprops_262" c61.Property 44      
 end
 
-let _ = 
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
+let aa =
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
 
diff --git a/tests/fsharp/core/members/console/test.fsx b/tests/fsharp/core/members/console/test.fsx
index fc6f43f..96bdaf2 100644
--- a/tests/fsharp/core/members/console/test.fsx
+++ b/tests/fsharp/core/members/console/test.fsx
@@ -1,4 +1,7 @@
 // #Conformance #Interop #Events #MemberDefinitions 
+#if ALL_IN_ONE
+module Core_members_console
+#endif
 
 type ControlEvent = CTRL_C | CTRL_BREAK | CTRL_CLOSE |CTRL_LOGOFF | CTRL_SHUTDOWN 
   with 
@@ -16,7 +19,7 @@ type ControlEvent = CTRL_C | CTRL_BREAK | CTRL_CLOSE |CTRL_LOGOFF | CTRL_SHUTDOW
        | 2 -> CTRL_CLOSE 
        | 3 -> CTRL_LOGOFF 
        | 4 -> CTRL_SHUTDOWN 
-       |  _ -> invalid_arg "ControlEvent.ToInt"
+       |  _ -> invalidArg "ControlEvent.ToInt"
   end
 
 
diff --git a/tests/fsharp/core/members/ctree/test.fsx b/tests/fsharp/core/members/ctree/test.fsx
index 8b802cd..cd89e0a 100644
--- a/tests/fsharp/core/members/ctree/test.fsx
+++ b/tests/fsharp/core/members/ctree/test.fsx
@@ -1,9 +1,21 @@
 // #Conformance #MemberDefinitions 
+#if ALL_IN_ONE
+module Core_members_ctree
+#endif
 
-let failures = ref false
-let report_failure () = 
-  stderr.WriteLine " NO"; failures := true
-let test s b = stderr.Write(s:string);  if b then stderr.WriteLine " OK" else report_failure() 
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
+
+let check s b1 b2 = test s (b1 = b2)
 
 module CTree1 = begin
 
@@ -44,9 +56,18 @@ type 'a ctree =
  
 end
 
-let _ = 
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
+let aa =
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
 
diff --git a/tests/fsharp/core/members/factors/test.fsx b/tests/fsharp/core/members/factors/test.fsx
index 6934652..2320bff 100644
--- a/tests/fsharp/core/members/factors/test.fsx
+++ b/tests/fsharp/core/members/factors/test.fsx
@@ -6,10 +6,23 @@
 // Microsoft Research Ltd.
 //---------------------------------------------------------------
 
-let failures = ref false
-let report_failure () = 
-  stderr.WriteLine " NO"; failures := true
-let test s b = stderr.Write(s:string);  if b then stderr.WriteLine " OK" else report_failure() 
+#if ALL_IN_ONE
+module Core_members_factors
+#endif
+
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
+
+let check s b1 b2 = test s (b1 = b2)
 
 open System.Collections.Generic
 
@@ -258,9 +271,18 @@ let Gaussian1DPriorFactorNode((var: VariableNode<Gaussian1D>), mean, variance) =
 // Finish up
 
 
-let _ = 
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
+let aa =
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
 
diff --git a/tests/fsharp/core/members/incremental/test-hw.fsx b/tests/fsharp/core/members/incremental/test-hw.fsx
index 483faa6..6075fa2 100644
--- a/tests/fsharp/core/members/incremental/test-hw.fsx
+++ b/tests/fsharp/core/members/incremental/test-hw.fsx
@@ -1,12 +1,25 @@
 // #Conformance #MemberDefinitions #Mutable #ObjectOrientedTypes #Classes #InterfacesAndImplementations #Recursion 
 #light
 
+#if ALL_IN_ONE
+module Core_members_incremental_testhw
+#endif
 
 //! Setup
 
-let failures = ref false
-let report_failure () = stderr.WriteLine " NO"; failures := true
-let test s b = stderr.Write(s:string);  if b then stderr.WriteLine " OK" else report_failure() 
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
+
+let check s b1 b2 = test s (b1 = b2)
 
 
 //! Address of incremental  local mutable
@@ -715,9 +728,18 @@ module ExceptionsWithAugmentations =
 
 //! Finish
 
-let _ = 
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
+let aa =
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
 
diff --git a/tests/fsharp/core/members/incremental/test.fsx b/tests/fsharp/core/members/incremental/test.fsx
index 6d6a261..013e4c9 100644
--- a/tests/fsharp/core/members/incremental/test.fsx
+++ b/tests/fsharp/core/members/incremental/test.fsx
@@ -27,12 +27,26 @@
 //CONTENTS-END-LINE:
 //--------------------------------------------------------------------------
 
+#if ALL_IN_ONE
+module Core_members_incremental
+#endif
+
 
 //! Setup
 
-let failures = ref false
-let report_failure () = stderr.WriteLine " NO"; failures := true
-let test s b = stderr.Write(s:string);  if b then stderr.WriteLine " OK" else report_failure() 
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
+
+let check s b1 b2 = test s (b1 = b2)
 
 
 //! Address of incremental class local mutable
@@ -720,9 +734,18 @@ end
 
 //! Finish
 
-let _ = 
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
+let aa =
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
 
diff --git a/tests/fsharp/core/members/ops/test.fsx b/tests/fsharp/core/members/ops/test.fsx
index 2400bc5..1caec9e 100644
--- a/tests/fsharp/core/members/ops/test.fsx
+++ b/tests/fsharp/core/members/ops/test.fsx
@@ -1,8 +1,21 @@
 // #Conformance #MemberDefinitions #Overloading #ComputationExpressions 
-let failures = ref false
-let report_failure () = 
-  stderr.WriteLine " NO"; failures := true
-let test s b = stderr.Write(s:string);  if b then stderr.WriteLine " OK" else report_failure() 
+#if ALL_IN_ONE
+module Core_members_ops
+#endif
+
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
+
+let check s b1 b2 = test s (b1 = b2)
 
 //let inline (>>) (x:$a) (y:$b) = (($a.(>>) <> <'a,'b,'c> : $t1<'a,'b> * $t2<'b,'c> -> $t2<'a,'c>) (x,y))
 //let inline (+) (x:$t1) (y:$t2) = (($a.(+) <...> <> : $t1<...> * $t2 -> $t1<...>) (x,y))
@@ -569,9 +582,18 @@ module TraitCallsAndConstructors =
     let _ : Inherited = -aInherited
 
 
-let _ = 
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
+let aa =
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
 
diff --git a/tests/fsharp/core/namespaces/test.fs b/tests/fsharp/core/namespaces/test.fs
index aeb0080..c28d8fe 100644
--- a/tests/fsharp/core/namespaces/test.fs
+++ b/tests/fsharp/core/namespaces/test.fs
@@ -6,10 +6,19 @@ namespace Hello.Goodbye
 type A = A | B | C
 
 module Utils = begin
-  let failures = ref false
-  let report_failure () = 
-    stderr.WriteLine " NO"; failures := true
-  let test s b = stderr.Write(s:string);  if b then stderr.WriteLine " OK" else report_failure() 
+    let failures = ref []
+
+    let report_failure (s : string) = 
+        stderr.Write" NO: "
+        stderr.WriteLine s
+        failures := !failures @ [s]
+
+    let test (s : string) b = 
+        stderr.Write(s)
+        if b then stderr.WriteLine " OK"
+        else report_failure (s)
+
+    let check s b1 b2 = test s (b1 = b2)
 end
 
 module X  = begin
@@ -71,9 +80,17 @@ end
 
 module Utils  = begin
 
-  let _ = 
-    if !Hello.Goodbye.Utils.failures then (stdout.WriteLine "Test Failed"; exit 1) 
-    else (stdout.WriteLine "Test Passed"; 
-          System.IO.File.WriteAllText("test.ok","ok"); 
-          exit 0)
+#if ALL_IN_ONE
+    let RUN() = !failures
+#else
+    let aa =
+      if not (!Hello.Goodbye.Utils.failures).IsEmpty then 
+          stdout.WriteLine "Test Failed"
+          exit 1
+      else   
+          stdout.WriteLine "Test Passed"
+          System.IO.File.WriteAllText("test.ok","ok")
+          exit 0
+#endif
+
 end
diff --git a/tests/fsharp/core/nested/test.fsx b/tests/fsharp/core/nested/test.fsx
index 2b02daf..8eafa6f 100644
--- a/tests/fsharp/core/nested/test.fsx
+++ b/tests/fsharp/core/nested/test.fsx
@@ -1,11 +1,20 @@
 // #Conformance 
-#if Portable
+#if ALL_IN_ONE
 module Core_nested
 #endif
-let failures = ref false
-let report_failure () = 
-  stderr.WriteLine " NO"; failures := true
-let test s b = stderr.Write(s:string);  if b then stderr.WriteLine " OK" else report_failure() 
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
+
+let check s b1 b2 = test s (b1 = b2)
 
 #if NetCore
 #else
@@ -61,10 +70,18 @@ do test "uyf78" (!wher = [ "Initialized before X1 OK";
                            "Initialized X3 OK";
                            "Initialized after X3 OK" ])
 
-let aa =
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
 
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
+let aa =
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
 
-do (stdout.WriteLine "Test Passed"; 
-    System.IO.File.WriteAllText("test.ok","ok"); 
-    exit 0)
\ No newline at end of file
diff --git a/tests/fsharp/core/patterns/test.fsx b/tests/fsharp/core/patterns/test.fsx
index 5237064..3a258a2 100644
--- a/tests/fsharp/core/patterns/test.fsx
+++ b/tests/fsharp/core/patterns/test.fsx
@@ -3,16 +3,24 @@
  * Initially just some tests related to top-level let-pattern bug.
  * Later regression tests that patterns do project out the bits expected?
  *)
-#if Portable
+#if ALL_IN_ONE
 module Core_patterns
 #endif
 
 #light
 
-let failures = ref false
-let report_failure s  = 
-  stderr.WriteLine ("NO: test "+s+" failed"); failures := true
-let test s b = if b then () else report_failure(s) 
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
+
 let check s x1 x2 = 
     if (x1 = x2) then 
         stderr.WriteLine ("test "+s+": ok")
@@ -1093,9 +1101,18 @@ module TypecheckingBug_FSharp_1_0_6389 =
 
 (* check for failure else sign off "ok" *)
 
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
 let aa =
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
 
-do (stdout.WriteLine "Test Passed"; 
-    System.IO.File.WriteAllText("test.ok","ok"); 
-    exit 0)
diff --git a/tests/fsharp/core/portable/portablelibrary1/test.fsx b/tests/fsharp/core/portable/portablelibrary1/test.fsx
index 3a115eb..395064c 100644
--- a/tests/fsharp/core/portable/portablelibrary1/test.fsx
+++ b/tests/fsharp/core/portable/portablelibrary1/test.fsx
@@ -1,13 +1,21 @@
-#if Portable
+#if ALL_IN_ONE
 module Core_Array
 #endif
 
 // #Conformance #Arrays #Stress #Structs #Mutable #ControlFlow #LetBindings 
 #light
-let mutable failures = []
-let report_failure (s) = 
-  stderr.WriteLine " NO"; failures <- s :: failures
-let test s b = stderr.Write(s:string);  if b then stderr.WriteLine " OK" else report_failure() 
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
+
 let check s b1 b2 = test s (b1 = b2)
 
 
@@ -1294,14 +1302,18 @@ module bug6447 =
     do check "bug6447_hash_a2" (hash a2) 10727    
 #endif
     
-#if Portable
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
 let aa =
-#else    
-let _ = 
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
 #endif
 
-  if not failures.IsEmpty then (stdout.WriteLine "Test Failed"; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
-
diff --git a/tests/fsharp/core/printf/test.fsx b/tests/fsharp/core/printf/test.fsx
index 15624ae..d760849 100644
--- a/tests/fsharp/core/printf/test.fsx
+++ b/tests/fsharp/core/printf/test.fsx
@@ -1,15 +1,18 @@
 // #Conformance #Printing 
 
-#if Portable
+#if ALL_IN_ONE
 module Core_printf
 #endif
 #light
 
 open Printf
 
-let failures = ref false
-let report_failure () = 
-  stderr.WriteLine " NO"; failures := true
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
 
 #if NetCore
 #else
@@ -37,8 +40,7 @@ let test t (s1:Lazy<string>) s2 =
   if runEveryTest || (rnd.Next() % 10) = 0 then
       let s1 = s1.Force()
       if s1 <> s2 then 
-        (stderr.WriteLine ("test "+t+": expected \n\t'"+s2+"' but produced \n\t'"+s1+"'");
-         failures := true)
+        report_failure ("test "+t+": expected \n\t'"+s2+"' but produced \n\t'"+s1+"'")
       else
         stdout.WriteLine ("test "+t+": correctly produced '"+s1+"'")   
 
@@ -46,6 +48,7 @@ let verify actual expected = test expected actual expected
 
 let adjust1 obj n1 = unbox ((unbox obj) n1)
 
+(*
 let _ = test "percent00" (lazy(sprintf "%%")) "%"
 let _ = test "percent01" (lazy(sprintf " %%%% ")) " %% "
 let _ = test "percent02" (lazy(sprintf "%.2f%.2%" 2.)) "2.00%"
@@ -56,7 +59,7 @@ let _ = test "percent06" (lazy(sprintf "%*% %*d" 20 8 5)) "%        5"
 let _ = test "percent07" (lazy(sprintf "%-+.*%%*d%*.*%" 55 0 8 77 88)) "%8%"
 let _ = test "percent08" (lazy(sprintf "%%d")) "%d"
 let _ = test "percent09" (lazy(sprintf "% *% %d" 10 6)) "% 6"
-
+*)
 
 let _ = test "cewoui2a" (lazy(sprintf "%o" 0)) "0"
 let _ = test "cewoui2b" (lazy(sprintf "%o" 0)) "0"
@@ -298,9 +301,6 @@ let bug600c = sprintf "%x"
 let _ = test "bug600a3" (lazy(bug600c 2)) "2" 
 let _ = test "bug600b3" (lazy(bug600c 2)) "2" (* not 22! *)
 
-let _ = 
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
-
 let _ = test "ckwoih" (lazy(sprintf "%x" 0xFFy)) ("ff")
 let _ = test "ckwoih" (lazy(sprintf "%x" 0xFFFFs)) ("ffff")
 let _ = test "ckwoih" (lazy(sprintf "%x" 0xFFFFFFFF)) ("ffffffff")
@@ -9141,15 +9141,18 @@ func6000()
 func7000()
 func8000()
 
-#if Portable
-let aa =
-    if !failures then (printfn "Test Failed, failures = %A" failures; exit 1)
-    else (stdout.WriteLine "Test Passed"; exit 0)
+
+#if ALL_IN_ONE
+let RUN() = !failures
 #else
-let _ = 
-    if !failures then (printf "Test Failed"; exit 1) 
+let aa =
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
 #endif
-  
-do (stdout.WriteLine "Test Passed"; 
-    System.IO.File.WriteAllText("test.ok","ok"); 
-    exit 0)
\ No newline at end of file
+
diff --git a/tests/fsharp/core/queriesCustomQueryOps/test.fsx b/tests/fsharp/core/queriesCustomQueryOps/test.fsx
index 5bcfe4f..ce8de0a 100644
--- a/tests/fsharp/core/queriesCustomQueryOps/test.fsx
+++ b/tests/fsharp/core/queriesCustomQueryOps/test.fsx
@@ -1,5 +1,5 @@
 // #Quotations #Query
-#if Portable
+#if ALL_IN_ONE
 module Core_queriesCustomQueryOps
 #endif
 
@@ -15,9 +15,13 @@ open Microsoft.FSharp.Linq.RuntimeHelpers
 
 [<AutoOpen>]
 module Infrastructure =
-    let mutable failures = []
-    let reportFailure s = 
-        stderr.WriteLine " NO"; failures <- s :: failures
+    let failures = ref []
+
+    let report_failure (s : string) = 
+        stderr.Write" NO: "
+        stderr.WriteLine s
+        failures := !failures @ [s]
+
 
 #if NetCore
 #else
@@ -36,8 +40,7 @@ module Infrastructure =
        if v1 = v2 then 
            printfn "test %s...passed " s 
        else 
-           failures <- failures @ [(s, box v1, box v2)]
-           printfn "test %s...failed, expected %A got %A" s v2 v1
+           report_failure (sprintf "test %s...failed, expected %A got %A" s v2 v1)
 
     let test s b = check s b true
 
@@ -460,9 +463,18 @@ module ProbabilityWorkflow =
        printfn "sample #%d = %A" i (v1,v2)
        // Every sample should be identical on left and right because of the condition
        check "cwnew0" v1 v2
-
+       
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
 let aa =
-  if not failures.IsEmpty then (printfn "Test Failed, failures = %A" failures; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
\ No newline at end of file
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
+
diff --git a/tests/fsharp/core/queriesLeafExpressionConvert/test.fsx b/tests/fsharp/core/queriesLeafExpressionConvert/test.fsx
index 5947fd0..3c4a7b5 100644
--- a/tests/fsharp/core/queriesLeafExpressionConvert/test.fsx
+++ b/tests/fsharp/core/queriesLeafExpressionConvert/test.fsx
@@ -1,5 +1,5 @@
 // #Query
-#if Portable
+#if ALL_IN_ONE
 module Core_queriesLeafExpressionConvert
 #endif
 
@@ -12,9 +12,12 @@ open Microsoft.FSharp.Linq.RuntimeHelpers
 
 [<AutoOpen>]
 module Infrastructure =
-    let mutable failures = []
-    let reportFailure s = 
-        stderr.WriteLine " NO"; failures <- s :: failures
+    let failures = ref []
+
+    let report_failure (s : string) = 
+        stderr.Write" NO: "
+        stderr.WriteLine s
+        failures := !failures @ [s]
 
 #if NetCore
 #else
@@ -33,8 +36,7 @@ module Infrastructure =
        if v1 = v2 then 
            printfn "test %s...passed " s 
        else 
-           failures <- failures @ [(s, box v1, box v2)]
-           printfn "test %s...failed, expected %A got %A" s v2 v1
+           report_failure (sprintf "test %s...failed, expected %A got %A" s v2 v1)
 
     let test s b = check s b true
 
@@ -1097,8 +1099,18 @@ module LeafExpressionEvaluationTests =
         checkText "p2oin209v33x" <@ Nullable 2 ?%? Nullable () @> "(Convert(2) % new Nullable`1())"
         checkText "p2oin209v33x" <@ Nullable 2 ?% 3 @> "(Convert(2) % Convert(3))"
 
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
 let aa =
-  if not failures.IsEmpty then (printfn "Test Failed, failures = %A" failures; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
\ No newline at end of file
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
+
diff --git a/tests/fsharp/core/queriesNullableOperators/test.fsx b/tests/fsharp/core/queriesNullableOperators/test.fsx
index 48ee277..5b67ce2 100644
--- a/tests/fsharp/core/queriesNullableOperators/test.fsx
+++ b/tests/fsharp/core/queriesNullableOperators/test.fsx
@@ -1,5 +1,5 @@
 // #Query
-#if Portable
+#if ALL_IN_ONE
 module Core_queriesNullableOperators
 #endif
 
@@ -13,9 +13,12 @@ open Microsoft.FSharp.Linq.RuntimeHelpers
 
 [<AutoOpen>]
 module Infrastructure =
-    let mutable failures = []
-    let reportFailure s = 
-        stderr.WriteLine " NO"; failures <- s :: failures
+    let failures = ref []
+
+    let report_failure (s : string) = 
+        stderr.Write" NO: "
+        stderr.WriteLine s
+        failures := !failures @ [s]
 
 #if NetCore
 #else
@@ -34,8 +37,7 @@ module Infrastructure =
        if v1 = v2 then 
            printfn "test %s...passed " s 
        else 
-           failures <- failures @ [(s, box v1, box v2)]
-           printfn "test %s...failed, expected %A got %A" s v2 v1
+           report_failure (sprintf "test %s...failed, expected %A got %A" s v2 v1)
 
     let test s b = check s b true
 
@@ -309,8 +311,18 @@ module NullableConversions =
     check "opp2oin209v304u" (Nullable.float (Nullable 2<kg>)) (Nullable 2.0)
     check "opp2oin209v304i" (Nullable.float32 (Nullable 2<kg>)) (Nullable 2.0f)
 
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
 let aa =
-  if not failures.IsEmpty then (printfn "Test Failed, failures = %A" failures; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
\ No newline at end of file
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
+
diff --git a/tests/fsharp/core/queriesOverIEnumerable/test.fsx b/tests/fsharp/core/queriesOverIEnumerable/test.fsx
index 877ccbc..a2a7e41 100644
--- a/tests/fsharp/core/queriesOverIEnumerable/test.fsx
+++ b/tests/fsharp/core/queriesOverIEnumerable/test.fsx
@@ -1,5 +1,5 @@
 // #Quotations #Query
-#if Portable
+#if ALL_IN_ONE
 module Core_queriesOverIEnumerable
 #endif
 #nowarn "57"
@@ -11,9 +11,13 @@ open Microsoft.FSharp.Linq.RuntimeHelpers
 
 [<AutoOpen>]
 module Infrastructure =
-    let mutable failures = []
-    let reportFailure s = 
-        stderr.WriteLine " NO"; failures <- s :: failures
+    let failures = ref []
+
+    let report_failure (s : string) = 
+        stderr.Write" NO: "
+        stderr.WriteLine s
+        failures := !failures @ [s]
+
 
 #if NetCore
 #else
@@ -32,8 +36,7 @@ module Infrastructure =
        if v1 = v2 then 
            printfn "test %s...passed " s 
        else 
-           failures <- failures @ [(s, box v1, box v2)]
-           printfn "test %s...failed, expected %A got %A" s v2 v1
+           report_failure (sprintf "test %s...failed, expected %A got %A" s v2 v1)
 
     let test s b = check s b true
 
@@ -1004,8 +1007,18 @@ module MiscTestsForImplicitExpressionConversion =
             pageRank ( Queryable.AsQueryable [ for i in 0 .. 100 -> Edge(source = i, target = i % 7) ], 
                        Queryable.AsQueryable [ for i in 0 .. 100 -> Rank(source = i, value = i+100) ])
 
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
 let aa =
-  if not failures.IsEmpty then (printfn "Test Failed, failures = %A" failures; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
\ No newline at end of file
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
+
diff --git a/tests/fsharp/core/queriesOverIQueryable/test.fsx b/tests/fsharp/core/queriesOverIQueryable/test.fsx
index 3d3c054..b5a970e 100644
--- a/tests/fsharp/core/queriesOverIQueryable/test.fsx
+++ b/tests/fsharp/core/queriesOverIQueryable/test.fsx
@@ -1,5 +1,5 @@
 // #Quotations #Query
-#if Portable
+#if ALL_IN_ONE
 module Core_queriesOverIQueryable
 #endif
 
@@ -12,9 +12,12 @@ open Microsoft.FSharp.Linq.RuntimeHelpers
 
 [<AutoOpen>]
 module Infrastructure =
-    let mutable failures = []
-    let reportFailure s = 
-        stderr.WriteLine " NO"; failures <- s :: failures
+    let failures = ref []
+
+    let report_failure (s : string) = 
+        stderr.Write" NO: "
+        stderr.WriteLine s
+        failures := !failures @ [s]
 
 #if NetCore
 #else
@@ -33,8 +36,7 @@ module Infrastructure =
        if v1 = v2 then 
            printfn "test %s...passed " s 
        else 
-           failures <- failures @ [(s, box v1, box v2)]
-           printfn "test %s...failed, expected \n\t%A\ngot\n\t%A" s v2 v1
+           report_failure (sprintf "test %s...failed, expected \n\t%A\ngot\n\t%A" s v2 v1)
 
     let test s b = check s b true
     let qmap f (x:System.Linq.IQueryable<_>) = x |> Seq.map f |> System.Linq.Queryable.AsQueryable
@@ -2470,8 +2472,18 @@ module Problem2 =
                 select (item :?> Item) })
        [item]
 
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
 let aa =
-  if not failures.IsEmpty then (printfn "Test Failed, failures = %A" failures; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
\ No newline at end of file
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
+
diff --git a/tests/fsharp/core/queriesOverIQueryableLinqToEntities/test-part2.fs b/tests/fsharp/core/queriesOverIQueryableLinqToEntities/test-part2.fs
index 03d8b06..87dd591 100644
--- a/tests/fsharp/core/queriesOverIQueryableLinqToEntities/test-part2.fs
+++ b/tests/fsharp/core/queriesOverIQueryableLinqToEntities/test-part2.fs
@@ -554,10 +554,22 @@ FROM [dbo].[Customers] AS [t0]"""
     [<System.STAThread>]
     do()
 #endif
-let _ = 
-  if not failures.IsEmpty then (printfn "Test Failed, failures = %A" failures; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
+
+
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
+let aa =
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
+
 
 
diff --git a/tests/fsharp/core/queriesOverIQueryableLinqToEntities/test.fsx b/tests/fsharp/core/queriesOverIQueryableLinqToEntities/test.fsx
index 3767a4d..68691cf 100644
--- a/tests/fsharp/core/queriesOverIQueryableLinqToEntities/test.fsx
+++ b/tests/fsharp/core/queriesOverIQueryableLinqToEntities/test.fsx
@@ -655,10 +655,19 @@ FROM [dbo].[Customers] AS [t0]"""
     do()
 #endif
 
-let _ = 
-  if not failures.IsEmpty then (printfn "Test Failed, failures = %A" failures; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
+let aa =
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
 
 
diff --git a/tests/fsharp/core/queriesOverIQueryableLinqToSql/test-part2.fs b/tests/fsharp/core/queriesOverIQueryableLinqToSql/test-part2.fs
index e3d2e75..40bddeb 100644
--- a/tests/fsharp/core/queriesOverIQueryableLinqToSql/test-part2.fs
+++ b/tests/fsharp/core/queriesOverIQueryableLinqToSql/test-part2.fs
@@ -549,10 +549,19 @@ FROM [dbo].[Customers] AS [t0]"""
     [<System.STAThread>]
     do()
 #endif
-let _ = 
-  if not failures.IsEmpty then (printfn "Test Failed, failures = %A" failures; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
+
+#if ALL_IN_ONE
+let RUN() = failures
+#else
+let aa =
+  match failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
 
 
diff --git a/tests/fsharp/core/queriesOverIQueryableLinqToSql/test.fsx b/tests/fsharp/core/queriesOverIQueryableLinqToSql/test.fsx
index 15304e5..f8fdb0c 100644
--- a/tests/fsharp/core/queriesOverIQueryableLinqToSql/test.fsx
+++ b/tests/fsharp/core/queriesOverIQueryableLinqToSql/test.fsx
@@ -738,14 +738,23 @@ ORDER BY [t0].[CustomerID], [t1].[OrderID]"""
 
 
 #if COMPILED
-    [<System.STAThread>]
-    do()
+[<System.STAThread>]
+do()
 #endif
 
-let _ = 
-  if not failures.IsEmpty then (printfn "Test Failed, failures = %A" failures; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
+
+#if ALL_IN_ONE
+let RUN() = failures
+#else
+let aa =
+  match failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
 
 
diff --git a/tests/fsharp/core/queriesOverOData/test.fsx b/tests/fsharp/core/queriesOverOData/test.fsx
index 1ac866c..a3fbbe6 100644
--- a/tests/fsharp/core/queriesOverOData/test.fsx
+++ b/tests/fsharp/core/queriesOverOData/test.fsx
@@ -136,10 +136,19 @@ module Queryable =
     do()
 #endif
 
-let _ = 
-  if not failures.IsEmpty then (printfn "Test Failed, failures = %A" failures; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
+
+#if ALL_IN_ONE
+let RUN() = failures
+#else
+let aa =
+  match failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
 
 
diff --git a/tests/fsharp/core/quotes/test.fsx b/tests/fsharp/core/quotes/test.fsx
index 322dabe..8108047 100644
--- a/tests/fsharp/core/quotes/test.fsx
+++ b/tests/fsharp/core/quotes/test.fsx
@@ -1,5 +1,5 @@
 // #Conformance #Quotations #Interop #Classes #ObjectConstructors #Attributes #Reflection 
-#if Portable
+#if ALL_IN_ONE
 module Core_quotes
 #endif
 #light
@@ -11,10 +11,15 @@ module Core_quotes
 
 
 #nowarn "57"
-let mutable failures = []
-let report_failure s = 
-    stderr.WriteLine " NO"; failures <- s :: failures
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
 let test s b = stderr.Write(s:string);  if b then stderr.WriteLine " OK" else report_failure s
+
 let check s v1 v2 = 
    stderr.Write(s:string);  
    if (v1 = v2) then 
@@ -2408,8 +2413,18 @@ module QuotationOfResizeArrayIteration =
                  -> true
          |    _ -> false)
         
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
 let aa =
-  if not failures.IsEmpty then (printfn "Test Failed, failures = %A" failures; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
\ No newline at end of file
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
+
diff --git a/tests/fsharp/core/quotesDebugInfo/test.fsx b/tests/fsharp/core/quotesDebugInfo/test.fsx
index 4f61d45..72b7ed7 100644
--- a/tests/fsharp/core/quotesDebugInfo/test.fsx
+++ b/tests/fsharp/core/quotesDebugInfo/test.fsx
@@ -638,10 +638,18 @@ do
  }>"""
     test "test17" baseLine q
     
-if !failures > 0 then 
-    printfn "Test Failed" 
-    exit 1
-else 
-    printfn "Test Passed"; 
-    System.IO.File.WriteAllText("test.ok","ok"); 
-    exit 0
\ No newline at end of file
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
+let aa =
+  match !failures with 
+  | 0 -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
+
diff --git a/tests/fsharp/core/reflect/test2.fs b/tests/fsharp/core/reflect/test2.fs
index d0d3b13..f953645 100644
--- a/tests/fsharp/core/reflect/test2.fs
+++ b/tests/fsharp/core/reflect/test2.fs
@@ -2,10 +2,18 @@
 module Test2
 #nowarn "44"
 
-let failures = ref false
-let report_failure () = 
-  stderr.WriteLine " NO"; failures := true
-let test s b = stderr.Write(s:string);  if b then stderr.WriteLine " OK" else report_failure() 
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
+
 
 
 
@@ -306,10 +314,18 @@ module TEst = begin
 end
 
 
-let _ = 
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
 
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
+let aa =
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
 
diff --git a/tests/fsharp/core/seq/test.fsx b/tests/fsharp/core/seq/test.fsx
index e245263..0bdbb18 100644
--- a/tests/fsharp/core/seq/test.fsx
+++ b/tests/fsharp/core/seq/test.fsx
@@ -6,9 +6,13 @@ module Core_seq
 #nowarn "62"
 #nowarn "44"
 
-let mutable failures = []
-let reportFailure s = 
-  stdout.WriteLine "\n................TEST FAILED...............\n"; failures <- failures @ [s]
+let failures = ref []
+
+let reportFailure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
 
 (* TEST SUITE FOR STANDARD LIBRARY *)
 
@@ -492,9 +496,18 @@ check "hfhdfsjkfur34"
 !* wrap up
  *--------------------------------------------------------------------------- *)
 
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
 let aa =
-  if not failures.IsEmpty then (printfn "Test Failed, failures = %A" failures; exit 1) 
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
 
-do (stdout.WriteLine "Test Passed"; 
-    System.IO.File.WriteAllText("test.ok","ok"); 
-    exit 0)
\ No newline at end of file
diff --git a/tests/fsharp/core/subtype/test.fsx b/tests/fsharp/core/subtype/test.fsx
index fc8959f..b114d97 100644
--- a/tests/fsharp/core/subtype/test.fsx
+++ b/tests/fsharp/core/subtype/test.fsx
@@ -1,13 +1,21 @@
 // #Conformance #TypeInference #TypeConstraints #UnitsOfMeasure #Regression #Operators #Mutable 
-#if Portable
+#if ALL_IN_ONE
 module Core_subtype
 #endif
 #light
 
-let mutable failures = []
-let report_failure s = 
-  stderr.WriteLine " NO"; failures <- s :: failures
-let test s b = stderr.Write(s:string);  if b then stderr.WriteLine " OK" else report_failure s
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
+
 let check s v1 v2 = test s (v1 = v2)
 
 (* TEST SUITE FOR SUBTYPE CONSTRAINTS *)
@@ -120,9 +128,9 @@ let testUpcastToEnum6 (x: System.Enum) = (x :> System.Enum)
 let testUpcastToDelegate1 (x: System.Threading.ThreadStart) = (x :> System.Delegate) 
 
 let testUpcastToMulticastDelegate1 (x: System.Threading.ThreadStart) = (x :> System.MulticastDelegate) 
-#endif
 
 do for name in Directory.GetFiles("c:\\") do stdout.WriteLine name done
+#endif
 
 let f (x : #System.IComparable<'a>) = 1
 
@@ -1696,9 +1704,18 @@ module RecordPropertyConstraintTests =
     check "ckjwnewk" (f8()) (System.TimeSpan.FromSeconds 2.0) // after mutation
     check "ckjwnewk" (f10()) "Gary"
 
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
 let aa =
-  if not failures.IsEmpty then (printfn "Test Failed, failures = %A" failures; exit 1) 
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
 
-do (stdout.WriteLine "Test Passed"; 
-    System.IO.File.WriteAllText("test.ok","ok"); 
-    exit 0)
\ No newline at end of file
diff --git a/tests/fsharp/core/syntax/test.fsx b/tests/fsharp/core/syntax/test.fsx
index 09ffbc4..ff352b4 100644
--- a/tests/fsharp/core/syntax/test.fsx
+++ b/tests/fsharp/core/syntax/test.fsx
@@ -1,5 +1,5 @@
 // #Regression #Conformance #Operators #SyntacticSugar #Exceptions #ControlFlow #Arrays #Tuples #Lists #Classes #Constants #Records 
-#if Portable
+#if ALL_IN_ONE
 module Core_syntax
 #endif
 #light
@@ -1794,9 +1794,17 @@ module AdHocTests =
               let (b, _, _) = (1,2,3)
               [b]      
     
-let _ = stdout.WriteLine "Test FInishing"
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
 let aa =
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
-  else (stdout.WriteLine "Test Passed"; 
-        System.IO.File.WriteAllText("test.ok","ok"); 
-        exit 0)
\ No newline at end of file
+  match !failures with 
+  | false -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
+
diff --git a/tests/fsharp/core/tlr/test.fsx b/tests/fsharp/core/tlr/test.fsx
index 5d21f1f..996767d 100644
--- a/tests/fsharp/core/tlr/test.fsx
+++ b/tests/fsharp/core/tlr/test.fsx
@@ -14,12 +14,21 @@ CONTENTS-START-LINE: HERE=1 SEP=2
  348.   wrap up
 CONTENTS-END-LINE:
 ----------------------------------------------------------------------------*)
-#if Portable
+#if ALL_IN_ONE
 module Core_tlr
 #endif
-let failures = ref false
-let report_failure s  = 
-  stderr.WriteLine ("NO: test "+s+" failed"); failures := true
+
+let failures = ref []
+
+let report_failure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else report_failure (s)
 
 
 
@@ -392,9 +401,18 @@ end
 (*-------------------------------------------------------------------------
  *INDEX: wrap up
  *-------------------------------------------------------------------------*)    
+
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
 let aa =
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
 
-do (stdout.WriteLine "Test Passed"; 
-    System.IO.File.WriteAllText("test.ok","ok"); 
-    exit 0)
\ No newline at end of file
diff --git a/tests/fsharp/core/topinit/test_deterministic_init.fs b/tests/fsharp/core/topinit/test_deterministic_init.fs
index ea3d5f9..7911525 100644
--- a/tests/fsharp/core/topinit/test_deterministic_init.fs
+++ b/tests/fsharp/core/topinit/test_deterministic_init.fs
@@ -597,5 +597,5 @@ printfn "Touching value in module Lib85..."
 printfn "    --> Lib85.x = %A" Lib85.x
 printfn "Checking this did cause initialization of module Lib85..."
 checkInitialized "Lib85" InitFlag85.init
-System.IO.File.WriteAllText("test.ok","ok")
+System.IO.File.ALL_IN_ONE
 exit 0
diff --git a/tests/fsharp/core/unicode/test.fsx b/tests/fsharp/core/unicode/test.fsx
index 89c67a0..ace8cdf 100644
--- a/tests/fsharp/core/unicode/test.fsx
+++ b/tests/fsharp/core/unicode/test.fsx
@@ -1,10 +1,19 @@
 // #Conformance #Globalization 
-#if Portable
+#if ALL_IN_ONE
 module Core_unicode
 #endif
-let failures = ref false
-let reportFailure s  = 
-  stderr.WriteLine ("NO: "+s); failures := true
+
+let failures = ref []
+
+let reportFailure (s : string) = 
+    stderr.Write" NO: "
+    stderr.WriteLine s
+    failures := !failures @ [s]
+
+let test (s : string) b = 
+    stderr.Write(s)
+    if b then stderr.WriteLine " OK"
+    else reportFailure (s)
 
 (* TEST SUITE FOR UNICODE CHARS *)
 
@@ -136,9 +145,17 @@ let αβΛΘΩΨΧΣδζȚŶǺ = 22/7
 
 let π = 3.1415
 
+#if ALL_IN_ONE
+let RUN() = !failures
+#else
 let aa =
-  if !failures then (stdout.WriteLine "Test Failed"; exit 1) 
+  match !failures with 
+  | [] -> 
+      stdout.WriteLine "Test Passed"
+      System.IO.File.WriteAllText("test.ok","ok")
+      exit 0
+  | _ -> 
+      stdout.WriteLine "Test Failed"
+      exit 1
+#endif
 
-do (stdout.WriteLine "Test Passed"; 
-    System.IO.File.WriteAllText("test.ok","ok"); 
-    exit 0)
\ No newline at end of file

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-cli-apps/packages/fsharp.git



More information about the Pkg-cli-apps-commits mailing list