diff --git a/ChloeTests/Test.py b/ChloeTests/Test.py deleted file mode 100644 index 02941d79433d1c8d430c36b10577041b489227de..0000000000000000000000000000000000000000 --- a/ChloeTests/Test.py +++ /dev/null @@ -1,72 +0,0 @@ -import sys -from os import listdir -from os.path import isfile, join - -from Scanning import scan -from Parsing import parse -import Weeding - - -def allFiles(testDir): - return [testDir + f for f in listdir(testDir) if isfile(join(testDir, f)) and f.startswith('J1')] - -def main(): - - # All files in the test directory - testDirectory = "./Tests/" - testFiles = allFiles(testDirectory) - testFiles = ['./Tests/J1_IntRange_MinNegativeInt.java'] - print("**********************************************************") - - for f in testFiles: - # print(f) - - # Scanning - content = open(f, "r").read() - (tokens, errorString) = scan(content) - # Error in Scanning - if tokens is None: - print(f) - print("ERROR in Scanning: " + errorString) - print("**********************************************************") - continue - - s = "All Tokens: " - for token in tokens: - if (token.name and token.lex): - s += '(' + token.name + ',' + token.lex + '), ' - print(s) - - # No weeds if everything is good (weeds = None) - weeds = Weeding.fileNameCheck(tokens, f) - if weeds: - print(weeds) - continue - - - - # Parsing - # print("Parsing starts") - - try: - (steps, errorString) = parse(tokens) - except: - print("Exception in Parsing") - - # Error in Parsing - if steps is None: - # print(f) - # # print("ERROR IN PARSING") - # print("ERROR in Parsing: ", errorString) - # print("**********************************************************") - continue - - # print(f) - # print("Succeeded") - # print("All Steps:") - # print(steps) - - print("**********************************************************") - -main() - diff --git a/ChloeTests/ErrorTest.py b/ErrorTest.py similarity index 99% rename from ChloeTests/ErrorTest.py rename to ErrorTest.py index aba22c876097663540cd5b9f426bfbf74d6ce573..e2a3788809e0bd1e09d4e33bc72c774278f38abd 100644 --- a/ChloeTests/ErrorTest.py +++ b/ErrorTest.py @@ -1,3 +1,4 @@ + import sys from os import listdir from os.path import isfile, join @@ -6,7 +7,6 @@ from Scanning import scan from Parsing import parse import Weeding - def allFiles(testDir): return [testDir + f for f in listdir(testDir) if isfile(join(testDir, f)) and f.startswith('Je')] @@ -51,7 +51,7 @@ def main(): (steps, errorString) = parse(tokens) except: print("Exception in Parsing") - + # Error in Parsing if steps is None: # print("ERROR in Parsing: ", errorString) @@ -65,5 +65,4 @@ def main(): print("**********************************************************") -main() - +main() \ No newline at end of file