Skip to content

Commit

Permalink
new pip version, some bug fixed on using current dir and showing muta…
Browse files Browse the repository at this point in the history
…nts that append code
  • Loading branch information
agroce committed Dec 1, 2020
1 parent 9bb9a1a commit c03ae38
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 12 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='universalmutator',
version='1.0',
version='1.0.1',
description='Universal regexp-based mutation tool',
long_description_content_type="text/markdown",
long_description=open('README.md').read(),
Expand Down
3 changes: 2 additions & 1 deletion universalmutator/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def main():
with open(fromFile, 'r') as file:
onlyMutants = file.read().split()

mdir = ""
mdir = "."
try:
mdirpos = args.index("--mutantDir")
except ValueError:
Expand All @@ -107,6 +107,7 @@ def main():
mdir = args[mdirpos + 1]
args.remove("--mutantDir")
args.remove(mdir)
if mdir[-1] != "/":
mdir += "/"

src = args[1]
Expand Down
3 changes: 2 additions & 1 deletion universalmutator/checkcov.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def main():
print(" --tstl: process <coverfile> that is output from TSTL internal report")
sys.exit(0)

mdir = ""
mdir = "."
try:
mdirpos = args.index("--mutantDir")
except ValueError:
Expand All @@ -27,6 +27,7 @@ def main():
mdir = args[mdirpos + 1]
args.remove("--mutantDir")
args.remove(mdir)
if mdir[-1] != "/":
mdir += "/"

src = args[1]
Expand Down
3 changes: 2 additions & 1 deletion universalmutator/genmutants.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def main():
for line in d:
lines.append(int(line))

mdir = ""
mdir = "."
try:
mdirpos = args.index("--mutantDir")
except ValueError:
Expand All @@ -207,6 +207,7 @@ def main():
mdir = args[mdirpos + 1]
args.remove("--mutantDir")
args.remove(mdir)
if mdir[-1] != "/":
mdir += "/"

ignoreFile = None
Expand Down
6 changes: 4 additions & 2 deletions universalmutator/prioritize.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def main():
args.remove("--noSDPriority")
noSDPriority = True

mdir = ""
mdir = "."
try:
mdirpos = args.index("--mutantDir")
except ValueError:
Expand All @@ -46,9 +46,10 @@ def main():
mdir = args[mdirpos + 1]
args.remove("--mutantDir")
args.remove(mdir)
if mdir[-1] != "/":
mdir += "/"

sdir = ""
sdir = "."
try:
sdirpos = args.index("--sourceDir")
except ValueError:
Expand All @@ -58,6 +59,7 @@ def main():
sdir = args[sdirpos + 1]
args.remove("--sourceDir")
args.remove(sdir)
if sdir[-1] != "/":
sdir += "/"

cutoff = 0.0
Expand Down
6 changes: 4 additions & 2 deletions universalmutator/prune.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def main():
outfile = sys.argv[2]
config = sys.argv[3]

mdir = ""
mdir = "."
try:
mdirpos = args.index("--mutantDir")
except ValueError:
Expand All @@ -31,9 +31,10 @@ def main():
mdir = args[mdirpos + 1]
args.remove("--mutantDir")
args.remove(mdir)
if mdir[-1] != "/":
mdir += "/"

sdir = ""
sdir = "."
try:
sdirpos = args.index("--sourceDir")
except ValueError:
Expand All @@ -43,6 +44,7 @@ def main():
sdir = args[sdirpos + 1]
args.remove("--sourceDir")
args.remove(sdir)
if sdir[-1] != "/":
sdir += "/"

mutants = []
Expand Down
8 changes: 5 additions & 3 deletions universalmutator/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def main():

infile = sys.argv[1]

mdir = ""
mdir = "."
try:
mdirpos = args.index("--mutantDir")
except ValueError:
Expand All @@ -28,9 +28,10 @@ def main():
mdir = args[mdirpos + 1]
args.remove("--mutantDir")
args.remove(mdir)
if mdir[-1] != "/":
mdir += "/"

sdir = ""
sdir = "."
try:
sdirpos = args.index("--sourceDir")
except ValueError:
Expand All @@ -40,6 +41,7 @@ def main():
sdir = args[sdirpos + 1]
args.remove("--sourceDir")
args.remove(sdir)
if sdir[-1] != "/":
sdir += "/"

mutants = []
Expand Down
7 changes: 6 additions & 1 deletion universalmutator/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,10 @@ def readMutant(mutant, source, mutantDir=None):
diffFound = True
break
pos += 1
mpos = pos
if not diffFound:
if len(mcode) > len(scode):
pos = len(scode)-1
diffFound = True
assert diffFound, "mutant " + mfile + " and source " + source + " are identical!"
return (mutant, source, pos, scode[pos], mcode[pos])
return (mutant, source, pos, scode[pos], mcode[mpos])

0 comments on commit c03ae38

Please sign in to comment.