Skip to content

Commit 9dc40a9

Browse files
authored
Merge pull request #446 from ratsclub/obsolete
Add obsolete attribute on deprecated functions
2 parents a9a36ee + d183a92 commit 9dc40a9

2 files changed

Lines changed: 9 additions & 42 deletions

File tree

Expecto/Expecto.fs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ module Tests =
536536
/// Runs tests with the supplied config.
537537
/// Returns 0 if all tests passed, otherwise 1
538538
/// Deprecated: please use runTestsWithCLIArgsAndCancel.
539+
[<Obsolete("Deprecated: please use runTestsWithCLIArgsAndCancel")>]
539540
let runTestsWithCancel (ct:CancellationToken) config (tests:Test) =
540541
ANSIOutputWriter.setColourLevel config.colour
541542
Global.initialiseIfDefault
@@ -564,14 +565,18 @@ module Tests =
564565
|> Async.RunSynchronously
565566
ANSIOutputWriter.close()
566567
1
568+
567569
/// Runs tests with the supplied config.
568570
/// Returns 0 if all tests passed, otherwise 1
569571
/// Deprecated: please use runTestsWithCLIArgs.
572+
[<Obsolete("Deprecated: please use runTestsWithCLIArgs")>]
570573
let runTests config tests =
571574
runTestsWithCancel CancellationToken.None config tests
572575

573576
/// Runs all given tests with the supplied command-line options.
574577
/// Returns 0 if all tests passed, otherwise 1
578+
/// Deprecated: please use runTestsWithCLIArgsAndCancel
579+
[<Obsolete("Deprecated: please use runTestsWithCLIArgsAndCancel")>]
575580
let runTestsWithArgsAndCancel (ct:CancellationToken) config args tests =
576581
match ExpectoConfig.fillFromArgs config args with
577582
| ArgsUsage (usage, errors) ->
@@ -598,7 +603,8 @@ module Tests =
598603

599604
/// Runs all given tests with the supplied command-line options.
600605
/// Returns 0 if all tests passed, otherwise 1
601-
/// Deprecated: please use runTestsWithCLIArgs.
606+
/// Deprecated: please use runTestsWithCLIArgs
607+
[<Obsolete("Deprecated: please use runTestsWithCLIArgs")>]
602608
let runTestsWithArgs config args tests =
603609
runTestsWithArgsAndCancel CancellationToken.None config args tests
604610

@@ -610,6 +616,7 @@ module Tests =
610616
/// Runs tests in this assembly with the supplied command-line options.
611617
/// Returns 0 if all tests passed, otherwise 1
612618
/// Deprecated: please use runTestsInAssemblyWithCLIArgsAndCancel
619+
[<Obsolete("Deprecated: please use runTestsInAssemblyWithCLIArgsAndCancel")>]
613620
let runTestsInAssemblyWithCancel (ct:CancellationToken) config args =
614621
let config = { config with locate = getLocation (Assembly.GetEntryAssembly()) }
615622
testFromThisAssembly ()
@@ -628,6 +635,7 @@ module Tests =
628635
/// Runs tests in this assembly with the supplied command-line options.
629636
/// Returns 0 if all tests passed, otherwise 1
630637
/// Deprecated: please use runTestsInAssemblyWithCLIArgs
638+
[<Obsolete("Deprecated: please use runTestsInAssemblyWithCLIArgs")>]
631639
let runTestsInAssembly config args =
632640
runTestsInAssemblyWithCancel CancellationToken.None config args
633641

README.md

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,9 @@ What follows is the Table of Contents for this README, which also serves as the
4949
- [.Net support](#net-support)
5050
- [Testing "Hello world"](#testing-hello-world)
5151
- [Running tests](#running-tests)
52-
- [`runTests`](#runtests)
53-
- [`runTestsWithArgs`](#runtestswithargs)
5452
- [`runTestsWithCLIArgs`](#runtestswithcliargs)
55-
- [`runTestsWithCancel`](#runtestswithcancel)
56-
- [`runTestsWithArgsAndCancel`](#runtestswithargsandcancel)
5753
- [`runTestsWithCLIArgsAndCancel`](#runtestswithcliargsandcancel)
58-
- [`runTestsInAssembly`](#runtestsinassembly)
5954
- [`runTestsInAssemblyWithCLIArgs`](#runtestsinassemblywithcliargs)
60-
- [`runTestsInAssemblyWithCancel`](#runtestsinassemblywithcancel)
6155
- [`runTestsInAssemblyWithCLIArgsAndCancel`](#runtestsinassemblywithcliargsandcancel)
6256
- [Filtering with `filter`](#filtering-with-filter)
6357
- [Shuffling with `shuffle`](#shuffling-with-shuffle)
@@ -233,57 +227,22 @@ testCase "A simple test" (fun () ->
233227
Expect.equal 4 (2+2) "2+2 should equal 4")
234228
```
235229

236-
### `runTests`
237-
238-
Signature `ExpectoConfig -> Test -> int`. Runs the passed tests with the passed
239-
configuration record. Note: now deprecated please use CLIArgs below.
240-
241-
### `runTestsWithArgs`
242-
243-
Signature `ExpectoConfig -> string[] -> Test -> int`. Runs the passed tests
244-
and also overrides the passed `ExpectoConfig` with the command line parameters.
245-
Note: now deprecated please use CLIArgs below.
246-
247230
### `runTestsWithCLIArgs`
248231

249232
Signature `CLIArguments seq -> string[] -> Test -> int`. Runs the passed tests
250233
and also overrides the passed `CLIArguments` with the command line parameters.
251234

252-
### `runTestsWithCancel`
253-
254-
Signature `CancellationToken -> ExpectoConfig -> Test -> int`. Runs the passed tests with the passed
255-
configuration record. Note: now deprecated please use CLIArgs below.
256-
257-
### `runTestsWithArgsAndCancel`
258-
259-
Signature `CancellationToken -> ExpectoConfig -> Test -> int`. Runs the passed tests
260-
and also overrides the passed `ExpectoConfig` with the command line parameters.
261-
configuration record. Note: now deprecated please use CLIArgs below.
262-
263235
### `runTestsWithCLIArgsAndCancel`
264236

265237
Signature `CancellationToken -> ExpectoConfig -> Test -> int`. Runs the passed tests
266238
and also overrides the passed `CLIArguments` with the command line parameters.
267239

268-
### `runTestsInAssembly`
269-
270-
Signature `ExpectoConfig -> string[] -> int`. Runs the tests in the current
271-
assembly and also overrides the passed `ExpectoConfig` with the command line
272-
parameters. All tests need to be marked with the `[<Tests>]` attribute.
273-
Note: now deprecated please use CLIArgs below.
274-
275240
### `runTestsInAssemblyWithCLIArgs`
276241

277242
Signature `CLIArguments seq -> string[] -> int`. Runs the tests in the current
278243
assembly and also overrides the passed `CLIArguments` with the command line
279244
parameters. All tests need to be marked with the `[<Tests>]` attribute.
280245

281-
### `runTestsInAssemblyWithCancel`
282-
283-
Signature `CancellationToken -> ExpectoConfig -> string[] -> int`. Runs the tests in the current
284-
assembly and also overrides the passed `ExpectoConfig` with the command line
285-
parameters. All tests need to be marked with the `[<Tests>]` attribute.
286-
287246
### `runTestsInAssemblyWithCLIArgsAndCancel`
288247

289248
Signature `CancellationToken -> CLIArguments seq -> string[] -> int`. Runs the tests in the current

0 commit comments

Comments
 (0)