Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SMART
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UNI-KLU
SMART
Commits
53192146
Commit
53192146
authored
Feb 11, 2020
by
Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test working under linux
parent
3ab523bb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
testing.py
bin/testing.py
+6
-12
No files found.
bin/testing.py
View file @
53192146
...
@@ -4,37 +4,31 @@ import importlib.util
...
@@ -4,37 +4,31 @@ import importlib.util
import
pathlib
import
pathlib
ROOT
=
pathlib
.
Path
(
__file__
)
.
parent
.
parent
.
absolute
()
ROOT
=
pathlib
.
Path
(
__file__
)
.
parent
.
parent
.
absolute
()
TESTS_FOLDER_NAME
=
"/tests"
print
(
"
\n
Searching for tests at the path: "
+
str
(
ROOT
))
print
(
"
\n
Searching for tests at the path: "
+
str
(
ROOT
))
count
=
0
count
=
0
resultCodeList
=
[]
resultCodeList
=
[]
for
(
dirname
,
dirs
,
files
)
in
os
.
walk
(
ROOT
):
for
(
dirname
,
dirs
,
files
)
in
os
.
walk
(
ROOT
):
#print("\n In dir: "+ str(dirname))
#I assume all the tests are placed in a folder named "tests"
#I assume all the tests are placed in a folder named "tests"
if
(
"
\\
tests"
in
str
(
dirname
))
and
not
(
"
\\
tests
\\
"
in
str
(
dirname
)):
if
(
TESTS_FOLDER_NAME
in
str
(
dirname
))
\
and
not
(
f
"{TESTS_FOLDER_NAME}/"
in
str
(
dirname
))
\
and
not
(
"venv"
in
str
(
dirname
)):
try
:
try
:
os
.
chdir
(
os
.
path
.
normpath
(
dirname
))
os
.
chdir
(
os
.
path
.
normpath
(
dirname
))
exit_val
=
os
.
system
(
"py -m unittest discover"
)
exit_val
=
os
.
system
(
"py
thon3.7
-m unittest discover"
)
resultCodeList
.
append
(
exit_val
)
#once per folder i.e if 3 tests are in a folder and crash, there will be just one exit val
resultCodeList
.
append
(
exit_val
)
#once per folder i.e if 3 tests are in a folder and crash, there will be just one exit val
except
Exception
as
e
:
except
Exception
as
e
:
print
(
e
)
print
(
e
)
continue
continue
"""
for f in files:
#print("
\n
Get Current Directory "+ os.getcwd())
count += 1
print("
\n
"+ str(count) +" Executing: "+ str(os.path.normpath(dirname+"
\\
"+f)))
os.system("py "+ f)
"""
firstError
=
-
1
firstError
=
-
1
i
=
0
i
=
0
while
i
<
len
(
resultCodeList
):
while
i
<
len
(
resultCodeList
):
if
resultCodeList
[
i
]
!=
0
:
if
resultCodeList
[
i
]
!=
0
:
print
(
"
\n
A test failed with code: "
+
resultCodeList
[
i
]
)
# print("\nA test failed with code: "+ str(resultCodeList[i])
)
if
(
firstError
<
0
):
if
(
firstError
<
0
):
firstError
=
i
firstError
=
i
i
+=
1
i
+=
1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment