<commit_before>﻿namespace EnumerableTest.Runner.Console

open System
open System.IO
open System.Reflection
open Argu
open Basis.Core
open EnumerableTest.Runner

module Assembly =
  let tryLoadFile (file: FileInfo) =
    try
      let assemblyName = AssemblyName.GetAssemblyName(file.FullName)
      Assembly.Load(assemblyName) |> Some
    with
    | _ -> None

module Program =
  let run isVerbose timeout (assemblyFiles: seq<FileInfo>) =
    if isVerbose then
      printfn "assemblies:"
      for file in assemblyFiles do
        printfn "  - %s" file.FullName
    let results =
      assemblyFiles
      |> Seq.choose Assembly.tryLoadFile
      |> Seq.collect (TestSuite.ofAssemblyAsync timeout)
      |> Observable.ofParallel
    let printer = TestPrinter(Console.Out, Console.BufferWidth - 1, isVerbose)
    let counter = AssertionCounter()
    results.Subscribe(printer) |> ignore<IDisposable>
    results.Subscribe(counter) |> ignore<IDisposable>
    results.Connect()
    results |> Observable.wait
    printer.PrintSummaryAsync(counter.Current) |> Async.RunSynchronously
    let exitCode =
      if counter.IsAllGreen
        then 0
        else -1
    exitCode
<commit_msg>Don't print path of assembly files even if --verbose<commit_after>﻿namespace EnumerableTest.Runner.Console

open System
open System.IO
open System.Reflection
open Argu
open Basis.Core
open EnumerableTest.Runner

module Assembly =
  let tryLoadFile (file: FileInfo) =
    try
      let assemblyName = AssemblyName.GetAssemblyName(file.FullName)
      Assembly.Load(assemblyName) |> Some
    with
    | _ -> None

module Program =
  let run isVerbose timeout (assemblyFiles: seq<FileInfo>) =
    let results =
      assemblyFiles
      |> Seq.choose Assembly.tryLoadFile
      |> Seq.collect (TestSuite.ofAssemblyAsync timeout)
      |> Observable.ofParallel
    let printer = TestPrinter(Console.Out, Console.BufferWidth - 1, isVerbose)
    let counter = AssertionCounter()
    results.Subscribe(printer) |> ignore<IDisposable>
    results.Subscribe(counter) |> ignore<IDisposable>
    results.Connect()
    results |> Observable.wait
    printer.PrintSummaryAsync(counter.Current) |> Async.RunSynchronously
    let exitCode =
      if counter.IsAllGreen
        then 0
        else -1
    exitCode

{'fraction_non_alphanumeric': 0.08373520385795703, 'fraction_numerical': 0.00263042525208242, 'mean_word_length': 3.3301707779886147, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3940088', 'n_tokens_mistral': 685, 'n_tokens_neox': 663, 'n_words': 165}