Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing inspect tool #2025

Merged
merged 2 commits into from Mar 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 1 addition & 5 deletions tools/inspect/CMakeLists.txt
Expand Up @@ -5,13 +5,9 @@

# add inpect executable

if(NOT MSVC)
set(inspect NOLIBS DEPENDENCIES ${Boost_LIBRARIES})
endif()

add_hpx_executable(inspect
AUTOGLOB
NOHPX_INIT
NOLIBS
FOLDER "Tools/Inspect")

if(NOT MSVC)
Expand Down
15 changes: 8 additions & 7 deletions tools/inspect/function_hyper.hpp
Expand Up @@ -8,6 +8,7 @@
#ifndef FUNCTION_HYPER_HPP
#define FUNCTION_HYPER_HPP

#include "inspector.hpp"
#include "boost/filesystem/path.hpp"
#include <hpx/config/defines.hpp>
#include <string>
Expand All @@ -18,8 +19,8 @@ using boost::filesystem::path;
inline std::string linelink(const path & full_path, std::string linenumb)
{
std::string commit = HPX_HAVE_GIT_COMMIT;
std::string location = full_path.string();
location.erase(0, 4);
std::string location = boost::inspect::relative_to(
full_path, boost::inspect::search_root_path() );
//The erase function for location is to get rid of the first /hpx that will always
//be present in any full path this tool is used for (repeated in wordlink and
// loclink)
Expand All @@ -34,8 +35,8 @@ inline std::string wordlink(const path & full_path,
std::string linenumb, std::string word)
{
std::string commit = HPX_HAVE_GIT_COMMIT;
std::string location = full_path.string();
location.erase(0, 4);
std::string location = boost::inspect::relative_to(
full_path, boost::inspect::search_root_path() );
std::string total = "<a href = \"https://github.com/STEllAR-GROUP/hpx/blob/"
+ commit + location + "#L" + linenumb + "\">";
total = total + word;
Expand All @@ -46,12 +47,12 @@ inline std::string wordlink(const path & full_path,
inline std::string loclink(const path & full_path, std::string word)
{
std::string commit = HPX_HAVE_GIT_COMMIT;
std::string location = full_path.string();
location.erase(0, 4);
std::string location = boost::inspect::relative_to(
full_path, boost::inspect::search_root_path() );
std::string total = "<a href = \"https://github.com/STEllAR-GROUP/hpx/blob/"
+ commit + location + "\">";
total = total + word;
total = total + "</a>";
return total;
}
#endif
#endif
1 change: 1 addition & 0 deletions tools/inspect/inspect.cpp
Expand Up @@ -1008,6 +1008,7 @@ int cpp_main( int argc_param, char * argv_param[] )
//// perform the actual inspection, using the requested type of iteration
for(auto const& search_root: search_roots)
{
::search_root = search_root;
visit_all<fs::directory_iterator>( search_root.leaf().string(),
search_root, inspectors );
}
Expand Down
2 changes: 1 addition & 1 deletion tools/inspect/inspector.hpp
Expand Up @@ -98,7 +98,7 @@ namespace boost
string::size_type pos( base.string().size() );
path src( src_arg.string().substr(pos) );
src.normalize();
return src.string().substr(1);
return src.string();
}

string impute_library( const path & full_dir_path );
Expand Down