From 292178e10463ad40c73bd86c6783180ddf351586 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Wed, 21 Mar 2018 15:29:32 +0000 Subject: Last batch of test-tree cleaning changes - postmortem tests: make sure the core files are created in the build folder - TestSourceManager: copy the .c file into the build dir before modifying it - TestLogging: create log files in the build folder After these changes I get a clean test run (on linux) even if I set the source tree to be read only. It's possible some of the skipped/xfailed tests are still creating files in the source tree, but at the moment, I don't have plans to go hunting for those. llvm-svn: 328106 --- .../postmortem/elf-core/TestLinuxCore.py | 46 +++++++-------- .../postmortem/minidump-new/TestMiniDumpNew.py | 39 ++++++------- .../Python/lldbsuite/test/logging/TestLogging.py | 36 ++++-------- .../Python/lldbsuite/test/source-manager/Makefile | 10 +++- .../test/source-manager/TestSourceManager.py | 67 +++++++--------------- 5 files changed, 80 insertions(+), 118 deletions(-) (limited to 'lldb/packages/Python/lldbsuite/test') diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py index 4d41a158069..4f73d48dfcf 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py @@ -87,30 +87,28 @@ class LinuxCoreTestCase(TestBase): def test_same_pid_running(self): """Test that we read the information from the core correctly even if we have a running process with the same PID around""" - try: - shutil.copyfile("linux-x86_64.out", "linux-x86_64-pid.out") - shutil.copyfile("linux-x86_64.core", "linux-x86_64-pid.core") - with open("linux-x86_64-pid.core", "r+b") as f: - # These are offsets into the NT_PRSTATUS and NT_PRPSINFO structures in the note - # segment of the core file. If you update the file, these offsets may need updating - # as well. (Notes can be viewed with readelf --notes.) - for pid_offset in [0x1c4, 0x320]: - f.seek(pid_offset) - self.assertEqual( - struct.unpack( - "