Skip to content

Commit

Permalink
fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
andreacasalino committed Feb 5, 2024
1 parent 518ff8f commit f1be9d5
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions script/RunTests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import subprocess, argparse, os, platform
import subprocess, argparse, os

def pathJoin(front, *args):
res = front
for piece in args:
res = os.path.join(res, piece)
res = os.path.normpath(res)
res = str(res).replace('\\', '/')
return res

class TestMap:
def forEachProcess(self):
Expand All @@ -14,13 +22,7 @@ def __str__(self):
def run(self):
failed = []
for name in self.forEachProcess():
cmd_possible = {
'Linux':'./{}'.format(name),
'Windows':name
}
cmd = cmd_possible[platform.system()]
print('======================================>>>>> running `{}`'.format(cmd))
completed = subprocess.run([cmd], cwd=self.folder, text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
completed = subprocess.run([pathJoin(self.folder, name)], text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if not completed.returncode == 0:
failed.append(name)
print('{}\n{}\n'.format(completed.stdout, completed.stderr))
Expand Down

0 comments on commit f1be9d5

Please sign in to comment.