blob: 40567fae03342aee5dab449364182fc32d743a11 [file] [log] [blame]
Paul Sokolovsky69bdd3b2023-04-04 12:26:30 +03001#!/bin/sh -x
2# This script is to workaround an apparent LAVA race condition, when it
3# detects "EOF" (i.e. app termination) before it reads out all the stdout
4# from the app (FVP in this case). The wrapper explicitly runs a command
5# in line-buffered mode, that helps a little (LAVA reads more output),
6# but not completely, so we just give LAVA more time with some sleep after
7# command termination.
8
Paul Sokolovskyc3319e62023-04-04 18:11:02 +03009if [ "$1" = "--version" ]; then
Paul Sokolovskyc51c9202023-04-04 16:42:07 +030010 echo "$0 1.0"
11 exit
12fi
13
Paul Sokolovskydfe531f2023-04-04 15:34:15 +030014delay="$1"
15shift
Paul Sokolovsky69bdd3b2023-04-04 12:26:30 +030016cmd="$1"
17shift
18stdbuf -oL "$cmd" "$@"
Paul Sokolovskydfe531f2023-04-04 15:34:15 +030019sleep $delay