| 1 |
|
| 2 |
|
| 3 |
import sys |
| 4 |
|
| 5 |
if len(sys.argv) < 2: |
| 6 |
print("ERROR: You must run program with file name as argument.") |
| 7 |
sys.exit(50) |
| 8 |
|
| 9 |
fname = sys.argv[1] |
| 10 |
|
| 11 |
with open(fname.strip(), "r", encoding="utf-8") as fileread: |
| 12 |
file_contents = fileread.read() |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
if file_contents.find("ERROR: AddressSanitizer:") != -1: |
| 18 |
print("FATAL ERROR: An incorrectly used memory was found.") |
| 19 |
sys.exit(51) |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
if ( |
| 24 |
file_contents.find("Program crashed with signal") != -1 |
| 25 |
or file_contents.find("Dumping the backtrace") != -1 |
| 26 |
or file_contents.find("Segmentation fault (core dumped)") != -1 |
| 27 |
or file_contents.find("Aborted (core dumped)") != -1 |
| 28 |
or file_contents.find("terminate called without an active exception") != -1 |
| 29 |
): |
| 30 |
print("FATAL ERROR: Godot has been crashed.") |
| 31 |
sys.exit(52) |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
if file_contents.find("ERROR: LeakSanitizer:") != -1: |
| 40 |
if file_contents.find("#4 0x") != -1: |
| 41 |
print("ERROR: Memory leak was found") |
| 42 |
sys.exit(53) |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
if file_contents.find("ObjectDB instances leaked at exit") != -1: |
| 49 |
print("ERROR: Memory leak was found") |
| 50 |
sys.exit(54) |
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
if file_contents.find("Assertion failed") != -1: |
| 57 |
print("ERROR: Assertion failed in project, check execution log for more info") |
| 58 |
sys.exit(55) |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
if file_contents.find("were leaked") != -1 or file_contents.find("were never freed") != -1: |
| 64 |
print("WARNING: Memory leak was found") |
| 65 |
|
| 66 |
sys.exit(0) |