-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[mono][wasm] Include NativeLibrary items to the NativeFileReference items #101532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -136,5 +136,36 @@ public static int Main() | |||||
string cryptoInitMsg = "MONO_WASM: Initializing Crypto WebWorker"; | ||||||
Assert.DoesNotContain(cryptoInitMsg, output); | ||||||
} | ||||||
|
||||||
[Theory] | ||||||
[BuildAndRun(aot: false)] | ||||||
[BuildAndRun(aot: true)] | ||||||
public void ProjectWithNativeLibrary(BuildArgs buildArgs, RunHost host, string id) | ||||||
{ | ||||||
string projectName = $"AppUsingNativeLibrary-a"; | ||||||
buildArgs = buildArgs with { ProjectName = projectName }; | ||||||
buildArgs = ExpandBuildArgs(buildArgs, extraItems: "<NativeLibrary Include=\"native-lib.o\" />"); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will fail the build, right? It would be ideal to have it conditional as theory data There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to make it not fail the build since NativeLibrary does not mind if the file doesn't exist |
||||||
|
||||||
if (!_buildContext.TryGetBuildFor(buildArgs, out BuildProduct? _)) | ||||||
{ | ||||||
InitPaths(id); | ||||||
if (Directory.Exists(_projectDir)) | ||||||
Directory.Delete(_projectDir, recursive: true); | ||||||
|
||||||
Utils.DirectoryCopy(Path.Combine(BuildEnvironment.TestAssetsPath, "AppUsingNativeLib"), _projectDir); | ||||||
File.Copy(Path.Combine(BuildEnvironment.TestAssetsPath, "native-libs", "native-lib.o"), Path.Combine(_projectDir, "native-lib.o")); | ||||||
} | ||||||
|
||||||
BuildProject(buildArgs, | ||||||
id: id, | ||||||
new BuildProjectOptions(DotnetWasmFromRuntimePack: false)); | ||||||
|
||||||
string output = RunAndTestWasmApp(buildArgs, buildDir: _projectDir, expectedExitCode: 0, | ||||||
test: output => {}, | ||||||
host: host, id: id); | ||||||
|
||||||
Assert.Contains("print_line: 100", output); | ||||||
Assert.Contains("from pinvoke: 142", output); | ||||||
} | ||||||
} | ||||||
} |
Uh oh!
There was an error while loading. Please reload this page.