[Lldb-commits] [PATCH] D47062: Suggest lldb-dotest to reproduce a failure.

2019-03-07 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere abandoned this revision.
JDevlieghere added a comment.
Herald added a reviewer: serge-sans-paille.
Herald added a subscriber: jdoerfert.

Abandoning this until we can replace the dotest driver with lit.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D47062/new/

https://reviews.llvm.org/D47062



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D47062: Suggest lldb-dotest to reproduce a failure.

2018-06-05 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

In https://reviews.llvm.org/D47062#1109399, @JDevlieghere wrote:

> I'm going to hold off on this until we have decided what to do for 
> https://reviews.llvm.org/D46005. If we run the test cases as separate lit 
> invocations, then the test format is in a better position to report this 
> information.


It looks like that patch has gotten a bit stuck, and I'm not sure when/if I'll 
have the time to unstuck it. So, if you still want to go ahead with this 
approach, then feel free to commit it.


https://reviews.llvm.org/D47062



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D47062: Suggest lldb-dotest to reproduce a failure.

2018-05-23 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

I'm going to hold off on this until we have decided what to do for 
https://reviews.llvm.org/D46005. If we run the test cases as separate lit 
invocations, then the test format is in a better position to report this 
information.


https://reviews.llvm.org/D47062



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D47062: Suggest lldb-dotest to reproduce a failure.

2018-05-21 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 147787.
JDevlieghere added a comment.
Herald added a subscriber: mgorny.

Make this work for Windows


https://reviews.llvm.org/D47062

Files:
  packages/Python/lldbsuite/test/dosep.py
  packages/Python/lldbsuite/test/dotest.py
  packages/Python/lldbsuite/test/dotest_args.py
  packages/Python/lldbsuite/test/lldbtest.py
  packages/Python/lldbsuite/test/lldbtest_config.py
  utils/lldb-dotest/CMakeLists.txt
  utils/lldb-dotest/lldb-dotest.in

Index: utils/lldb-dotest/lldb-dotest.in
===
--- utils/lldb-dotest/lldb-dotest.in
+++ utils/lldb-dotest/lldb-dotest.in
@@ -3,7 +3,7 @@
 import sys
 
 dotest_path = '@LLDB_SOURCE_DIR@/test/dotest.py'
-dotest_args_str = '@LLDB_DOTEST_ARGS@'
+dotest_args_str = '@LLDB_DOTEST_ARGS_WITH_WRAPPER@'
 
 if __name__ == '__main__':
 wrapper_args = sys.argv[1:]
Index: utils/lldb-dotest/CMakeLists.txt
===
--- utils/lldb-dotest/CMakeLists.txt
+++ utils/lldb-dotest/CMakeLists.txt
@@ -9,14 +9,20 @@
   foreach(LLVM_BUILD_MODE ${CMAKE_CONFIGURATION_TYPES})
 string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_DOTEST_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
 string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}")
+set(LLDB_DOTEST_WRAPPER ${LLDB_DOTEST_DIR}/lldb-dotest)
+set(LLDB_DOTEST_ARGS_WITH_WRAPPER ${LLDB_DOTEST_ARGS})
+list(APPEND LLDB_DOTEST_ARGS_WITH_WRAPPER --dotest-wrapper "${LLDB_DOTEST_WRAPPER}")
 configure_file(
   lldb-dotest.in
-  ${LLDB_DOTEST_DIR}/lldb-dotest
+  ${LLDB_DOTEST_WRAPPER}
   )
   endforeach()
 else()
