diff --git a/LibGit2Sharp.Tests/BranchFixture.cs b/LibGit2Sharp.Tests/BranchFixture.cs index a6fcc300b..63fcced78 100644 --- a/LibGit2Sharp.Tests/BranchFixture.cs +++ b/LibGit2Sharp.Tests/BranchFixture.cs @@ -30,7 +30,13 @@ public void CanCreateBranch(string name) Assert.Equal("refs/heads/" + name, newBranch.CanonicalName); Assert.NotNull(newBranch.Tip); Assert.Equal(committish, newBranch.Tip.Sha); - Assert.NotNull(repo.Branches.SingleOrDefault(p => p.Name == name)); + + // Note the call to String.Normalize(). This is because, on Mac OS X, the filesystem + // decomposes the UTF-8 characters on write, which results in a different set of bytes + // when they're read back: + // - from InlineData: C5-00-6E-00-67-00-73-00-74-00-72-00-F6-00-6D-00 + // - from filesystem: 41-00-0A-03-6E-00-67-00-73-00-74-00-72-00-6F-00-08-03-6D-00 + Assert.NotNull(repo.Branches.SingleOrDefault(p => p.Name.Normalize() == name)); AssertRefLogEntry(repo, newBranch.CanonicalName, newBranch.Tip.Id, diff --git a/LibGit2Sharp.Tests/ConflictFixture.cs b/LibGit2Sharp.Tests/ConflictFixture.cs index 5e6c3e7dd..deec945c6 100644 --- a/LibGit2Sharp.Tests/ConflictFixture.cs +++ b/LibGit2Sharp.Tests/ConflictFixture.cs @@ -13,7 +13,7 @@ public static IEnumerable ConflictData { get { - return new[] + return new List { new[] { "ancestor-and-ours.txt", "5dee68477001f447f50fa7ee7e6a818370b5c2fb", "dad0664ae617d36e464ec08ed969ff496432b075", null }, new[] { "ancestor-and-theirs.txt", "3aafd4d0bac33cc3c78c4c070f3966fb6e6f641a", null, "7b26cd5ac0ee68483ae4d5e1e00b064547ea8c9b" }, diff --git a/LibGit2Sharp.Tests/ShadowCopyFixture.cs b/LibGit2Sharp.Tests/ShadowCopyFixture.cs index 3264b1182..c53366859 100644 --- a/LibGit2Sharp.Tests/ShadowCopyFixture.cs +++ b/LibGit2Sharp.Tests/ShadowCopyFixture.cs @@ -51,6 +51,11 @@ public void CanProbeForNativeBinariesFromAShadowCopiedAssembly() // ...but are currently loaded from different locations... string cachedAssemblyLocation = wrapper.AssemblyLocation; + if (cachedAssemblyLocation.StartsWith("/private")) + { + // On OS X, sometimes you get /private/var/… instead of /var/…, but they map to the same place. + cachedAssemblyLocation = cachedAssemblyLocation.Substring("/private".Length); + } Assert.NotEqual(sourceAssembly.Location, cachedAssemblyLocation); // ...that the assembly in the other domain is stored in the shadow copy cache... diff --git a/build.libgit2sharp.sh b/build.libgit2sharp.sh index 2cc44c8c5..151f76b24 100755 --- a/build.libgit2sharp.sh +++ b/build.libgit2sharp.sh @@ -1,27 +1,28 @@ #!/bin/bash -PREVIOUS_LD=$LD_LIBRARY_PATH - LIBGIT2SHA=`cat ./LibGit2Sharp/libgit2_hash.txt` SHORTSHA=${LIBGIT2SHA:0:7} -rm -rf cmake-build -mkdir cmake-build && cd cmake-build +rm -rf libgit2/build +mkdir libgit2/build +pushd libgit2/build +export _BINPATH=`pwd` -cmake -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DTHREADSAFE:BOOL=ON -DBUILD_CLAR:BOOL=OFF -DCMAKE_INSTALL_PREFIX=./libgit2-bin -DLIBGIT2_FILENAME=git2-$SHORTSHA ../libgit2 -cmake --build . --target install +cmake -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ + -DTHREADSAFE:BOOL=ON \ + -DBUILD_CLAR:BOOL=OFF \ + -DLIBGIT2_FILENAME=git2-$SHORTSHA \ + -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" \ + .. +cmake --build . -LD_LIBRARY_PATH=$PWD/libgit2-bin/lib:$LD_LIBRARY_PATH -export LD_LIBRARY_PATH +export LD_LIBRARY_PATH=$_BINPATH:$LD_LIBRARY_PATH +export DYLD_LIBRARY_PATH=$_BINPATH:$DYLD_LIBRARY_PATH -cd .. +popd +echo $DYLD_LIBRARY_PATH echo $LD_LIBRARY_PATH xbuild CI-build.msbuild /t:Deploy -EXIT_CODE=$? - -LD_LIBRARY_PATH=$PREVIOUS_LD -export LD_LIBRARY_PATH - -exit $EXIT_CODE +exit $?