summaryrefslogtreecommitdiffstats
path: root/lldb/test/Shell/Quit
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/test/Shell/Quit')
-rw-r--r--lldb/test/Shell/Quit/TestQuitExitCode-30.test3
-rw-r--r--lldb/test/Shell/Quit/TestQuitExitCode0.test3
-rw-r--r--lldb/test/Shell/Quit/TestQuitExitCode30.test3
-rw-r--r--lldb/test/Shell/Quit/TestQuitExitCodeHex0.test3
-rw-r--r--lldb/test/Shell/Quit/TestQuitExitCodeHexA.test3
-rw-r--r--lldb/test/Shell/Quit/TestQuitExitCodeImplicit0.test3
-rw-r--r--lldb/test/Shell/Quit/TestQuitExitCodeNonInt.test4
-rw-r--r--lldb/test/Shell/Quit/TestQuitExitCodeTooManyArgs.test4
-rwxr-xr-xlldb/test/Shell/Quit/expect_exit_code.py16
9 files changed, 42 insertions, 0 deletions
diff --git a/lldb/test/Shell/Quit/TestQuitExitCode-30.test b/lldb/test/Shell/Quit/TestQuitExitCode-30.test
new file mode 100644
index 00000000000..2f15398c761
--- /dev/null
+++ b/lldb/test/Shell/Quit/TestQuitExitCode-30.test
@@ -0,0 +1,3 @@
+# UNSUPPORTED: system-windows
+# RUN: %python %S/expect_exit_code.py 226 %lldb -b -s %s
+q -30
diff --git a/lldb/test/Shell/Quit/TestQuitExitCode0.test b/lldb/test/Shell/Quit/TestQuitExitCode0.test
new file mode 100644
index 00000000000..af39b4293f3
--- /dev/null
+++ b/lldb/test/Shell/Quit/TestQuitExitCode0.test
@@ -0,0 +1,3 @@
+# UNSUPPORTED: system-windows
+# RUN: %lldb -b -s %s
+q 0
diff --git a/lldb/test/Shell/Quit/TestQuitExitCode30.test b/lldb/test/Shell/Quit/TestQuitExitCode30.test
new file mode 100644
index 00000000000..e5ff634e713
--- /dev/null
+++ b/lldb/test/Shell/Quit/TestQuitExitCode30.test
@@ -0,0 +1,3 @@
+# UNSUPPORTED: system-windows
+# RUN: %python %S/expect_exit_code.py 30 %lldb -b -s %s
+q 30
diff --git a/lldb/test/Shell/Quit/TestQuitExitCodeHex0.test b/lldb/test/Shell/Quit/TestQuitExitCodeHex0.test
new file mode 100644
index 00000000000..f85a046fa13
--- /dev/null
+++ b/lldb/test/Shell/Quit/TestQuitExitCodeHex0.test
@@ -0,0 +1,3 @@
+# UNSUPPORTED: system-windows
+# RUN: %lldb -b -s %s
+q 0x0
diff --git a/lldb/test/Shell/Quit/TestQuitExitCodeHexA.test b/lldb/test/Shell/Quit/TestQuitExitCodeHexA.test
new file mode 100644
index 00000000000..ca0e2d5acc3
--- /dev/null
+++ b/lldb/test/Shell/Quit/TestQuitExitCodeHexA.test
@@ -0,0 +1,3 @@
+# UNSUPPORTED: system-windows
+# RUN: %python %S/expect_exit_code.py 10 %lldb -b -s %s
+q 0xA
diff --git a/lldb/test/Shell/Quit/TestQuitExitCodeImplicit0.test b/lldb/test/Shell/Quit/TestQuitExitCodeImplicit0.test
new file mode 100644
index 00000000000..5494231b23b
--- /dev/null
+++ b/lldb/test/Shell/Quit/TestQuitExitCodeImplicit0.test
@@ -0,0 +1,3 @@
+# UNSUPPORTED: system-windows
+# RUN: %lldb -b -s %s
+q
diff --git a/lldb/test/Shell/Quit/TestQuitExitCodeNonInt.test b/lldb/test/Shell/Quit/TestQuitExitCodeNonInt.test
new file mode 100644
index 00000000000..87c0bd41bb0
--- /dev/null
+++ b/lldb/test/Shell/Quit/TestQuitExitCodeNonInt.test
@@ -0,0 +1,4 @@
+# UNSUPPORTED: system-windows
+# RUN: %lldb -b -s %s 2>&1 | FileCheck %s
+q str
+// CHECK: Couldn't parse 'str'
diff --git a/lldb/test/Shell/Quit/TestQuitExitCodeTooManyArgs.test b/lldb/test/Shell/Quit/TestQuitExitCodeTooManyArgs.test
new file mode 100644
index 00000000000..a67669451e9
--- /dev/null
+++ b/lldb/test/Shell/Quit/TestQuitExitCodeTooManyArgs.test
@@ -0,0 +1,4 @@
+# UNSUPPORTED: system-windows
+# RUN: %lldb -b -s %s 2>&1 | FileCheck %s
+q 1 2
+// CHECK: Too many arguments for 'quit'
diff --git a/lldb/test/Shell/Quit/expect_exit_code.py b/lldb/test/Shell/Quit/expect_exit_code.py
new file mode 100755
index 00000000000..32b2e29d53d
--- /dev/null
+++ b/lldb/test/Shell/Quit/expect_exit_code.py
@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+
+import subprocess
+import sys
+
+args = sys.argv
+
+expected_exit_code = args[1]
+
+args = args[2:]
+print("Running " + (" ".join(args)))
+real_exit_code = subprocess.call(args)
+
+if str(real_exit_code) != expected_exit_code:
+ print("Got exit code %d but expected %s" % (real_exit_code, expected_exit_code))
+ exit(1)
OpenPOWER on IntegriCloud