Skip to content

Commit 79d5937

Browse files
committed
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>
1 parent 19b4868 commit 79d5937

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/sanitycheck

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ class BinaryHandler(Handler):
568568
generator_cmd = "ninja"
569569
else:
570570
generator_cmd = "make"
571-
command = [generator_cmd, "-C", self.outdir, "run"]
571+
command = [generator_cmd, "run"]
572572
else:
573573
command = [self.binary]
574574

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

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

0 commit comments

Comments
 (0)