[PATCH] D35038: [libunwind] Add a test harness

2017-08-06 Thread NAKAMURA Takumi via Phabricator via cfe-commits
chapuni added inline comments.



Comment at: test/CMakeLists.txt:34
+  ${CMAKE_CURRENT_BINARY_DIR}
+  DEPENDS ${LIBUNWIND_TEST_DEPS}
+  )

Could you fill this, please?

  set(LIBUNWIND_TEST_DEPS
unwind
)

It makes "check-unwind" pass from clean.


https://reviews.llvm.org/D35038



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


[PATCH] D35038: [libunwind] Add a test harness

2017-07-18 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF added a comment.

> Checking out libcxx should not be a requirement since libunwind should be 
> usable independently on libcxx.

Nope, Sorry. As jroelofs said the code duplication is not worth it. 
Unfortunately you'll need the libc++ sources, and I also don't think that's a 
bug.


https://reviews.llvm.org/D35038



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


[PATCH] D35038: [libunwind] Add a test harness

2017-07-18 Thread Jonathan Roelofs via Phabricator via cfe-commits
jroelofs added inline comments.



Comment at: test/lit.cfg:36
+else:
+lit_config.fatal('Could not find libcxx test directory for test imports'
+ ' in: %s' % libcxx_test_src_root)

manojgupta wrote:
> jroelofs wrote:
> > manojgupta wrote:
> > > I do not have libcxx checked out since I am want to use only compiler-rt 
> > > + libunwind to replace libgcc_s. This libcxx dependency  breaks this 
> > > testing.
> > This only requires that you check it out, not that you build it. Note that 
> > libcxxabi has the same constraint.
> Checking out libcxx should not be a requirement since libunwind should be 
> usable independently on libcxx.
> Not sure if it can be compared to libcxxabi, since most people working on 
> libcxx/libcxxabi will checkout both libcxx and libcxxabi.
The code duplication required to give you what you want is not worth it. When 
the monorepo happens, you won't have a choice but to check both out... if this 
was a bug report, I'd close it "WONTFIX".


https://reviews.llvm.org/D35038



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


[PATCH] D35038: [libunwind] Add a test harness

2017-07-18 Thread Manoj Gupta via Phabricator via cfe-commits
manojgupta added inline comments.



Comment at: test/lit.cfg:36
+else:
+lit_config.fatal('Could not find libcxx test directory for test imports'
+ ' in: %s' % libcxx_test_src_root)

jroelofs wrote:
> manojgupta wrote:
> > I do not have libcxx checked out since I am want to use only compiler-rt + 
> > libunwind to replace libgcc_s. This libcxx dependency  breaks this testing.
> This only requires that you check it out, not that you build it. Note that 
> libcxxabi has the same constraint.
Checking out libcxx should not be a requirement since libunwind should be 
usable independently on libcxx.
Not sure if it can be compared to libcxxabi, since most people working on 
libcxx/libcxxabi will checkout both libcxx and libcxxabi.


https://reviews.llvm.org/D35038



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


[PATCH] D35038: [libunwind] Add a test harness

2017-07-18 Thread Jonathan Roelofs via Phabricator via cfe-commits
jroelofs added inline comments.



Comment at: test/lit.cfg:36
+else:
+lit_config.fatal('Could not find libcxx test directory for test imports'
+ ' in: %s' % libcxx_test_src_root)

manojgupta wrote:
> I do not have libcxx checked out since I am want to use only compiler-rt + 
> libunwind to replace libgcc_s. This libcxx dependency  breaks this testing.
This only requires that you check it out, not that you build it. Note that 
libcxxabi has the same constraint.


https://reviews.llvm.org/D35038



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


[PATCH] D35038: [libunwind] Add a test harness

2017-07-18 Thread Manoj Gupta via Phabricator via cfe-commits
manojgupta added inline comments.



Comment at: test/lit.cfg:36
+else:
+lit_config.fatal('Could not find libcxx test directory for test imports'
+ ' in: %s' % libcxx_test_src_root)

I do not have libcxx checked out since I am want to use only compiler-rt + 
libunwind to replace libgcc_s. This libcxx dependency  breaks this testing.


https://reviews.llvm.org/D35038



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


[PATCH] D35038: [libunwind] Add a test harness

2017-07-06 Thread Jonathan Roelofs via Phabricator via cfe-commits
jroelofs closed this revision.
jroelofs added a comment.

r307266


https://reviews.llvm.org/D35038



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


[PATCH] D35038: [libunwind] Add a test harness

2017-07-05 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF accepted this revision.
EricWF added a comment.
This revision is now accepted and ready to land.

This LGTM. I'm assuming it works but we can iron out the kinks once it lands. 
We should probably add builders that run the tests as well.




Comment at: test/lit.cfg:46
+libcxx.test.config.loadSiteConfig(
+lit_config, config, 'libunwind_site_config', 'LIBCXXABI_SITE_CONFIG')
+obj_root = getattr(config, 'libunwind_obj_root', None)

s/`LIBCXXABI_SITE_CONFIG`/`LIBUNWIND_SITE_CONFIG`.


https://reviews.llvm.org/D35038



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


[PATCH] D35038: [libunwind] Add a test harness

2017-07-05 Thread Jonathan Roelofs via Phabricator via cfe-commits
jroelofs created this revision.
Herald added a subscriber: mgorny.

Mostly cargo-culted from libcxxabi, since the unwinder was forked from there in 
the first place.

