8000 Remove testcase_dir if it is empty · sslab-gatech/qsym@4e0c8f5 · GitHub
[go: up one dir, main page]

Skip to content
This repository has been archived by the owner on Mar 2, 2023. It is now read-only.

Commit

Permalink
Remove testcase_dir if it is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
weidangpeng committed Aug 6, 2019
1 parent 6f00c3d commit 4e0c8f5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions qsym/afl.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,12 @@ def run_file(self, fp):
if os.path.exists(q.log_file):
os.unlink(q.log_file)

# Remove testcase_dir if it`s empty
try:
os.rmdir(q.testcase_directory)
except Exception:
pass

logger.debug("Generate %d testcases" % num_testcase)
logger.debug("%d testcases are new" % (self.state.index - old_idx))

Expand Down
4 changes: 4 additions & 0 deletions qsym/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ def status_file(self):
def log_file(self):
return os.path.join(self.testcase_dir, "pin.log")

@property
def testcase_directory(self):
return self.testcase_dir

def check_elf32(self):
# assume cmd[0] is always the target binary (?)
if os.path.exists(self.cmd[0]):
Expand Down

0 comments on commit 4e0c8f5

Please sign in to comment.
0