| 45 | |
| 46 | ## |
| 47 | class TestVTKFiles: |
| 48 | def __init__(self): |
| 49 | self.FileName = "" |
| 50 | self.ErrorValue = 0; |
| 51 | self.Errors = {} |
| 52 | self.WarningValue = 0; |
| 53 | self.Warnings = {} |
| 54 | self.FileLines = [] |
| 55 | self.Export = "" |
| 56 | self.UnnecessaryIncludes = [ |
| 57 | "stdio.h", |
| 58 | "stdlib.h", |
| 59 | "string.h", |
| 60 | "iostream", |
| 61 | "iostream.h", |
| 62 | "strstream", |
| 63 | "strstream.h", |
| 64 | "fstream", |
| 65 | "fstream.h", |
| 66 | "windows.h" |
| 67 | ] |
| 68 | def SetExport(self, export): |
| 69 | self.Export = export |
| 70 | def Print(self, text=""): |
| 71 | rtext = text |
| 72 | if test_from_ctest: |
| 73 | rtext = rtext.replace("<", "<") |
| 74 | rtext = rtext.replace(">", ">") |
| 75 | print(rtext) |
| 76 | def Error(self, error): |
| 77 | self.ErrorValue = 1 |
| 78 | self.Errors[error] = 1 |
| 79 | def Warning(self, warning): |
| 80 | self.WarningValue = 1 |
| 81 | self.Warnings[warning] = 1 |
| 82 | def PrintErrors(self): |
| 83 | if self.ErrorValue: |
| 84 | self.Print( ) |
| 85 | self.Print( "There were errors:" ) |
| 86 | for a in self.Errors: |
| 87 | self.Print( "* %s" % a ) |
| 88 | def PrintWarnings(self): |
| 89 | if self.WarningValue: |
| 90 | self.Print( ) |
| 91 | self.Print( "There were warnings:" ) |
| 92 | for a in self.Warnings: |
| 93 | self.Print( "* %s" % a ) |
| 94 | |
| 95 | def TestFile(self, filename): |
| 96 | self.FileName = filename |
| 97 | self.FileLines = [] |
| 98 | self.ClassName = "" |
| 99 | self.ParentName = "" |
| 100 | self.HasIncludes = False |
| 101 | self.HasTypedef = False |
| 102 | self.HasClass = False |
| 103 | self.HasFunction = False |
| 104 | |