|
| 1 | +# ====------ do_test.py---------- *- Python -* ----===## |
| 2 | +# |
| 3 | +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | +# See https://llvm.org/LICENSE.txt for license information. |
| 5 | +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | +# |
| 7 | +# |
| 8 | +# ===----------------------------------------------------------------------===# |
| 9 | +import subprocess |
| 10 | +import platform |
| 11 | +import os |
| 12 | +import sys |
| 13 | + |
| 14 | +from test_utils import * |
| 15 | + |
| 16 | + |
| 17 | +def setup_test(): |
| 18 | + change_dir(test_config.current_test) |
| 19 | + return True |
| 20 | + |
| 21 | + |
| 22 | +def migrate_test(): |
| 23 | + call_subprocess( |
| 24 | + test_config.CT_TOOL + " test.cu -analysis-mode --cuda-include-path=" + test_config.include_path) |
| 25 | + |
| 26 | + |
| 27 | + reference_lines = [ |
| 28 | + ["test.cu:"], |
| 29 | + ["lines of code", "will be automatically migrated."], |
| 30 | + ["APIs/Types - No manual effort."], |
| 31 | + ["APIs/Types - Low manual effort for checking and code fixing."], |
| 32 | + ["APIs/Types - Medium manual effort for code fixing."], |
| 33 | + ["lines of code", "will not be automatically migrated."], |
| 34 | + ["APIs/Types - High manual effort for code fixing."], |
| 35 | + ["Total Project:"], |
| 36 | + ["lines of code", "will be automatically migrated."], |
| 37 | + ["APIs/Types - No manual effort."], |
| 38 | + ["APIs/Types - Low manual effort for checking and code fixing."], |
| 39 | + ["APIs/Types - Medium manual effort for code fixing."], |
| 40 | + ["lines of code", "will not be automatically migrated."], |
| 41 | + ["APIs/Types - High manual effort for code fixing."]] |
| 42 | + |
| 43 | + ret_lines = test_config.command_output.splitlines() |
| 44 | + res = True |
| 45 | + idx = 5 |
| 46 | + for refs in reference_lines: |
| 47 | + ret = ret_lines[idx] |
| 48 | + for ref in refs: |
| 49 | + if ref not in ret: |
| 50 | + res = False |
| 51 | + print("there should be a '" + ref + "' in output.") |
| 52 | + idx = idx + 1 |
| 53 | + |
| 54 | + return res |
| 55 | + |
| 56 | + |
| 57 | +def build_test(): |
| 58 | + return True |
| 59 | + |
| 60 | + |
| 61 | +def run_test(): |
| 62 | + return True |
0 commit comments