Might still be some cruft that's only applicable to libcxxabi in here, so let 
me know if you spot anything like that. I killed some of it, but there could be 
more.


https://reviews.llvm.org/D35038

Files:
  CMakeLists.txt
  test/CMakeLists.txt
  test/libunwind/__init__.py
  test/libunwind/test/__init__.py
  test/libunwind/test/config.py
  test/libunwind_02.pass.cpp
  test/lit.cfg
  test/lit.site.cfg.in

Index: test/lit.site.cfg.in
===
--- test/lit.site.cfg.in
+++ test/lit.site.cfg.in
@@ -0,0 +1,25 @@
+@AUTO_GEN_COMMENT@
+config.cxx_under_test   = "@LIBUNWIND_COMPILER@"
+config.project_obj_root = "@CMAKE_BINARY_DIR@"
+config.libunwind_src_root   = "@LIBUNWIND_SOURCE_DIR@"
+config.libunwind_obj_root   = "@LIBUNWIND_BINARY_DIR@"
+config.abi_library_path = "@LIBUNWIND_LIBRARY_DIR@"
+config.libcxx_src_root  = "@LIBUNWIND_LIBCXX_PATH@"
+config.libunwind_headers= "@LIBUNWIND_SOURCE_DIR@/include"
+config.cxx_library_root = "@LIBUNWIND_LIBCXX_LIBRARY_PATH@"
+config.llvm_unwinder= "@LIBUNWIND_USE_LLVM_UNWINDER@"
+config.enable_threads   = "@LIBUNWIND_ENABLE_THREADS@"
+config.use_sanitizer= "@LLVM_USE_SANITIZER@"
+config.enable_32bit = "@LIBUNWIND_BUILD_32_BITS@"
+config.target_info  = "@LIBUNWIND_TARGET_INFO@"
+config.executor = "@LIBUNWIND_EXECUTOR@"
+config.libunwind_shared = "@LIBUNWIND_ENABLE_SHARED@"
+config.enable_shared= "@LIBCXX_ENABLE_SHARED@"
+config.enable_exceptions= "@LIBUNWIND_ENABLE_EXCEPTIONS@"
+config.host_triple  = "@LLVM_HOST_TRIPLE@"
+config.target_triple= "@TARGET_TRIPLE@"
+config.use_target   = len("@LIBUNWIND_TARGET_TRIPLE@") > 0
+config.cxx_ext_threads  = "@LIBUNWIND_BUILD_EXTERNAL_THREAD_LIBRARY@"
+
+# Let the main config do the real work.
+lit_config.load_config(config, "@LIBUNWIND_SOURCE_DIR@/test/lit.cfg")
Index: test/lit.cfg
===
--- test/lit.cfg
+++ test/lit.cfg
@@ -0,0 +1,67 @@
+# -*- Python -*- vim: set ft=python ts=4 sw=4 expandtab tw=79:
+
+# Configuration file for the 'lit' test runner.
+
+
+import os
+import site
+
+site.addsitedir(os.path.dirname(__file__))
+
+
+# Tell pylint that we know config and lit_config exist somewhere.
+if 'PYLINT_IMPORT' in os.environ:
+config = object()
+lit_config = object()
+
+# name: The name of this test suite.
+config.name = 'libunwind'
+
+# suffixes: A list of file extensions to treat as test files.
+config.suffixes = ['.cpp', '.s']
+
+# test_source_root: The root path where tests are located.
+config.test_source_root = os.path.dirname(__file__)
+
+# Infer the libcxx_test_source_root for configuration import.
+# If libcxx_source_root isn't specified in the config, assume that the libcxx
+# and libunwind source directories are sibling directories.
+libcxx_src_root = getattr(config, 'libcxx_src_root', None)
+if not libcxx_src_root:
+libcxx_src_root = os.path.join(config.test_source_root, '../../libcxx')
+libcxx_test_src_root = os.path.join(libcxx_src_root, 'utils')
+if os.path.isfile(os.path.join(libcxx_test_src_root, 'libcxx', '__init__.py')):
+site.addsitedir(libcxx_test_src_root)
+else:
+lit_config.fatal('Could not find libcxx test directory for test imports'
+ ' in: %s' % libcxx_test_src_root)
+
+# Infer the test_exec_root from the libcxx_object root.
+obj_root = getattr(config, 'libunwind_obj_root', None)
+
+# Check that the test exec root is known.
+if obj_root is None:
+import libcxx.test.config
+libcxx.test.config.loadSiteConfig(
+lit_config, config, 'libunwind_site_config', 'LIBCXXABI_SITE_CONFIG')
+obj_root = getattr(config, 'libunwind_obj_root', None)
+if obj_root is None:
+import tempfile
+obj_root = tempfile.mkdtemp(prefix='libunwind-testsuite-')
+lit_config.warning('Creating temporary directory for object root: %s' %
+   obj_root)
+
+config.test_exec_root = os.path.join(obj_root, 'test')
+
+cfg_variant = getattr(config, 'configuration_variant', 'libunwind')
+if cfg_variant:
+lit_config.note('Using configuration variant: %s' % cfg_variant)
+
+# Load the Configuration class from the module name .test.config.
+config_module_name = '.'.join([cfg_variant, 'test', 'config'])
+config_module = __import__(config_module_name, fromlist=['Configuration'])
+
+configuration = config_module.Configuration(lit_config, config)
+configuration.configure()
+configuration.print_config_info()
+config.test_format = configuration.get_test_format()
Index: test/libunwind_02.pass.cpp
===
---