-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #255 from fnadeau/bugfix/cgreen-runner_nm_parsing
Replace use of `nm` with calls to `libbfd`. This also fixes #251: cgreen-runner handle non-lib files
- Loading branch information
Showing
23 changed files
with
1,120 additions
and
566 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# - Try to find libbfd | ||
# Once done this will define | ||
# | ||
# LIBBFD_FOUND - system has libbfd | ||
# LIBBFD_INCLUDE_DIRS - the libbfd include directory | ||
# LIBBFD_LIBRARIES - Link these to use libbfd | ||
# LIBBFD_DEFINITIONS - Compiler switches required for using libbfd | ||
# | ||
# Based on: | ||
# | ||
# Copyright (c) 2008 Bernhard Walle <bernhard.walle@gmx.de> | ||
# | ||
# Redistribution and use is allowed according to the terms of the New | ||
# BSD license. | ||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. | ||
# | ||
|
||
|
||
if (LIBBFD_LIBRARIES AND LIBBFD_INCLUDE_DIRS) | ||
set (LIBBFD_FIND_QUIETLY TRUE) | ||
endif () | ||
|
||
find_path (LIBBFD_INCLUDE_DIRS | ||
NAMES | ||
bfd.h | ||
dis-asm.h | ||
PATHS | ||
/usr/include | ||
/usr/local/include | ||
/opt/local/include | ||
/opt/include | ||
ENV CPATH) | ||
|
||
# Ugly, yes ugly... | ||
find_library (LIBBFD_BFD_LIBRARY | ||
NAMES | ||
bfd | ||
PATHS | ||
/usr/lib | ||
/usr/lib64 | ||
/usr/local/lib | ||
/usr/local/lib64 | ||
/usr/include | ||
/opt/local/lib | ||
/opt/usr/lib64 | ||
ENV LIBRARY_PATH | ||
ENV LD_LIBRARY_PATH) | ||
|
||
find_library (LIBIBERTY_LIBRARY | ||
NAMES | ||
iberty | ||
PATHS | ||
/usr/lib | ||
/usr/lib64 | ||
/usr/local/lib | ||
/usr/local/lib64 | ||
/usr/include | ||
/opt/local/lib | ||
/opt/usr/lib64 | ||
ENV LIBRARY_PATH | ||
ENV LD_LIBRARY_PATH) | ||
|
||
find_library (LIBZ_LIBRARY | ||
NAMES | ||
z | ||
PATHS | ||
/usr/lib | ||
/usr/lib64 | ||
/usr/local/lib | ||
/usr/local/lib64 | ||
/usr/include | ||
/opt/local/lib | ||
/opt/usr/lib64 | ||
ENV LIBRARY_PATH | ||
ENV LD_LIBRARY_PATH) | ||
|
||
include (FindPackageHandleStandardArgs) | ||
|
||
# handle the QUIETLY and REQUIRED arguments and set LIBBFD_FOUND to TRUE if all listed variables are TRUE | ||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibBfd DEFAULT_MSG | ||
LIBBFD_BFD_LIBRARY | ||
LIBBFD_INCLUDE_DIRS | ||
LIBIBERTY_LIBRARY | ||
LIBZ_LIBRARY) | ||
|
||
set(LIBBFD_LIBRARIES "${LIBBFD_BFD_LIBRARY}" "${LIBIBERTY_LIBRARY}" "${LIBZ_LIBRARY}") | ||
mark_as_advanced(LIBBFD_INCLUDE_DIRS LIBBFD_LIBRARIES LIBBFD_BFD_LIBRARY LIBIBERTY_LIBRARY LIBZ_LIBRARY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
if (NOT Valgrind_FOUND) | ||
|
||
find_program(Valgrind_EXECUTABLE valgrind) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(Valgrind DEFAULT_MSG Valgrind_EXECUTABLE) | ||
|
||
set(Valgrind_FOUND ${Valgrind_FOUND} CACHE BOOL "Flag whether Valgrind package was found") | ||
mark_as_advanced(Valgrind_FOUND Valgrind_EXECUTABLE) | ||
|
||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# - MACRO_ADD_VALGRIND_TEST(<args>) | ||
# | ||
# Calls add_test() with all the <args> but if on Win32 or Cygwin also adds the | ||
# directory where the Cgreen library is generated to the path so that it will | ||
# be used when running the test | ||
# | ||
# @thoni56/Thomas Nilefalk 2015-09-13 | ||
|
||
macro (macro_add_valgrind_test) | ||
if (Valgrind_FOUND) | ||
set( | ||
libname | ||
${CMAKE_FIND_LIBRARY_PREFIXES}${ARGN}${CMAKE_SHARED_LIBRARY_SUFFIX} | ||
) | ||
add_test( | ||
NAME valgrind_${libname} | ||
COMMAND sh -c "LD_LIBRARY_PATH=build/src valgrind --leak-check=full tools/cgreen-runner ${CMAKE_CURRENT_BINARY_DIR}/${libname} 2>1&" | ||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} | ||
) | ||
set_tests_properties( | ||
valgrind_${libname} PROPERTIES | ||
FAIL_REGULAR_EXPRESSION "(definitely|indirectly|possible) lost: [1-9]" | ||
) | ||
if (CYGWIN OR WIN32) | ||
set_tests_properties(${ARGV1} PROPERTIES ENVIRONMENT PATH=${PROJECT_BINARY_DIR}/src:$ENV{PATH}) | ||
endif () | ||
endif () | ||
endmacro(macro_add_valgrind_test) |
Oops, something went wrong.