test_assemblies :=
+test_lib_dir = $(topdir)/class/lib/$(PROFILE)/tests
+
+test_lib_output = $(topdir)/class/lib/$(PROFILE)/tests/$(test_lib)
+
ifdef HAVE_CS_TESTS
-test_assemblies += $(test_lib)
+test_assemblies += $(test_lib_output)
endif
ifdef test_assemblies
ifdef HAVE_CS_TESTS
-$(test_lib): $(the_assembly) $(test_response) $(test_nunit_dep)
+$(test_lib_dir):
+ mkdir -p $@
+
+$(test_lib_output): $(the_assembly) $(test_response) $(test_nunit_dep) $(test_lib_dir)
$(TEST_COMPILE) $(LIBRARY_FLAGS) -target:library -out:$@ $(test_flags) $(LOCAL_TEST_COMPILER_ONDOTNET_FLAGS) @$(test_response)
test_response_preprocessed = $(test_response)_preprocessed
-include $(test_makefrag)
-build-test-lib: $(test_lib)
+build-test-lib: $(test_lib_output)
@echo Building testing lib
endif
$(TEST_RESX_RESOURCES): %.resources: %.resx
$(RESGEN) $< || cp $@.prebuilt $@
-$(test_lib): $(TEST_RESX_RESOURCES)
+$(test_lib_output): $(TEST_RESX_RESOURCES) $(test_lib_dir)
var xml = XmlReader.Create (new StringReader (empty_project_xml), null, "file:///foo.xml");
// This creator does not fill FullPath...
var root = ProjectRootElement.Create (xml);
+
+ // Expected to run from mcs/class/lib/profile
+ var dir_name = Path.GetDirectoryName (new Uri (GetType ().Assembly.CodeBase).LocalPath);
+ var namespace_path = Path.Combine (Directory.GetParent (dir_name).Parent.FullName, "Microsoft.Build");
+
Assert.IsNull (root.FullPath, "#2");
- Assert.AreEqual (Path.GetDirectoryName (new Uri (GetType ().Assembly.CodeBase).LocalPath), root.DirectoryPath, "#3");
+ Assert.AreEqual (namespace_path, root.DirectoryPath, "#3");
}
[Test]
{
var root = ProjectRootElement.Create ();
root.FullPath = "test" + Path.DirectorySeparatorChar + "foo.xml";
- var full = Path.Combine (Path.GetDirectoryName (new Uri (GetType ().Assembly.CodeBase).LocalPath), "test", "foo.xml");
+
+ // Expected to run from mcs/class/lib/profile
+ var dir_name = Path.GetDirectoryName (new Uri (GetType ().Assembly.CodeBase).LocalPath);
+ var namespace_path = Path.Combine (Directory.GetParent (dir_name).Parent.FullName, "Microsoft.Build");
+ var full = Path.Combine (namespace_path, "test", "foo.xml");
Assert.AreEqual (full, root.FullPath, "#1");
Assert.AreEqual (Path.GetDirectoryName (full), root.DirectoryPath, "#1");
}
if (!name.EndsWith (".xml"))
name = name + ".xml";
var uri = new Uri (asm.CodeBase);
+ // Run from mcs/class/lib/<profile>
var path = Path.GetDirectoryName (uri.AbsolutePath);
+ path = Directory.GetParent (path).Parent.FullName;
+ path = Path.Combine (path, "System.ServiceModel");
path = Path.Combine (path, "Test");
path = Path.Combine (path, "MetadataTests");
path = Path.Combine (path, "Resources");
name = name + ".config";
var uri = new Uri (asm.CodeBase);
var path = Path.GetDirectoryName (uri.AbsolutePath);
+ path = Directory.GetParent (path).Parent.FullName;
+ path = Path.Combine (path, "System.ServiceModel");
path = Path.Combine (path, "Test");
path = Path.Combine (path, "MetadataTests");
path = Path.Combine (path, "Resources");
static CacheItemPriorityQueueTest ()
{
- dataDir =
- Path.Combine (
- Path.Combine (
- Path.Combine (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location), "Test"),
- "System.Web.Caching"),
- DATA_DIR);
+ // Assumes this is compiled into mcs/class/lib/<profile>
+ string class_dir = Directory.GetParent (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location)).Parent.FullName;
+ string system_web_dir = Path.Combine (class_dir, "System.Web", "Test", "System.Web.Caching");
+ dataDir = Path.Combine (system_web_dir, DATA_DIR);
}
void RunTest (string testsFileName, string listFileName)
$(build_lib): $(CYCLIC_DEP_FILES)
-$(test_lib): $(TEST_RESOURCES)
+$(test_lib_output): $(TEST_RESOURCES) $(test_lib_dir)
CLEAN_FILES = $(test_lib).config $(bare_libdir)/System.dll $(secxml_libdir)/System.dll $(bare_libdir)/System.dll.mdb $(secxml_libdir)/System.dll.mdb
satellite_assembly1 = es-ES/$(patsubst %.dll,%.resources.dll,$(test_lib))
satellite_assembly2 = nn-NO/$(patsubst %.dll,%.resources.dll,$(test_lib))
-$(test_lib): $(TEST_RESOURCES) $(satellite_assembly1) $(satellite_assembly2)
+$(test_lib_output): $(TEST_RESOURCES) $(satellite_assembly1) $(satellite_assembly2) $(test_lib_dir)
$(satellite_assembly1): Test/resources/culture-es-ES.cs Test/resources/Resources.es-ES.resources
@mkdir -p es-ES
[Category ("MobileNotWorking")]
public void Bug415628 ()
{
- using (var f = File.Open (Path.Combine (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location), "Test/resources/415628.bin"), FileMode.Open)) {
+ DirectoryInfo bcl_output_dir = Directory.GetParent (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location));
+ string namespace_dir = Path.Combine (bcl_output_dir.Parent.FullName, "corlib");
+ using (var f = File.Open (Path.Combine (namespace_dir, "Test/resources/415628.bin"), FileMode.Open)) {
BinaryReader br = new BinaryReader (f);
byte [] buf = br.ReadBytes (8000);
Encoding.UTF8.GetString(buf);