[tests] Fix framework-test to actually work. (#1297)

* [tests] Fix framework-test to actually work.

* [xharness] Properly replace 'ios' with corresponding platform for paths to our test frameworks as well.

* [framework-test] Fix watchOS build.
This commit is contained in:
Rolf Bjarne Kvinge 2016-12-05 18:35:53 +01:00 коммит произвёл GitHub
Родитель 8dc6b88bbf
Коммит 39d903ab66
5 изменённых файлов: 60 добавлений и 13 удалений

Просмотреть файл

@ -1,4 +1,5 @@
using System;
#if !__WATCHOS__
using System;
using System.Collections.Generic;
using System.Linq;
@ -48,4 +49,4 @@ namespace frameworktest
}
}
}
#endif // !__WATCHOS__

Просмотреть файл

@ -1,4 +1,5 @@
using System;
#if !__WATCHOS__
using System;
using System.Collections.Generic;
using System.Linq;
@ -23,3 +24,4 @@ namespace frameworktest
}
}
}
#endif // !__WATCHOS__

Просмотреть файл

@ -6,10 +6,14 @@
#define FakeType2 object_FakeType2
#define UltimateMachine object_UltimateMachine
#define FrameworkTest object_FrameworkTest
#define Sc object_Sc
#define Scc object_Scc
#define Sccc object_Sccc
#define Sd object_Sd
#define Sdd object_Sdd
#define Sddd object_Sddd
#define Sdddd object_Sdddd
#define Sddddd object_Sddddd
#define Si object_Si
#define Sii object_Sii
#define Siii object_Siii
@ -18,19 +22,37 @@
#define Sid object_Sid
#define Sdi object_Sdi
#define Sidi object_Sidi
#define Sidid object_Sidid
#define Siid object_Siid
#define Sddi object_Sddi
#define Sdidi object_Sdidi
#define Sl object_Sl
#define Sll object_Sll
#define Slll object_Slll
#define Sllll object_Sllll
#define Slllll object_Slllll
#define Sldld object_Sldld
#define Sdldl object_Sdldl
#define Scccc object_Scccc
#define Sffff object_Sffff
#define Sif object_Sif
#define Sifif object_Sifif
#define Sf object_Sf
#define Sff object_Sff
#define Sfff object_Sfff
#define Sffff object_Sffff
#define Sfffff object_Sfffff
#define Siff object_Siff
#define Siiff object_Siiff
#define Sfi object_Sfi
#define Sfifi object_Sfifi
#define Ss object_Ss
#define Sss object_Sss
#define Ssss object_Ssss
#define Sssss object_Sssss
#define CtorChaining1 object_CtorChaining1
#define ObjCExceptionTest object_ObjCExceptionTest
#define ObjCProtocolClassTest object_ObjCProtocolClassTest
#elif PREFIX == 2
#define theUltimateAnswer ar_theUltimateAnswer
#define useZLib ar_useZLib
@ -38,10 +60,14 @@
#define FakeType2 ar_FakeType2
#define UltimateMachine ar_UltimateMachine
#define FrameworkTest ar_FrameworkTest
#define Sc ar_Sc
#define Scc ar_Scc
#define Sccc ar_Sccc
#define Sd ar_Sd
#define Sdd ar_Sdd
#define Sddd ar_Sddd
#define Sdddd ar_Sdddd
#define Sddddd ar_Sddddd
#define Si ar_Si
#define Sii ar_Sii
#define Siii ar_Siii
@ -50,19 +76,37 @@
#define Sid ar_Sid
#define Sdi ar_Sdi
#define Sidi ar_Sidi
#define Sidid ar_Sidid
#define Siid ar_Siid
#define Sddi ar_Sddi
#define Sdidi ar_Sdidi
#define Sl ar_Sl
#define Sll ar_Sll
#define Slll ar_Slll
#define Sllll ar_Sllll
#define Slllll ar_Slllll
#define Sldld ar_Sldld
#define Sdldl ar_Sdldl
#define Scccc ar_Scccc
#define Sffff ar_Sffff
#define Sif ar_Sif
#define Sifif ar_Sifif
#define Sf ar_Sf
#define Sff ar_Sff
#define Sfff ar_Sfff
#define Sffff ar_Sffff
#define Sfffff ar_Sfffff
#define Siff ar_Siff
#define Siiff ar_Siiff
#define Sfi ar_Sfi
#define Sfifi ar_Sfifi
#define Ss ar_Ss
#define Sss ar_Sss
#define Ssss ar_Ssss
#define Sssss ar_Sssss
#define CtorChaining1 ar_CtorChaining1
#define ObjCExceptionTest ar_ObjCExceptionTest
#define ObjCProtocolClassTest ar_ObjCProtocolClassTest
#else
// keep original names
#endif

Просмотреть файл

@ -260,11 +260,6 @@ namespace xharness
Devices = taskGroup.First ().Simulators,
});
}
foreach (var task in runSimulatorTasks) {
if (task.TestName == "framework-test")
task.ExecutionResult = TestExecutingResult.Ignored;
}
}
if (IncludeiOSMSBuild) {

Просмотреть файл

@ -347,17 +347,22 @@ namespace xharness
public static void FixTestLibrariesReferences (this XmlDocument csproj, string platform)
{
var nodes = csproj.SelectNodes ("//*[local-name() = 'ObjcBindingNativeLibrary']");
var nodes = csproj.SelectNodes ("//*[local-name() = 'ObjcBindingNativeLibrary' or local-name() = 'ObjcBindingNativeFramework']");
var test_libraries = new string [] { "libtest.a", "XTest.framework", "XStaticArTest.framework", "XStaticObjectTest.framework" };
foreach (XmlNode node in nodes) {
var includeAttribute = node.Attributes ["Include"];
if (includeAttribute != null)
includeAttribute.Value = includeAttribute.Value.Replace ("test-libraries\\.libs\\ios\\libtest.a", "test-libraries\\.libs\\" + platform + "\\libtest.a");
if (includeAttribute != null) {
foreach (var tl in test_libraries)
includeAttribute.Value = includeAttribute.Value.Replace ($"test-libraries\\.libs\\ios\\{tl}", $"test-libraries\\.libs\\{platform}\\{tl}");
}
}
nodes = csproj.SelectNodes ("//*[local-name() = 'Target' and @Name = 'BeforeBuild']");
foreach (XmlNode node in nodes) {
var outputsAttribute = node.Attributes ["Outputs"];
if (outputsAttribute != null)
outputsAttribute.Value = outputsAttribute.Value.Replace ("test-libraries\\.libs\\ios\\libtest.a", "test-libraries\\.libs\\" + platform + "\\libtest.a");
if (outputsAttribute != null) {
foreach (var tl in test_libraries)
outputsAttribute.Value = outputsAttribute.Value.Replace ($"test-libraries\\.libs\\ios\\${tl}", $"test-libraries\\.libs\\{platform}\\${tl}");
}
}
}