Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Unified Diff: runtime/bin/fuchsia_test.cc

Issue 2148533002: Fuchsia: Platform specific calls needed to Initialize and Cleanup VM. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/bin.gypi ('k') | runtime/bin/log_fuchsia.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/fuchsia_test.cc
diff --git a/runtime/bin/fuchsia_test.cc b/runtime/bin/fuchsia_test.cc
index 802ff31fabaa8c5628ab8a483900e7a57b271489..e92014089d56e40cc25de3ba8d8f80e4c610f576 100644
--- a/runtime/bin/fuchsia_test.cc
+++ b/runtime/bin/fuchsia_test.cc
@@ -7,16 +7,18 @@
#include <dart_api.h>
-int main(void) {
- fprintf(stderr, "Calling Dart_SetVMFlags\n");
- fflush(stderr);
+#include "bin/log.h"
+
+namespace dart {
+namespace bin {
+
+int Main() {
+ Log::Print("Calling Dart_SetVMFlags\n");
if (!Dart_SetVMFlags(0, NULL)) {
- fprintf(stderr, "Failed to set flags\n");
- fflush(stderr);
+ Log::PrintErr("Failed to set flags\n");
return -1;
}
- fprintf(stderr, "Calling Dart_Initialize\n");
- fflush(stderr);
+ Log::Print("Calling Dart_Initialize\n");
char* error = Dart_Initialize(
NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
@@ -28,12 +30,26 @@ int main(void) {
NULL,
NULL);
if (error != NULL) {
- fprintf(stderr, "VM initialization failed: %s\n", error);
- fflush(stderr);
+ Log::PrintErr("VM initialization failed: %s\n", error);
free(error);
return -1;
}
- fprintf(stderr, "Success!\n");
- fflush(stderr);
+
+ Log::Print("Calling Dart_Cleanup\n");
+ error = Dart_Cleanup();
+ if (error != NULL) {
+ Log::PrintErr("VM Cleanup failed: %s\n", error);
+ free(error);
+ return -1;
+ }
+
+ Log::Print("Success!\n");
return 0;
}
+
+} // namespace bin
+} // namespace dart
+
+int main(void) {
+ return dart::bin::Main();
+}
« no previous file with comments | « runtime/bin/bin.gypi ('k') | runtime/bin/log_fuchsia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698