Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cs444
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xun Yang
cs444
Commits
514dc46e
Commit
514dc46e
authored
5 years ago
by
pycsham
Browse files
Options
Downloads
Patches
Plain Diff
added a test auto for JE test files
parent
1709670c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ChloeTests/Test.py
+0
-72
0 additions, 72 deletions
ChloeTests/Test.py
ErrorTest.py
+3
-4
3 additions, 4 deletions
ErrorTest.py
with
3 additions
and
76 deletions
ChloeTests/Test.py
deleted
100644 → 0
+
0
−
72
View file @
1709670c
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
()
This diff is collapsed.
Click to expand it.
ChloeTests/
ErrorTest.py
→
ErrorTest.py
+
3
−
4
View file @
514dc46e
import
sys
import
sys
from
os
import
listdir
from
os
import
listdir
from
os.path
import
isfile
,
join
from
os.path
import
isfile
,
join
...
@@ -6,7 +7,6 @@ from Scanning import scan
...
@@ -6,7 +7,6 @@ from Scanning import scan
from
Parsing
import
parse
from
Parsing
import
parse
import
Weeding
import
Weeding
def
allFiles
(
testDir
):
def
allFiles
(
testDir
):
return
[
testDir
+
f
for
f
in
listdir
(
testDir
)
if
isfile
(
join
(
testDir
,
f
))
and
f
.
startswith
(
'
Je
'
)]
return
[
testDir
+
f
for
f
in
listdir
(
testDir
)
if
isfile
(
join
(
testDir
,
f
))
and
f
.
startswith
(
'
Je
'
)]
...
@@ -51,7 +51,7 @@ def main():
...
@@ -51,7 +51,7 @@ def main():
(
steps
,
errorString
)
=
parse
(
tokens
)
(
steps
,
errorString
)
=
parse
(
tokens
)
except
:
except
:
print
(
"
Exception in Parsing
"
)
print
(
"
Exception in Parsing
"
)
# Error in Parsing
# Error in Parsing
if
steps
is
None
:
if
steps
is
None
:
# print("ERROR in Parsing: ", errorString)
# print("ERROR in Parsing: ", errorString)
...
@@ -65,5 +65,4 @@ def main():
...
@@ -65,5 +65,4 @@ def main():
print
(
"
**********************************************************
"
)
print
(
"
**********************************************************
"
)
main
()
main
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment