42 references to MakeRelative
Microsoft.Build (2)
Evaluation\Evaluator.cs (1)
2489
relativeProjectPath = FileUtilities.
MakeRelative
(extensionsPathPropValue, importExpandedWithDefaultPath);
Evaluation\IntrinsicFunctions.cs (1)
336
string result = FileUtilities.
MakeRelative
(basePath, path);
Microsoft.Build.Engine.UnitTests (40)
FileUtilities_Tests.cs (40)
92
Assert.Equal(@"foo.cpp", FileUtilities.
MakeRelative
(@"c:\abc\def", @"c:\abc\def\foo.cpp"));
93
Assert.Equal(@"def\foo.cpp", FileUtilities.
MakeRelative
(@"c:\abc\", @"c:\abc\def\foo.cpp"));
94
Assert.Equal(@"..\foo.cpp", FileUtilities.
MakeRelative
(@"c:\abc\def\xyz", @"c:\abc\def\foo.cpp"));
95
Assert.Equal(@"..\ttt\foo.cpp", FileUtilities.
MakeRelative
(@"c:\abc\def\xyz\", @"c:\abc\def\ttt\foo.cpp"));
96
Assert.Equal(@"e:\abc\def\foo.cpp", FileUtilities.
MakeRelative
(@"c:\abc\def", @"e:\abc\def\foo.cpp"));
97
Assert.Equal(@"foo.cpp", FileUtilities.
MakeRelative
(@"\\aaa\abc\def", @"\\aaa\abc\def\foo.cpp"));
98
Assert.Equal(@"foo.cpp", FileUtilities.
MakeRelative
(@"c:\abc\def", @"foo.cpp"));
99
Assert.Equal(@"\\host\path\file", FileUtilities.
MakeRelative
(@"c:\abc\def", @"\\host\path\file"));
100
Assert.Equal(@"\\host\d$\file", FileUtilities.
MakeRelative
(@"c:\abc\def", @"\\host\d$\file"));
101
Assert.Equal(@"..\fff\ggg.hh", FileUtilities.
MakeRelative
(@"c:\foo\bar\..\abc\cde", @"c:\foo\bar\..\abc\fff\ggg.hh"));
104
Assert.Equal(@"def\", FileUtilities.
MakeRelative
(@"c:\abc\", @"c:\abc\def\"));
105
Assert.Equal(@"..\", FileUtilities.
MakeRelative
(@"c:\abc\def\xyz\", @"c:\abc\def\"));
106
Assert.Equal(@"..\ttt\", FileUtilities.
MakeRelative
(@"c:\abc\def\xyz\", @"c:\abc\def\ttt\"));
107
Assert.Equal(@".", FileUtilities.
MakeRelative
(@"c:\abc\def\", @"c:\abc\def\"));
110
Assert.Equal(@"def", FileUtilities.
MakeRelative
(@"c:\abc\", @"c:\abc\def"));
111
Assert.Equal(@"..\..\ghi", FileUtilities.
MakeRelative
(@"c:\abc\def\xyz\", @"c:\abc\ghi"));
112
Assert.Equal(@"..\ghi", FileUtilities.
MakeRelative
(@"c:\abc\def\xyz\", @"c:\abc\def\ghi"));
113
Assert.Equal(@"..\ghi", FileUtilities.
MakeRelative
(@"c:\abc\def\", @"c:\abc\ghi"));
116
Assert.Equal(@"def\", FileUtilities.
MakeRelative
(@"c:\abc", @"c:\abc\def\"));
117
Assert.Equal(@"..\", FileUtilities.
MakeRelative
(@"c:\abc\def\xyz", @"c:\abc\def\"));
118
Assert.Equal(@"..\ghi\", FileUtilities.
MakeRelative
(@"c:\abc\def\xyz", @"c:\abc\def\ghi\"));
119
Assert.Equal(@".", FileUtilities.
MakeRelative
(@"c:\abc\def", @"c:\abc\def\"));
123
Assert.Equal(@"bar.cpp", FileUtilities.
MakeRelative
(@"/abc/def", @"/abc/def/bar.cpp"));
124
Assert.Equal(@"def/foo.cpp", FileUtilities.
MakeRelative
(@"/abc/", @"/abc/def/foo.cpp"));
125
Assert.Equal(@"../foo.cpp", FileUtilities.
MakeRelative
(@"/abc/def/xyz", @"/abc/def/foo.cpp"));
126
Assert.Equal(@"../ttt/foo.cpp", FileUtilities.
MakeRelative
(@"/abc/def/xyz/", @"/abc/def/ttt/foo.cpp"));
127
Assert.Equal(@"foo.cpp", FileUtilities.
MakeRelative
(@"/abc/def", @"foo.cpp"));
128
Assert.Equal(@"../fff/ggg.hh", FileUtilities.
MakeRelative
(@"/foo/bar/../abc/cde", @"/foo/bar/../abc/fff/ggg.hh"));
131
Assert.Equal(@"def/", FileUtilities.
MakeRelative
(@"/abc/", @"/abc/def/"));
132
Assert.Equal(@"../", FileUtilities.
MakeRelative
(@"/abc/def/xyz/", @"/abc/def/"));
133
Assert.Equal(@"../ttt/", FileUtilities.
MakeRelative
(@"/abc/def/xyz/", @"/abc/def/ttt/"));
134
Assert.Equal(@".", FileUtilities.
MakeRelative
(@"/abc/def/", @"/abc/def/"));
137
Assert.Equal(@"def", FileUtilities.
MakeRelative
(@"/abc/", @"/abc/def"));
138
Assert.Equal(@"../../ghi", FileUtilities.
MakeRelative
(@"/abc/def/xyz/", @"/abc/ghi"));
139
Assert.Equal(@"../ghi", FileUtilities.
MakeRelative
(@"/abc/def/xyz/", @"/abc/def/ghi"));
140
Assert.Equal(@"../ghi", FileUtilities.
MakeRelative
(@"/abc/def/", @"/abc/ghi"));
143
Assert.Equal(@"def/", FileUtilities.
MakeRelative
(@"/abc", @"/abc/def/"));
144
Assert.Equal(@"../", FileUtilities.
MakeRelative
(@"/abc/def/xyz", @"/abc/def/"));
145
Assert.Equal(@"../ghi/", FileUtilities.
MakeRelative
(@"/abc/def/xyz", @"/abc/def/ghi/"));
146
Assert.Equal(@".", FileUtilities.
MakeRelative
(@"/abc/def", @"/abc/def/"));