Skip to content
Permalink
Browse files

sanitycheck: Execute binary in output directory

Execute the test binary from the output directory instead of directory
where sanitycheck was started.

This will ensure that any artifact created with a relative path by the
test binary will be placed in the output directory instead of creating
the artifact in the directory where sanitycheck was executed and prevent
any possible conflicts.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
  • Loading branch information...
vanwinkeljan authored and nashif committed Jan 3, 2019
1 parent bf7b97b commit 6b9e160b5a6c9967d63456cfdbc58761d6c1fe4e
Showing with 4 additions and 3 deletions.
  1. +4 −3 scripts/sanitycheck
@@ -568,7 +568,7 @@ class BinaryHandler(Handler):
generator_cmd = "ninja"
else:
generator_cmd = "make"
command = [generator_cmd, "-C", self.outdir, "run"]
command = [generator_cmd, "run"]
else:
command = [self.binary]

@@ -580,8 +580,9 @@ class BinaryHandler(Handler):
] + command

verbose("Spawning process: " +
" ".join(shlex.quote(word) for word in command))
with subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as proc:
" ".join(shlex.quote(word) for word in command) + os.linesep +
"Spawning process in directory: " + self.outdir)
with subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=self.outdir) as proc:
verbose("Spawning BinaryHandler Thread for %s" % self.name)
t = threading.Thread(target=self._output_reader, args=(proc, harness, ))
t.start()

0 comments on commit 6b9e160

Please sign in to comment.
You can’t perform that action at this time.