sanitycheck: allow placing parsetab.py in a custom dir

when running multiple instances of sanitycheck, allow placing the
parsetab.py in a customer location that can be set using an environment
variable.

export PARSETAB_DIR=/tmp/

run sanitycheck and the parsetab.py will be placed in /tmp/.

Fixes #4513

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2017-12-06 10:10:55 -05:00 committed by Anas Nashif
commit 9c974b966c

View file

@ -164,7 +164,10 @@ def p_error(p):
else:
raise SyntaxError("Unexpected end of expression")
parser = yacc.yacc(debug=0)
if "PARSETAB_DIR" not in os.environ:
parser = yacc.yacc(debug=0)
else:
parser = yacc.yacc(debug=0, outputdir=os.environ["PARSETAB_DIR"])
def ast_sym(ast, env):
if ast in env: