Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include <fcntl.h> | 5 #include <fcntl.h> |
| 6 #include <launchpad/launchpad.h> | 6 #include <launchpad/launchpad.h> |
| 7 #include <launchpad/vmo.h> | 7 #include <launchpad/vmo.h> |
| 8 #include <magenta/syscalls.h> | 8 #include <magenta/syscalls.h> |
| 9 #include <mxio/util.h> | 9 #include <mxio/util.h> |
| 10 #include <pthread.h> | 10 #include <pthread.h> |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 | 24 |
| 25 // TODO(zra): Make this a command line argument | 25 // TODO(zra): Make this a command line argument |
| 26 const char* kRunVmTestsPath = "/boot/bin/dart_vm_tests"; | 26 const char* kRunVmTestsPath = "/boot/bin/dart_vm_tests"; |
| 27 | 27 |
| 28 // Tests that are invalid, wedge, or cause panics. | 28 // Tests that are invalid, wedge, or cause panics. |
| 29 const char* kSkip[] = { | 29 const char* kSkip[] = { |
| 30 // These expect a file to exist that we aren't putting in the image. | 30 // These expect a file to exist that we aren't putting in the image. |
| 31 "Read", | 31 "Read", |
| 32 "FileLength", | 32 "FileLength", |
| 33 "FilePosition", | 33 "FilePosition", |
| 34 // Crash and then Hang. | 34 // Crash in abort() and then hang. (MG-252) |
| 35 "ArrayLengthMaxElements", | 35 "ArrayLengthMaxElements", |
| 36 "Int8ListLengthMaxElements", | 36 "Int8ListLengthMaxElements", |
| 37 "ArrayNew_Overflow_Crash", | |
| 38 "SNPrint_BadArgs", | |
| 39 "IsolateReload_PendingUnqualifiedCall_InstanceToStatic", | |
| 40 "IsolateReload_PendingUnqualifiedCall_StaticToInstance", | |
| 41 "IsolateReload_PendingConstructorCall_AbstractToConcrete", | |
| 42 "IsolateReload_PendingConstructorCall_ConcreteToAbstract", | |
| 43 "IsolateReload_PendingStaticCall_DefinedToNSM", | |
| 44 "IsolateReload_PendingStaticCall_NSMToDefined", | |
| 37 // The profiler is turned off. | 45 // The profiler is turned off. |
| 38 "Profiler_AllocationSampleTest", | 46 "Profiler_AllocationSampleTest", |
| 39 "Profiler_ArrayAllocation", | 47 "Profiler_ArrayAllocation", |
| 40 "Profiler_BasicSourcePosition", | 48 "Profiler_BasicSourcePosition", |
| 41 "Profiler_BasicSourcePositionOptimized", | 49 "Profiler_BasicSourcePositionOptimized", |
| 42 "Profiler_BinaryOperatorSourcePosition", | 50 "Profiler_BinaryOperatorSourcePosition", |
| 43 "Profiler_BinaryOperatorSourcePositionOptimized", | 51 "Profiler_BinaryOperatorSourcePositionOptimized", |
| 44 "Profiler_ChainedSamples", | 52 "Profiler_ChainedSamples", |
| 45 "Profiler_ClosureAllocation", | 53 "Profiler_ClosureAllocation", |
| 46 "Profiler_CodeTicks", | 54 "Profiler_CodeTicks", |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 58 "Profiler_ToggleRecordAllocation", | 66 "Profiler_ToggleRecordAllocation", |
| 59 "Profiler_TrivialRecordAllocation", | 67 "Profiler_TrivialRecordAllocation", |
| 60 "Profiler_TypedArrayAllocation", | 68 "Profiler_TypedArrayAllocation", |
| 61 "Profiler_GetSourceReport", | 69 "Profiler_GetSourceReport", |
| 62 "Service_Profile", | 70 "Service_Profile", |
| 63 // No realpath, files not in image. | 71 // No realpath, files not in image. |
| 64 "Dart2JSCompilerStats", | 72 "Dart2JSCompilerStats", |
| 65 "Dart2JSCompileAll", | 73 "Dart2JSCompileAll", |
| 66 // Uses too much memory. | 74 // Uses too much memory. |
| 67 "PrintJSON", | 75 "PrintJSON", |
| 68 }; | 76 // Need OS::GetCurrentThreadCPUMicros. |
| 69 | 77 // Skipping because they crash and hang. (MG-252) |
| 70 // Expected to fail/crash. | |
| 71 const char* kExpectFail[] = { | |
| 72 "Fail0", | |
| 73 "Fail1", | |
| 74 "Fail2", | |
| 75 "IsolateReload_PendingUnqualifiedCall_InstanceToStatic", | |
| 76 "IsolateReload_PendingUnqualifiedCall_StaticToInstance", | |
| 77 "IsolateReload_PendingConstructorCall_AbstractToConcrete", | |
| 78 "IsolateReload_PendingConstructorCall_ConcreteToAbstract", | |
| 79 "IsolateReload_PendingStaticCall_DefinedToNSM", | |
| 80 "IsolateReload_PendingStaticCall_NSMToDefined", | |
| 81 "ArrayNew_Overflow_Crash", | |
| 82 "AllocGeneric_Overflow", | |
| 83 "CodeImmutability", | |
| 84 "SNPrint_BadArgs", | |
| 85 }; | |
| 86 | |
| 87 // Bugs to fix, or things that are not yet impelemnted. | |
| 88 const char* kBugs[] = { | |
| 89 // Needs OS::GetCurrentThreadCPUMicros. | |
| 90 "Timeline_Dart_TimelineGetTrace", | 78 "Timeline_Dart_TimelineGetTrace", |
| 91 "Timeline_Dart_TimelineGetTraceOnlyDartEvents", | 79 "Timeline_Dart_TimelineGetTraceOnlyDartEvents", |
| 92 "Timeline_Dart_TimelineGetTraceWithDartEvents", | 80 "Timeline_Dart_TimelineGetTraceWithDartEvents", |
| 93 "Timeline_Dart_TimelineGetTraceGlobalOverride", | 81 "Timeline_Dart_TimelineGetTraceGlobalOverride", |
| 94 "Timeline_Dart_GlobalTimelineGetTrace", | 82 "Timeline_Dart_GlobalTimelineGetTrace", |
| 95 "Timeline_Dart_GlobalTimelineGetTrace_Threaded", | 83 "Timeline_Dart_GlobalTimelineGetTrace_Threaded", |
| 96 "TimelineEventDuration", | 84 "TimelineEventDuration", |
| 97 "TimelineEventDurationPrintJSON", | 85 "TimelineEventDurationPrintJSON", |
| 98 "TimelineEventArguments", | 86 "TimelineEventArguments", |
| 99 "TimelineEventArgumentsPrintJSON", | 87 "TimelineEventArgumentsPrintJSON", |
| 100 "TimelineEventCallbackRecorderBasic", | 88 "TimelineEventCallbackRecorderBasic", |
| 101 "TimelineAnalysis_ThreadBlockCount", | 89 "TimelineAnalysis_ThreadBlockCount", |
| 102 "TimelineRingRecorderJSONOrder", | 90 "TimelineRingRecorderJSONOrder", |
| 103 "TimelinePauses_BeginEnd", | 91 "TimelinePauses_BeginEnd", |
| 92 }; | |
| 93 | |
| 94 // Expected to fail/crash. | |
| 95 const char* kExpectFail[] = { | |
| 96 "Fail0", | |
| 97 "Fail1", | |
| 98 "Fail2", | |
| 99 "AllocGeneric_Overflow", | |
| 100 "CodeImmutability", | |
| 101 }; | |
| 102 | |
| 103 // Bugs to fix, or things that are not yet impelemnted. | |
|
siva
2016/08/25 18:02:10
implemented
zra
2016/08/25 18:14:14
Done.
| |
| 104 const char* kBugs[] = { | |
| 104 // Needs NativeSymbolResolver | 105 // Needs NativeSymbolResolver |
| 105 "Service_PersistentHandles", | 106 "Service_PersistentHandles", |
| 106 // pthread TLS destructors are not run. | |
| 107 "ThreadIterator_AddFindRemove", | |
| 108 }; | 107 }; |
| 109 | 108 |
| 110 | 109 |
| 111 static bool contains(const char** list, intptr_t len, const char* str) { | 110 static bool contains(const char** list, intptr_t len, const char* str) { |
| 112 for (intptr_t i = 0; i < len; i++) { | 111 for (intptr_t i = 0; i < len; i++) { |
| 113 if (strcmp(list[i], str) == 0) { | 112 if (strcmp(list[i], str) == 0) { |
| 114 return true; | 113 return true; |
| 115 } | 114 } |
| 116 } | 115 } |
| 117 return false; | 116 return false; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 159 status = launchpad_arguments(lp, argc, argv); | 158 status = launchpad_arguments(lp, argc, argv); |
| 160 RETURN_IF_ERROR(status); | 159 RETURN_IF_ERROR(status); |
| 161 status = launchpad_clone_mxio_root(lp); | 160 status = launchpad_clone_mxio_root(lp); |
| 162 RETURN_IF_ERROR(status); | 161 RETURN_IF_ERROR(status); |
| 163 status = launchpad_add_pipe(lp, stdout_out, 1); | 162 status = launchpad_add_pipe(lp, stdout_out, 1); |
| 164 RETURN_IF_ERROR(status); | 163 RETURN_IF_ERROR(status); |
| 165 status = launchpad_add_pipe(lp, stderr_out, 2); | 164 status = launchpad_add_pipe(lp, stderr_out, 2); |
| 166 RETURN_IF_ERROR(status); | 165 RETURN_IF_ERROR(status); |
| 167 status = launchpad_elf_load(lp, binary_vmo); | 166 status = launchpad_elf_load(lp, binary_vmo); |
| 168 RETURN_IF_ERROR(status); | 167 RETURN_IF_ERROR(status); |
| 168 status = launchpad_load_vdso(lp, MX_HANDLE_INVALID); | |
| 169 RETURN_IF_ERROR(status); | |
| 169 *lp_out = lp; | 170 *lp_out = lp; |
| 170 return status; | 171 return status; |
| 171 } | 172 } |
| 172 | 173 |
| 173 | 174 |
| 174 // Start the test running and return file descriptors for the stdout and stderr | 175 // Start the test running and return file descriptors for the stdout and stderr |
| 175 // pipes. | 176 // pipes. |
| 176 static mx_handle_t start_test(mx_handle_t binary_vmo, const char* test_name, | 177 static mx_handle_t start_test(mx_handle_t binary_vmo, const char* test_name, |
| 177 int* stdout_out, int* stderr_out) { | 178 int* stdout_out, int* stderr_out) { |
| 178 const intptr_t kArgc = 2; | 179 const intptr_t kArgc = 2; |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 432 RETURN_IF_ERROR(status); | 433 RETURN_IF_ERROR(status); |
| 433 | 434 |
| 434 // Complain if we didn't try to run all of the tests. | 435 // Complain if we didn't try to run all of the tests. |
| 435 if (test_list_index != lines_count) { | 436 if (test_list_index != lines_count) { |
| 436 fprintf(stderr, "Failed to attempt all the tests!\n"); | 437 fprintf(stderr, "Failed to attempt all the tests!\n"); |
| 437 fflush(0); | 438 fflush(0); |
| 438 return -1; | 439 return -1; |
| 439 } | 440 } |
| 440 return 0; | 441 return 0; |
| 441 } | 442 } |
| OLD | NEW |