Skip to content

Commit 256536b

Browse files
author
Sergey Komisarchik
committed
enable travis ci
1 parent 4d94c35 commit 256536b

File tree

6 files changed

+84
-7
lines changed

6 files changed

+84
-7
lines changed

.editorconfig

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
root=true
1+
root = true
22

33
[*]
4+
trim_trailing_whitespace = true
5+
insert_final_newline = true
46
indent_style = space
57
indent_size = 4
8+
9+
[*.{csproj,json,config,yml}]
10+
indent_size = 2
11+
12+
[*.sh]
13+
end_of_line = lf
14+
15+
[*.{cmd, bat}]
16+
end_of_line = crlf

.travis.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
language: csharp
2+
3+
#dotnet cli require Ubuntu 14.04
4+
sudo: required
5+
dist: trusty
6+
7+
#dotnet cli require OSX 10.10
8+
osx_image: xcode7.1
9+
10+
addons:
11+
apt:
12+
packages:
13+
- gettext
14+
- libcurl4-openssl-dev
15+
- libicu-dev
16+
- libssl-dev
17+
- libunwind8
18+
- zlib1g
19+
20+
os:
21+
- linux
22+
23+
env:
24+
global:
25+
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
26+
- TMP: /tmp
27+
28+
matrix:
29+
- CLI_VERSION=1.0.0-preview2-003121
30+
- CLI_VERSION=Latest
31+
32+
matrix:
33+
allow_failures:
34+
- env: CLI_VERSION=Latest
35+
36+
before_install:
37+
- if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; brew link --force openssl; fi
38+
# Download script to install dotnet cli
39+
- if test "$CLI_OBTAIN_URL" == ""; then export CLI_OBTAIN_URL="https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview2/scripts/obtain/dotnet-install.sh"; fi
40+
- curl -L --create-dirs $CLI_OBTAIN_URL -o ./scripts/obtain/install.sh
41+
- find ./scripts -name "*.sh" -exec chmod +x {} \;
42+
- export DOTNET_INSTALL_DIR="$PWD/.dotnetcli"
43+
# use bash to workaround bug https://github.com/dotnet/cli/issues/1725
44+
- sudo bash ./scripts/obtain/install.sh --channel "preview" --version "$CLI_VERSION" --install-dir "$DOTNET_INSTALL_DIR" --no-path
45+
# add dotnet to PATH
46+
- export PATH="$DOTNET_INSTALL_DIR:$PATH"
47+
48+
script:
49+
- ./build.sh

build.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
dotnet restore --no-cache
3+
for path in src/*/project.json; do
4+
dirname="$(dirname "${path}")"
5+
dotnet build ${dirname} -f netstandard1.3 -c Release
6+
done
7+
8+
for path in test/*.Tests/project.json; do
9+
dirname="$(dirname "${path}")"
10+
dotnet build ${dirname} -f netcoreapp1.0 -c Release
11+
dotnet test ${dirname} -f netcoreapp1.0 -c Release
12+
done

serilog-sinks-file.sln

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{037440DE-440
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "assets", "assets", "{E9D1B5E1-DEB9-4A04-8BAB-24EC7240ADAF}"
99
ProjectSection(SolutionItems) = preProject
10+
.editorconfig = .editorconfig
11+
.travis.yml = .travis.yml
1012
appveyor.yml = appveyor.yml
1113
Build.ps1 = Build.ps1
14+
build.sh = build.sh
1215
global.json = global.json
1316
NuGet.Config = NuGet.Config
1417
README.md = README.md

test/Serilog.Sinks.File.Tests/FileLoggerConfigurationExtensionsTests.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
using System;
22
using System.Threading;
3-
using Serilog;
43
using Serilog.Sinks.File.Tests.Support;
54
using Serilog.Tests.Support;
65
using Xunit;
6+
using System.IO;
77

88
namespace Serilog.Tests
99
{
1010
public class FileLoggerConfigurationExtensionsTests
1111
{
12-
const string InvalidPath = "/\\";
12+
static readonly string InvalidPath = new string(Path.GetInvalidPathChars());
1313

1414
[Fact]
1515
public void WhenWritingCreationExceptionsAreSuppressed()
@@ -66,7 +66,6 @@ public void WhenFlushingToDiskReportedFileSinkCanBeCreatedAndDisposed()
6666
}
6767
}
6868

69-
#if ATOMIC_APPEND
7069
[Fact]
7170
public void WhenFlushingToDiskReportedSharedFileSinkCanBeCreatedAndDisposed()
7271
{
@@ -79,6 +78,5 @@ public void WhenFlushingToDiskReportedSharedFileSinkCanBeCreatedAndDisposed()
7978
Thread.Sleep(TimeSpan.FromSeconds(1));
8079
}
8180
}
82-
#endif
8381
}
8482
}

test/Serilog.Sinks.File.Tests/Support/TempFolder.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,14 @@ public void Dispose()
3737
}
3838
}
3939

40-
public static TempFolder ForCaller([CallerMemberName] string caller = null)
40+
public static TempFolder ForCaller([CallerMemberName] string caller = null, [CallerFilePath] string sourceFileName = "")
4141
{
4242
if (caller == null) throw new ArgumentNullException(nameof(caller));
43-
return new TempFolder(caller);
43+
if (sourceFileName == null) throw new ArgumentNullException(nameof(sourceFileName));
44+
45+
var folderName = System.IO.Path.GetFileNameWithoutExtension(sourceFileName) + "_" + caller;
46+
47+
return new TempFolder(folderName);
4448
}
4549

4650
public string AllocateFilename(string ext = null)

0 commit comments

Comments
 (0)