[PATCH] Partial support test polly for out of tree build.

4 views
Skip to first unread message

ether zhhb

unread,
Apr 24, 2011, 9:38:36 AM4/24/11
to polly-...@googlegroups.com
hi tobi,

I have a patch that partial support for testing in out of tree build:

---
test/CMakeLists.txt | 33 +++++++++++++++++++++++----------
1 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index a3b32de..2f95efa 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -5,13 +5,28 @@ set(POLLY_TEST_DIRECTORIES
"OpenMP"
"polybench")

-set(LLVM_SOURCE_DIR "${LLVM_MAIN_SRC_DIR}")
-set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}")
-set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/")
-set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib")
+
set(POLLY_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
set(POLLY_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..")

+if (NOT DEFINED LLVM_MAIN_SRC_DIR)
+ # We are building polly out of tree, adjust the settings.
+ # FIXME: FileCheck is not available in llvm install directory at the moment.
+ set(LLVM_LIT ${LLVM_INSTALL_ROOT}/bin/llvm-lit)
+ set(POLLY_TEST_DEPS LLVMPolly)
+
+ set(LLVM_BINARY_DIR "${LLVM_INSTALL_ROOT}")
+ set(LLVM_TOOLS_DIR "${LLVM_INSTALL_ROOT}/bin")
+ set(LLVM_LIBS_DIR "${LLVM_INSTALL_ROOT}/lib")
+else (NOT DEFINED LLVM_MAIN_SRC_DIR)
+ set(LLVM_LIT ${LLVM_TOOLS_BINARY_DIR}/llvm-lit)
+ set(POLLY_TEST_DEPS opt LLVMPolly)
+
+ set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}")
+ set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/")
+ set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib")
+endif (NOT DEFINED LLVM_MAIN_SRC_DIR)
+
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)
@@ -30,23 +45,21 @@ if(PYTHONINTERP_FOUND)

foreach(testdir ${POLLY_TEST_DIRECTORIES})
add_custom_target(polly-test-${testdir}
- COMMAND ${PYTHON_EXECUTABLE}
- ${LLVM_SOURCE_DIR}/utils/lit/lit.py
+ COMMAND ${LLVM_LIT}
--param
polly_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
--param build_config=${CMAKE_CFG_INTDIR}
-sv ${POLLY_TEST_EXTRA_ARGS}
${CMAKE_CURRENT_BINARY_DIR}/${testdir}
- DEPENDS opt LLVMPolly
+ DEPENDS ${POLLY_TEST_DEPS}
COMMENT "Running Polly regression tests in ${testdir}")
endforeach()

add_custom_target(polly-test
- COMMAND ${PYTHON_EXECUTABLE}
- ${LLVM_SOURCE_DIR}/utils/lit/lit.py
+ COMMAND ${LLVM_LIT}
--param
polly_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
--param build_config=${CMAKE_CFG_INTDIR}
-sv ${POLLY_TEST_EXTRA_ARGS}
${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS opt LLVMPolly
+ DEPENDS ${POLLY_TEST_DEPS}
COMMENT "Running Polly regression tests")
endif()
--
1.7.3.3

0001-Partial-support-test-polly-for-out-of-tree-build.patch

Tobias Grosser

unread,
Apr 25, 2011, 2:29:32 AM4/25/11
to polly-...@googlegroups.com
On 04/24/2011 03:38 PM, ether zhhb wrote:
> hi tobi,
>
> I have a patch that partial support for testing in out of tree build:

Nice. Please push.

Tobi

ether zhhb

unread,
Apr 29, 2011, 3:44:33 AM4/29/11
to polly-...@googlegroups.com, Tobias Grosser
hi tobi,

commit as a test commit to the new repo.

best regards
ether

Tobias Grosser

unread,
Apr 29, 2011, 3:46:16 AM4/29/11
to ether zhhb, polly-...@googlegroups.com
On 04/29/2011 09:44 AM, ether zhhb wrote:
> hi tobi,
>
> commit as a test commit to the new repo.

Nice. Thanks.

Tobi

Reply all
Reply to author
Forward
0 new messages