+  set(LLDB_DOTEST_WRAPPER ${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb-dotest)
+  set(LLDB_DOTEST_ARGS_WITH_WRAPPER ${LLDB_DOTEST_ARGS})
+  list(APPEND LLDB_DOTEST_ARGS_WITH_WRAPPER --dotest-wrapper "${LLDB_DOTEST_WRAPPER}")
   configure_file(
 lldb-dotest.in
-${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb-dotest
+${LLDB_DOTEST_WRAPPER}
 )
 endif()
Index: packages/Python/lldbsuite/test/lldbtest_config.py
===
--- packages/Python/lldbsuite/test/lldbtest_config.py
+++ packages/Python/lldbsuite/test/lldbtest_config.py
@@ -21,3 +21,6 @@
 
 # path to the lldb command line executable tool
 lldbExec = None
+
+# path to lldb-dotest wrapper
+dotestWrapper = None
Index: packages/Python/lldbsuite/test/lldbtest.py
===
--- packages/Python/lldbsuite/test/lldbtest.py
+++ packages/Python/lldbsuite/test/lldbtest.py
@@ -1089,7 +1089,7 @@
 file=sbuf)
 
 def getRerunArgs(self):
-return " -f %s.%s" % (self.__class__.__name__, self._testMethodName)
+return "-f %s.%s" % (self.__class__.__name__, self._testMethodName)
 
 def getLogBasenameForCurrentTest(self, prefix=None):
 """
@@ -1186,18 +1186,13 @@
 benchmarks = False
 
 import datetime
-print(
-"Session info generated @",
+print("Session info generated @",
 datetime.datetime.now().ctime(),
 file=self.session)
-print(
-"To rerun this test, issue the following command from the 'test' directory:\n",
+print("To rerun this test, issue the following command:\n",
 file=self.session)
 print(
-"./dotest.py %s -v %s %s" %
-(self.getRunOptions(),
- ('+b' if benchmarks else '-t'),
-self.getRerunArgs()),
+"{} {}".format(lldbtest_config.dotestWrapper, self.getRerunArgs()),
 file=self.session)
 self.session.close()
 del self.session
@@ -1373,18 +1368,6 @@
 
 return False
 
-def getRunOptions(self):
-"""Command line option for -A and -C to run this test again, called from
-self.dumpSessionInfo()."""
-arch = self.getArchitecture()
-comp = self.getCompiler()
-option_str = ""
-if arch:
-option_str = "-A " + arch
-if comp:
-option_str += " -C " + comp
-return option_str
-
 def getDebugInfo(self):
 method = getattr(self, self.testMethodName)
 return getattr(method, "debug_info", None)
Index: packages/Python/lldbsuite/test/dotest_args.py
===
--- packages/Python/lldbsuite/test/dotest_args.py
+++ packages/Python/lldbsuite/test/dotest_args.py
@@ -124,6 +124,11 @@
 '--executable',
 metavar='executable-path',
 help='The path to the lldb executable')
+group.add_argument(
+'--dotest-wrapper',
+dest='dotest_wrapper',
+metavar='executable-path',
+help='The path to the lldb-dotest executable')
 group.add_argument(
 '--server',
 metavar='server-path',
Index: 

[Lldb-commits] [PATCH] D47062: Suggest lldb-dotest to reproduce a failure.

2018-05-21 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Looks fine to me, just make the path computation windows-compatible.




Comment at: packages/Python/lldbsuite/test/dotest.py:386
+if is_exe(lldbtest_config.lldbExec):
+lldbtest_config.dotestWrapper = "{}-dotest".format(
+  os.path.realpath(args.executable))

On windows, this will end up being `lldb.exe-dotest`


https://reviews.llvm.org/D47062



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D47062: Suggest lldb-dotest to reproduce a failure.

2018-05-20 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 147711.
JDevlieghere marked an inline comment as done.
JDevlieghere added a comment.

- Use absolute path to `lldb-dotest` when `--executable` is passed.


https://reviews.llvm.org/D47062

Files:
  packages/Python/lldbsuite/test/dosep.py
  packages/Python/lldbsuite/test/dotest.py
  packages/Python/lldbsuite/test/lldbtest.py
  packages/Python/lldbsuite/test/lldbtest_config.py

Index: packages/Python/lldbsuite/test/lldbtest_config.py
===
--- packages/Python/lldbsuite/test/lldbtest_config.py
+++ packages/Python/lldbsuite/test/lldbtest_config.py
@@ -21,3 +21,6 @@
 
 # path to the lldb command line executable tool
 lldbExec = None
+
+# path to lldb-dotest wrapper
+dotestWrapper = None
Index: packages/Python/lldbsuite/test/lldbtest.py
===
--- packages/Python/lldbsuite/test/lldbtest.py
+++ packages/Python/lldbsuite/test/lldbtest.py
@@ -700,21 +700,21 @@
 """Return the full path to the current test."""
 return os.path.join(os.environ["LLDB_BUILD"], self.mydir,
 self.getBuildDirBasename())
-
- 
+
+
 def makeBuildDir(self):
 """Create the test-specific working directory, deleting any previous
 contents."""
 # See also dotest.py which sets up ${LLDB_BUILD}.
 bdir = self.getBuildDir()
 if os.path.isdir(bdir):
 shutil.rmtree(bdir)
 lldbutil.mkdir_p(bdir)
- 
+
 def getBuildArtifact(self, name="a.out"):
 """Return absolute path to an artifact in the test's build directory."""
 return os.path.join(self.getBuildDir(), name)
- 
+
 def getSourcePath(self, name):
 """Return absolute path to a file in the test's source directory."""
 return os.path.join(self.getSourceDir(), name)
@@ -1089,7 +1089,7 @@
 file=sbuf)
 
 def getRerunArgs(self):
