@@ -360,8 +360,6 @@ module Tests =
360360 | Summary_ Location
361361 /// Print out version information.
362362 | Version
363- /// Deprecated
364- | My_ Spirit_ Is_ Weak
365363 /// Allow duplicate test names.
366364 | Allow_ Duplicate_ Names
367365 /// Disable the spinner progress update.
@@ -400,7 +398,6 @@ module Tests =
400398 " --fscheck-max-tests" , " Set FsCheck maximum number of tests (default: 100)." , Args.number FsCheck_ Max_ Tests
401399 " --fscheck-start-size" , " Set FsCheck start size (default: 1)." , Args.number FsCheck_ Start_ Size
402400 " --fscheck-end-size" , " Set FsCheck end size (default: 100 for testing and 10,000 for stress testing)." , Args.number FsCheck_ End_ Size
403- " --my-spirit-is-weak" , Args.deprecated, Args.none My_ Spirit_ Is_ Weak
404401 " --allow-duplicate-names" , " Allow duplicate test names." , Args.none Allow_ Duplicate_ Names
405402 " --colours" , " Set the level of colours to use. Can be 0, 8 (default) or 256." , Args.number Colours
406403 " --no-spinner" , " Disable the spinner progress update." , Args.none No_ Spinner
@@ -448,7 +445,6 @@ module Tests =
448445 | FsCheck_ Max_ Tests n -> fun o -> { o with fsCheckMaxTests = n }
449446 | FsCheck_ Start_ Size n -> fun o -> { o with fsCheckStartSize = n }
450447 | FsCheck_ End_ Size n -> fun o -> { o with fsCheckEndSize = Some n }
451- | My_ Spirit_ Is_ Weak -> id
452448 | Allow_ Duplicate_ Names -> fun o -> { o with allowDuplicateNames = true }
453449 | No_ Spinner -> fun o -> { o with noSpinner = true }
454450 | Colours i -> fun o -> { o with colour =
@@ -533,51 +529,43 @@ module Tests =
533529 | _, x :: _ :: _ -> Some x.name
534530 | _ -> None
535531 )
536- /// Runs tests with the supplied config.
532+
533+ /// Runs all given tests with the supplied typed command-line options.
537534 /// Returns 0 if all tests passed, otherwise 1
538- /// Deprecated: please use runTestsWithCLIArgsAndCancel.
539- [<Obsolete( " Deprecated: please use runTestsWithCLIArgsAndCancel" ) >]
540- let runTestsWithCancel ( ct : CancellationToken ) config ( tests : Test ) =
541- ANSIOutputWriter.setColourLevel config.colour
542- Global.initialiseIfDefault
543- { Global.defaultConfig with
544- getLogger = fun name ->
545- LiterateConsoleTarget(
546- name, config.verbosity,
547- consoleSemaphore = Global.semaphore()) :> Logger
548- }
549- config.logName |> Option.iter setLogName
550- if config.failOnFocusedTests && passesFocusTestCheck config tests |> not then
551- 1
552- else
553- let fTests = config.filter tests
554- let duplicates = lazy duplicatedNames config.joinWith fTests
555- if config.allowDuplicateNames || List.isEmpty duplicates.Value then
556- let retCode =
557- match config.stress with
558- | None -> runEvalWithCancel ct config fTests |> Async.RunSynchronously
559- | Some _ -> runStressWithCancel ct config fTests |> Async.RunSynchronously
560- afterRunTestsInvoke()
561- retCode
562- else
563- sprintf " Found duplicated test names, these names are: %A " duplicates.Value
564- |> config.printer.info
565- |> Async.RunSynchronously
566- ANSIOutputWriter.close()
535+ let runTestsWithCLIArgsAndCancel ( ct : CancellationToken ) cliArgs args tests =
536+ let runTestsWithCancel ( ct : CancellationToken ) config ( tests : Test ) =
537+ ANSIOutputWriter.setColourLevel config.colour
538+ Global.initialiseIfDefault
539+ { Global.defaultConfig with
540+ getLogger = fun name ->
541+ LiterateConsoleTarget(
542+ name, config.verbosity,
543+ consoleSemaphore = Global.semaphore()) :> Logger
544+ }
545+ config.logName |> Option.iter setLogName
546+ if config.failOnFocusedTests && passesFocusTestCheck config tests |> not then
567547 1
548+ else
549+ let fTests = config.filter tests
550+ let duplicates = lazy duplicatedNames config.joinWith fTests
551+ if config.allowDuplicateNames || List.isEmpty duplicates.Value then
552+ let retCode =
553+ match config.stress with
554+ | None -> runEvalWithCancel ct config fTests |> Async.RunSynchronously
555+ | Some _ -> runStressWithCancel ct config fTests |> Async.RunSynchronously
556+ afterRunTestsInvoke()
557+ retCode
558+ else
559+ sprintf " Found duplicated test names, these names are: %A " duplicates.Value
560+ |> config.printer.info
561+ |> Async.RunSynchronously
562+ ANSIOutputWriter.close()
563+ 1
568564
569- /// Runs tests with the supplied config.
570- /// Returns 0 if all tests passed, otherwise 1
571- /// Deprecated: please use runTestsWithCLIArgs.
572- [<Obsolete( " Deprecated: please use runTestsWithCLIArgs" ) >]
573- let runTests config tests =
574- runTestsWithCancel CancellationToken.None config tests
565+ let config =
566+ Seq.fold ( fun s a -> foldCLIArgumentToConfig a s)
567+ ExpectoConfig.defaultConfig cliArgs
575568
576- /// Runs all given tests with the supplied command-line options.
577- /// Returns 0 if all tests passed, otherwise 1
578- /// Deprecated: please use runTestsWithCLIArgsAndCancel
579- [<Obsolete( " Deprecated: please use runTestsWithCLIArgsAndCancel" ) >]
580- let runTestsWithArgsAndCancel ( ct : CancellationToken ) config args tests =
581569 match ExpectoConfig.fillFromArgs config args with
582570 | ArgsUsage ( usage, errors) ->
583571 if not ( List.isEmpty errors) then
@@ -593,51 +581,16 @@ module Tests =
593581 printfn " EXPECTO! v%s \n " expectoVersion
594582 runTestsWithCancel ct config tests
595583
596- /// Runs all given tests with the supplied typed command-line options.
597- /// Returns 0 if all tests passed, otherwise 1
598- let runTestsWithCLIArgsAndCancel ( ct : CancellationToken ) cliArgs args tests =
599- let config =
600- Seq.fold ( fun s a -> foldCLIArgumentToConfig a s)
601- ExpectoConfig.defaultConfig cliArgs
602- runTestsWithArgsAndCancel ct config args tests
603-
604- /// Runs all given tests with the supplied command-line options.
605- /// Returns 0 if all tests passed, otherwise 1
606- /// Deprecated: please use runTestsWithCLIArgs
607- [<Obsolete( " Deprecated: please use runTestsWithCLIArgs" ) >]
608- let runTestsWithArgs config args tests =
609- runTestsWithArgsAndCancel CancellationToken.None config args tests
610-
611584 /// Runs all given tests with the supplied typed command-line options.
612585 /// Returns 0 if all tests passed, otherwise 1
613586 let runTestsWithCLIArgs cliArgs args tests =
614587 runTestsWithCLIArgsAndCancel CancellationToken.None cliArgs args tests
615588
616- /// Runs tests in this assembly with the supplied command-line options.
617- /// Returns 0 if all tests passed, otherwise 1
618- /// Deprecated: please use runTestsInAssemblyWithCLIArgsAndCancel
619- [<Obsolete( " Deprecated: please use runTestsInAssemblyWithCLIArgsAndCancel" ) >]
620- let runTestsInAssemblyWithCancel ( ct : CancellationToken ) config args =
621- let config = { config with locate = getLocation ( Assembly.GetEntryAssembly()) }
622- testFromThisAssembly ()
623- |> Option.orDefault ( TestList ([], Normal))
624- |> runTestsWithArgsAndCancel ct config args
625-
626589 /// Runs tests in this assembly with the supplied command-line options.
627590 /// Returns 0 if all tests passed, otherwise 1
628591 let runTestsInAssemblyWithCLIArgsAndCancel ( ct : CancellationToken ) cliArgs args =
629- let config = { ExpectoConfig.defaultConfig
630- with locate = getLocation ( Assembly.GetEntryAssembly()) }
631- let config = Seq.fold ( fun s a -> foldCLIArgumentToConfig a s) config cliArgs
632592 let tests = testFromThisAssembly() |> Option.orDefault ( TestList ([], Normal))
633- runTestsWithArgsAndCancel ct config args tests
634-
635- /// Runs tests in this assembly with the supplied command-line options.
636- /// Returns 0 if all tests passed, otherwise 1
637- /// Deprecated: please use runTestsInAssemblyWithCLIArgs
638- [<Obsolete( " Deprecated: please use runTestsInAssemblyWithCLIArgs" ) >]
639- let runTestsInAssembly config args =
640- runTestsInAssemblyWithCancel CancellationToken.None config args
593+ runTestsWithCLIArgsAndCancel ct cliArgs args tests
641594
642595 /// Runs tests in this assembly with the supplied command-line options.
643596 /// Returns 0 if all tests passed, otherwise 1
0 commit comments