diff options
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/commands')
3 files changed, 46 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/commands/platform/process/Makefile b/lldb/packages/Python/lldbsuite/test/commands/platform/process/Makefile new file mode 100644 index 00000000000..b560876f24e --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/commands/platform/process/Makefile @@ -0,0 +1,5 @@ +CXX_SOURCES := main.cpp + +EXE := TestProcess + +include Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/commands/platform/process/TestProcessList.py b/lldb/packages/Python/lldbsuite/test/commands/platform/process/TestProcessList.py new file mode 100644 index 00000000000..e7a0273bbd8 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/commands/platform/process/TestProcessList.py @@ -0,0 +1,32 @@ +""" +Test process list. +""" + +from __future__ import print_function + + +import os +import lldb +import shutil +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class ProcessListTestCase(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + NO_DEBUG_INFO_TESTCASE = True + + def test_process_list_with_args(self): + """Test process list show process args""" + self.build() + exe = self.getBuildArtifact("TestProcess") + + # Spawn a new process + popen = self.spawnSubprocess(exe, args=["arg1", "--arg2", "arg3"]) + self.addTearDownHook(self.cleanupSubprocesses) + + self.expect("platform process list -v", + substrs=["TestProcess arg1 --arg2 arg3", str(popen.pid)]) diff --git a/lldb/packages/Python/lldbsuite/test/commands/platform/process/main.cpp b/lldb/packages/Python/lldbsuite/test/commands/platform/process/main.cpp new file mode 100644 index 00000000000..da43e60155e --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/commands/platform/process/main.cpp @@ -0,0 +1,9 @@ +#include <stdio.h> + +#include <chrono> +#include <thread> + +int main(int argc, char const *argv[]) { + std::this_thread::sleep_for(std::chrono::seconds(30)); + return 0; +} |