-return " -f %s.%s" % (self.__class__.__name__, self._testMethodName)
+return "-f %s.%s" % (self.__class__.__name__, self._testMethodName)
 
 def getLogBasenameForCurrentTest(self, prefix=None):
 """
@@ -1186,18 +1186,13 @@
 benchmarks = False
 
 import datetime
-print(
-"Session info generated @",
+print("Session info generated @",
 datetime.datetime.now().ctime(),
 file=self.session)
-print(
-"To rerun this test, issue the following command from the 'test' directory:\n",
+print("To rerun this test, issue the following command:\n",
 file=self.session)
 print(
-"./dotest.py %s -v %s %s" %
-(self.getRunOptions(),
- ('+b' if benchmarks else '-t'),
-self.getRerunArgs()),
+"{} {}".format(lldbtest_config.dotestWrapper, self.getRerunArgs()),
 file=self.session)
 self.session.close()
 del self.session
@@ -1373,18 +1368,6 @@
 
 return False
 
-def getRunOptions(self):
-"""Command line option for -A and -C to run this test again, called from
-self.dumpSessionInfo()."""
-arch = self.getArchitecture()
-comp = self.getCompiler()
-option_str = ""
-if arch:
-option_str = "-A " + arch
-if comp:
-option_str += " -C " + comp
-return option_str
-
 def getDebugInfo(self):
 method = getattr(self, self.testMethodName)
 return getattr(method, "debug_info", None)
@@ -1840,7 +1823,7 @@
 temp = os.path.join(self.getSourceDir(), template)
 with open(temp, 'r') as f:
 content = f.read()
-
+
 public_api_dir = os.path.join(
 os.environ["LLDB_SRC"], "include", "lldb", "API")
 
Index: packages/Python/lldbsuite/test/dotest.py
===
--- packages/Python/lldbsuite/test/dotest.py
+++ packages/Python/lldbsuite/test/dotest.py
@@ -382,8 +382,12 @@
 if args.executable:
 # lldb executable is passed explicitly
 lldbtest_config.lldbExec = os.path.realpath(args.executable)
-if not is_exe(lldbtest_config.lldbExec):
+if is_exe(lldbtest_config.lldbExec):
+lldbtest_config.dotestWrapper = "{}-dotest".format(
+  os.path.realpath(args.executable))
+else:
 lldbtest_config.lldbExec = which(args.executable)
+lldbtest_config.dotestWrapper = "lldb-dotest"
 if not is_exe(lldbtest_config.lldbExec):
 logging.error(
 '%s is not a valid executable to test; aborting...',
@@ -991,10 +995,6 @@
 raise Exception(
 'log enable failed (check GDB_REMOTE_LOG env variable)')
 
-
-def getMyCommandLine():
-return ' '.join(sys.argv)
-
 #  #
 #

[Lldb-commits] [PATCH] D47062: Suggest lldb-dotest to reproduce a failure.

2018-05-18 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments.



Comment at: packages/Python/lldbsuite/test/dosep.py:122
 print("[%s FAILED]%s" % (name, timeout_str), file=sys.stderr)
-print("Command invoked: %s" % ' '.join(command), file=sys.stderr)
+print("Reproduce with: lldb-dotest -f {}".format(name), 
file=sys.stderr)
 update_progress(name)

JDevlieghere wrote:
> aprantl wrote:
> > What do you think about adding the full path to lldb-dotest? I usually have 
> > at least three concurrent checkouts of lldb at any time.
> Me too, but how would we get that information here? On of `lldb-dotest`'s 
> goals is that you can execute it from anywhere, so you'd either have to pass 
> it explicitly to `dotest.py` (either using a custom argument and cmake 
> variable combo, or by assuming it lives in the same directory as the current 
> lldb and appending `-dotest`) but that feels like it might not be worth it. 
> Maybe there's another solution you had in mind?
The --executable option that dotest receives should point to an lldb that ought 
to have a matching lldb-dotest next to it. I don't think that that is 
particularly ugly.


Repository:
  rL LLVM

https://reviews.llvm.org/D47062



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D47062: Suggest lldb-dotest to reproduce a failure.

2018-05-18 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere marked an inline comment as done.
JDevlieghere added a comment.

In https://reviews.llvm.org/D47062#1104558, @davide wrote:

> Can you commit the whitespace fixes separately?


Sure.




Comment at: packages/Python/lldbsuite/test/dosep.py:122
 print("[%s FAILED]%s" % (name, timeout_str), file=sys.stderr)
-print("Command invoked: %s" % ' '.join(command), file=sys.stderr)
+print("Reproduce with: lldb-dotest -f {}".format(name), 
file=sys.stderr)
 update_progress(name)

aprantl wrote:
> What do you think about adding the full path to lldb-dotest? I usually have 
> at least three concurrent checkouts of lldb at any time.
Me too, but how would we get that information here? On of `lldb-dotest`'s goals 
is that you can execute it from anywhere, so you'd either have to pass it 
explicitly to `dotest.py` (either using a custom argument and cmake variable 
combo, or by assuming it lives in the same directory as the current lldb and 
appending `-dotest`) but that feels like it might not be worth it. Maybe 
there's another solution you had in mind?


Repository:
  rL LLVM

https://reviews.llvm.org/D47062



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D47062: Suggest lldb-dotest to reproduce a failure.

2018-05-18 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments.



Comment at: packages/Python/lldbsuite/test/dosep.py:122
 print("[%s FAILED]%s" % (name, timeout_str), file=sys.stderr)
-print("Command invoked: %s" % ' '.join(command), file=sys.stderr)
+print("Reproduce with: lldb-dotest -f {}".format(name), 
file=sys.stderr)
 update_progress(name)

What do you think about adding the full path to lldb-dotest? I usually have at 
least three concurrent checkouts of lldb at any time.


Repository:
  rL LLVM

https://reviews.llvm.org/D47062



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D47062: Suggest lldb-dotest to reproduce a failure.

2018-05-18 Thread Davide Italiano via Phabricator via lldb-commits
davide added a comment.

Can you commit the whitespace fixes separately?


Repository:
  rL LLVM

https://reviews.llvm.org/D47062



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D47062: Suggest lldb-dotest to reproduce a failure.

2018-05-18 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added reviewers: labath, davide, aprantl.

Rather than trying to figure out what arguments to pass to `dotest.py`, suggest 
using `lldb-dotest`. Athough this obviously won't work for all invocations 
(i.e. when you're passing custom arguments to `lldb-dotest`) it will work in 
the most common case (which is unfortunately not true today).


Repository:
  rL LLVM

https://reviews.llvm.org/D47062

Files:
  packages/Python/lldbsuite/test/dosep.py
  packages/Python/lldbsuite/test/dotest.py
  packages/Python/lldbsuite/test/lldbtest.py

Index: packages/Python/lldbsuite/test/lldbtest.py
===
--- packages/Python/lldbsuite/test/lldbtest.py
+++ packages/Python/lldbsuite/test/lldbtest.py
@@ -700,21 +700,21 @@
 """Return the full path to the current test."""
 return os.path.join(os.environ["LLDB_BUILD"], self.mydir,
 self.getBuildDirBasename())
-
- 
+
+
 def makeBuildDir(self):
 """Create the test-specific working directory, deleting any previous
 contents."""
 # See also dotest.py which sets up ${LLDB_BUILD}.
 bdir = self.getBuildDir()
 if os.path.isdir(bdir):
 shutil.rmtree(bdir)
 lldbutil.mkdir_p(bdir)
- 
+
 def getBuildArtifact(self, name="a.out"):
 """Return absolute path to an artifact in the test's build directory."""
 return os.path.join(self.getBuildDir(), name)
