Skip to content
Permalink
Browse files

sanitycheck: clarify who spawns processes and threads and where

Notably fix the wrong comment I added in commit 6f011c9: when
testing with QEmu sanitycheck does _not_ spawn QEmu; it relies on "make
run" instead.

Searching the code for "Spawning" now cycles directly to all the places
starting processes and threads.

- Sample -v -v verbose output (lines wrapped for commit message check)

 Spawning QEMUHandler Thread for \
     qemu_x86/samples/hello_world/sample.helloworld 'make run'

- native_posix example:

 Spawning process /home/.../sanity-out/native_posix/\
    /samples/hello_world/sample.helloworld/zephyr/zephyr.exe
 Spawning BinaryHandler Thread for native_posix/\
     samples/hello_world/sample.helloworld

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
  • Loading branch information...
marc-hb authored and nashif committed Apr 30, 2019
1 parent 758a246 commit af1090c3bdedc6563bc133f5e0198052a7f42371
Showing with 6 additions and 2 deletions.
  1. +6 −2 scripts/sanitycheck
@@ -179,6 +179,7 @@ import subprocess
import multiprocessing
import select
import shutil
import shlex
import signal
import threading
import time
@@ -570,7 +571,10 @@ class BinaryHandler(Handler):
"--log-file="+self.outdir+"/valgrind.log"
] + command

verbose("Spawning process: " +
" ".join(shlex.quote(word) for word in command))
with subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as proc:
verbose("Spawning BinaryHandler Thread for %s" % self.name)
t = threading.Thread(target=self._output_reader, args=(proc, harness, ))
t.start()
t.join(self.timeout)
@@ -854,7 +858,7 @@ class QEMUHandler(Handler):

self.instance.results = harness.tests
self.thread.daemon = True
verbose("Spawning QEMU process for %s" % self.name)
verbose("Spawning QEMUHandler Thread for %s 'make run'" % self.name)
self.thread.start()

def get_fifo(self):
@@ -1336,7 +1340,7 @@ class MakeGenerator:
# Watch stderr output which is where we will keep
# track of build state
tf.write('\n# Generated by %s which is expected\n' % __file__)
tf.write('# to spawn qemu or testbinary, renode, etc. \n\n')
tf.write('# to create QEMU_PIPE, spawn zephyr.exe, etc. \n\n')
for name, goal in sorted(self.goals.items()):
tf.write(goal.text)
tf.write("all: %s\n" % (" ".join(sorted(self.goals.keys()))))

0 comments on commit af1090c

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