Skip to content

Commit

Permalink
Add regenerate command snapshots to makefile (#73)
Browse files Browse the repository at this point in the history
- For convenience the command to regenerate command snapshots has been added to the makefile

Test Plan:

- run `make regenerate_command_snapshots`

Signed-off-by: Kassem Wridan <[email protected]>
  • Loading branch information
kwridan authored Dec 29, 2020
1 parent bb8e51d commit ae2d79d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ lint:
swiftformat --version
swiftlint --strict --quiet
swiftformat . --lint

regenerate_command_snapshots:
./Scripts/generate_tests_commands_files.py
6 changes: 6 additions & 0 deletions Tests/XCDiffCommandTests/CommandBasedTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ final class CommandBasedTests: XCTestCase {
let subject = CommandRunner(printer: printer)
let exitCode = subject.run(with: command.command)

//
// Note: In the event this test fails, it means that the produced output from xcdiff
// now mismatches the snapshotes previously captured.
//
// Snapshots can be re-generated via running `make regenerate_command_snapshots`.
//
XCTAssertEqual(printer.output, command.expectedOutput,
"'\(command)' didn't produce expected output.")
XCTAssertEqual(exitCode, command.expectedExitCode,
Expand Down

0 comments on commit ae2d79d

Please sign in to comment.