- 
+
 def getSourcePath(self, name):
 """Return absolute path to a file in the test's source directory."""
 return os.path.join(self.getSourceDir(), name)
@@ -1089,7 +1089,7 @@
 file=sbuf)
 
 def getRerunArgs(self):
-return " -f %s.%s" % (self.__class__.__name__, self._testMethodName)
+return "-f %s.%s" % (self.__class__.__name__, self._testMethodName)
 
 def getLogBasenameForCurrentTest(self, prefix=None):
 """
@@ -1186,18 +1186,12 @@
 benchmarks = False
 
 import datetime
-print(
-"Session info generated @",
+print("Session info generated @",
 datetime.datetime.now().ctime(),
 file=self.session)
-print(
-"To rerun this test, issue the following command from the 'test' directory:\n",
+print("To rerun this test, issue the following command:\n",
 file=self.session)
-print(
-"./dotest.py %s -v %s %s" %
-(self.getRunOptions(),
- ('+b' if benchmarks else '-t'),
-self.getRerunArgs()),
+print("lldb-dotest {}".format(self.getRerunArgs()),
 file=self.session)
 self.session.close()
 del self.session
@@ -1373,18 +1367,6 @@
 
 return False
 
-def getRunOptions(self):
-"""Command line option for -A and -C to run this test again, called from
-self.dumpSessionInfo()."""
-arch = self.getArchitecture()
-comp = self.getCompiler()
-option_str = ""
-if arch:
-option_str = "-A " + arch
-if comp:
-option_str += " -C " + comp
-return option_str
-
 def getDebugInfo(self):
 method = getattr(self, self.testMethodName)
 return getattr(method, "debug_info", None)
@@ -1840,7 +1822,7 @@
 temp = os.path.join(self.getSourceDir(), template)
 with open(temp, 'r') as f:
 content = f.read()
-
+
 public_api_dir = os.path.join(
 os.environ["LLDB_SRC"], "include", "lldb", "API")
 
Index: packages/Python/lldbsuite/test/dotest.py
===
--- packages/Python/lldbsuite/test/dotest.py
+++ packages/Python/lldbsuite/test/dotest.py
@@ -991,10 +991,6 @@
 raise Exception(
 'log enable failed (check GDB_REMOTE_LOG env variable)')
 
-
-def getMyCommandLine():
-return ' '.join(sys.argv)
-
 #  #
 #  #
 # Execution of the test driver starts here #
@@ -1274,7 +1270,7 @@
 "\nSession logs for test failures/errors/unexpected successes"
 " will go into directory '%s'\n" %
 configuration.sdir_name)
-sys.stderr.write("Command invoked: %s\n" % getMyCommandLine())
+sys.stderr.write("Command invoked: %s\n" % ' '.join(sys.argv))
 
 if not os.path.isdir(configuration.sdir_name):
 try:
Index: packages/Python/lldbsuite/test/dosep.py
===
--- packages/Python/lldbsuite/test/dosep.py
+++ packages/Python/lldbsuite/test/dosep.py
@@ -119,7 +119,7 @@
 else:
 timeout_str = ""
 print("[%s FAILED]%s" % (name, timeout_str), file=sys.stderr)
-print("Command invoked: %s" % ' '.join(command), file=sys.stderr)
+