Skip to content

Commit

Permalink
Fix Travis Windows UI tests
Browse files Browse the repository at this point in the history
Just using `dos2unix tests/ui/**/*` did not work because the tool was
only transforming the first directory. That's the reason for using
`find`.

Interestingly `find` has precedence rules for its operators, too.

So you have to be careful to add opening/closing braces to denote the
precedence. Example:

```shell
find tests/ui/* -name '*.rs' -or -name '*.stderr' -exec dos2unix '{}' +
```

The above will be interpreted like this:

(find files matching `*.rs`) OR (find files matching `*.stderr` AND exec dos2unix)

which would only execute over the stderr files. That's why the braces are needed:

```shell
find tests/ui/* \( -name '*.rs' -or -name '*.stderr' -or -name '*.stdout' \) -exec dos2unix '{}' +
```
  • Loading branch information
phansch committed Nov 8, 2018
1 parent 3bb8877 commit 44c73f0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ install:
fi
if [ "$TRAVIS_OS_NAME" == "windows" ]; then
choco install windows-sdk-10.0
find tests/ui/* \( -name '*.rs' -or -name '*.stderr' -or -name '*.stdout' \) -exec dos2unix '{}' +
fi
fi
Expand Down

0 comments on commit 44c73f0

Please sign in to comment.