Part("Noun") +
Part("Conjunction") +
Part("Noun", "Pronoun", "Another") +
+ // The following part with a really long name is generated while running the test.
Part("This is a really, really, really, really, really, really, really, really, really, really, really, really, really, really long file name for punctuation");
// This should print "Wow! We now say hello to the big world and you."
--- a/
src/installer/test/Assets/TestProjects/AppWithSubDirs/Sentence/This is a really, really, really, really, really, really, really, really, really, really, really, really, really, really long file name for punctuation/word
+++ /dev/null
-.
\ No newline at end of file
using Microsoft.DotNet.Cli.Build.Framework;
using BundleTests.Helpers;
using Microsoft.DotNet.CoreSetup.Test;
-using System.Xml.Linq;
-using System.IO;
namespace AppHost.Bundle.Tests
{
RepoDirectories = new RepoDirectoriesProvider();
TestFrameworkDependentFixture = new TestProjectFixture("AppWithSubDirs", RepoDirectories);
+ BundleHelper.AddLongNameContentToAppWithSubDirs(TestFrameworkDependentFixture);
TestFrameworkDependentFixture
.EnsureRestoredForRid(TestFrameworkDependentFixture.CurrentRid, RepoDirectories.CorehostPackages)
.PublishProject(runtime: TestFrameworkDependentFixture.CurrentRid,
outputDirectory: BundleHelper.GetPublishPath(TestFrameworkDependentFixture));
TestSelfContainedFixture = new TestProjectFixture("AppWithSubDirs", RepoDirectories);
+ BundleHelper.AddLongNameContentToAppWithSubDirs(TestSelfContainedFixture);
TestSelfContainedFixture
.EnsureRestoredForRid(TestSelfContainedFixture.CurrentRid, RepoDirectories.CorehostPackages)
.PublishProject(runtime: TestSelfContainedFixture.CurrentRid,
outputDirectory: BundleHelper.GetPublishPath(TestSelfContainedFixture));
TestAppWithEmptyFileFixture = new TestProjectFixture("AppWithSubDirs", RepoDirectories);
- XDocument projectDoc = XDocument.Load(TestAppWithEmptyFileFixture.TestProject.ProjectFile);
- projectDoc.Root.Add(
- new XElement("ItemGroup",
- new XElement("Content",
- new XAttribute("Include", "empty.txt"),
- new XElement("CopyToOutputDirectory", "PreserveNewest"))));
- projectDoc.Save(TestAppWithEmptyFileFixture.TestProject.ProjectFile);
- File.WriteAllBytes(Path.Combine(TestAppWithEmptyFileFixture.TestProject.Location, "empty.txt"), new byte[0]);
+ BundleHelper.AddLongNameContentToAppWithSubDirs(TestAppWithEmptyFileFixture);
+ BundleHelper.AddEmptyContentToApp(TestAppWithEmptyFileFixture);
TestAppWithEmptyFileFixture
.EnsureRestoredForRid(TestAppWithEmptyFileFixture.CurrentRid, RepoDirectories.CorehostPackages)
.PublishProject(runtime: TestAppWithEmptyFileFixture.CurrentRid,
{
TestFrameworkDependentFixture.Dispose();
TestSelfContainedFixture.Dispose();
+ TestAppWithEmptyFileFixture.Dispose();
}
}
}
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-using System.IO;
using Microsoft.DotNet.CoreSetup.Test;
+using System.IO;
+using System.Xml.Linq;
namespace BundleTests.Helpers
{
return singleFile;
}
+ public static void AddLongNameContentToAppWithSubDirs(TestProjectFixture fixture)
+ {
+ // For tests using the AppWithSubDirs, One of the sub-directories with a really long name
+ // is generated during test-runs rather than being checked in as a test asset.
+ // This prevents git-clone of the repo from failing if long-file-name support is not enabled on windows.
+ var longDirName = "This is a really, really, really, really, really, really, really, really, really, really, really, really, really, really long file name for punctuation";
+ var longDirPath = Path.Combine(fixture.TestProject.ProjectDirectory, "Sentence", longDirName);
+ Directory.CreateDirectory(longDirPath);
+ using (var writer = File.CreateText(Path.Combine(longDirPath, "word")))
+ {
+ writer.Write(".");
+ }
+ }
+
+ public static void AddEmptyContentToApp(TestProjectFixture fixture)
+ {
+ XDocument projectDoc = XDocument.Load(fixture.TestProject.ProjectFile);
+ projectDoc.Root.Add(
+ new XElement("ItemGroup",
+ new XElement("Content",
+ new XAttribute("Include", "empty.txt"),
+ new XElement("CopyToOutputDirectory", "PreserveNewest"))));
+ projectDoc.Save(fixture.TestProject.ProjectFile);
+ File.WriteAllBytes(Path.Combine(fixture.TestProject.Location, "empty.txt"), new byte[0]);
+ }
+
}
}
RepoDirectories = new RepoDirectoriesProvider();
TestFixture = new TestProjectFixture("AppWithSubDirs", RepoDirectories);
+ BundleHelper.AddLongNameContentToAppWithSubDirs(TestFixture);
+
TestFixture
.EnsureRestoredForRid(TestFixture.CurrentRid, RepoDirectories.CorehostPackages)
.PublishProject(runtime: TestFixture.CurrentRid,