-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmscriptenTests.cs
More file actions
68 lines (55 loc) · 2.14 KB
/
Copy pathEmscriptenTests.cs
File metadata and controls
68 lines (55 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using JSIL.Internal;
using NUnit.Framework;
namespace JSIL.Tests {
[TestFixture]
public class EmscriptenTests : GenericTestFixture {
public string DllPath;
[TestFixtureSetUp]
public void SetUp () {
var testDir = Path.Combine(ComparisonTest.TestSourceFolder, "EmscriptenTestCases");
string stdout, stderr;
var exitCode = ProcessUtil.Run(Path.Combine(testDir, "vcbuild.bat"), "", null, out stderr, out stdout);
Console.WriteLine(stdout);
if (exitCode != 0) {
Console.WriteLine(stderr);
throw new Exception("Failed to build common.dll.");
}
DllPath = Path.Combine(testDir, "common.dll");
exitCode = ProcessUtil.Run(Path.Combine(testDir, "embuild.bat"), "", null, out stderr, out stdout);
Console.WriteLine(stdout);
if (exitCode != 0) {
Console.WriteLine(stderr);
throw new Exception("Failed to build common.emjs.");
}
}
protected override Translator.Configuration MakeConfiguration () {
var result = base.MakeConfiguration();
result.CodeGenerator.EnableUnsafeCode = true;
return result;
}
[Test]
[TestCaseSource("EmscriptenTestCasesSource")]
public void EmscriptenTestCases (object[] parameters) {
RunSingleComparisonTestCase(
parameters,
MakeConfiguration,
compilerOptions: "/unsafe",
getTestRunnerQueryString: (() =>
"dll=Tests/EmscriptenTestCases/common.emjs"),
scanForProxies: true,
extraDependencies: new [] { DllPath }
);
}
protected IEnumerable<TestCaseData> EmscriptenTestCasesSource () {
return FolderTestSource("EmscriptenTestCases", MakeDefaultProvider(), new AssemblyCache());
}
}
}