Skip to content

Commit

Permalink
Embedder samples tests
Browse files Browse the repository at this point in the history
TEST=new test for ci

Change-Id: I982583ef21c5907bde1dcbc1c34e57c2c0fae770
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/398902
Reviewed-by: Slava Egorov <[email protected]>
Commit-Queue: Ivan Inozemtsev <[email protected]>
  • Loading branch information
iinozemtsev authored and Commit Queue committed Dec 24, 2024
1 parent 3557eb4 commit a7fe1e6
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ group("runtime") {
"runtime/bin:process_test",
"runtime/bin:run_vm_tests",
"runtime/vm:kernel_platform_files($host_toolchain)",
"samples/embedder:all",
"samples/ffi/http:fake_http",
"utils/dartdev:dartdev",
"utils/kernel-service:kernel-service",
Expand Down
14 changes: 14 additions & 0 deletions runtime/bin/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,20 @@ source_set("dart_embedder_runtime_jit_set") {
":libdart_builtin",
"..:libdart_jit",
]

if (is_win) {
libs = [
# ole32.dll contains CoTaskMemAlloc. Here so that package:ffi can look
# CoTaskMemAlloc up with `DynamicLibrary.process()`.
"ole32.lib",
"iphlpapi.lib",
"psapi.lib",
"ws2_32.lib",
"Rpcrt4.lib",
"shlwapi.lib",
"winmm.lib",
]
}
}

static_library("dart_embedder_runtime_jit") {
Expand Down
10 changes: 10 additions & 0 deletions runtime/tools/entitlements/run_kernel.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
</dict>
</plist>
23 changes: 23 additions & 0 deletions tests/standalone/embedder_samples_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import 'dart:io';

import 'package:expect/expect.dart';

void main() {
final executable = Platform.executable;
final outDir = executable.substring(0, executable.lastIndexOf('dart'));

final runKernelExecutable = outDir + 'run_kernel';

final result = Process.runSync(runKernelExecutable, []);
Expect.equals(
0,
result.exitCode,
'process failed:\n'
' exit code: ${result.exitCode}\n'
' -- stdout --\n'
'${result.stdout}'
' -- stderr --\n'
'${result.stderr}\n'
' ------------',
);
}

0 comments on commit a7fe1e6

Please sign in to comment.