xref: /llvm-project/lldb/test/Shell/Quit/expect_exit_code.py (revision 2238dcc39358353cac21df75c3c3286ab20b8f53)
1#!/usr/bin/env python
2
3import subprocess
4import sys
5
6args = sys.argv
7
8expected_exit_code = args[1]
9
10args = args[2:]
11print("Running " + (" ".join(args)))
12real_exit_code = subprocess.call(args)
13
14if str(real_exit_code) != expected_exit_code:
15    print("Got exit code %d but expected %s" % (real_exit_code, expected_exit_code))
16    exit(1)
17