Skip to content
Snippets Groups Projects
Commit 6a75d555 authored by Frank Winklmeier's avatar Frank Winklmeier Committed by Joerg Stelzer
Browse files

PathResolver: Print error when used with absolute path name

Print an ERROR if the logical file name is an absolute path (ATLASG-69).
Since this may be a valid use-case for analysis, we only print an ERROR
in non-analysis releases.

Also remove `atlas_depends_on_subdirs` statements.
parent e1c600cc
No related branches found
No related tags found
No related merge requests found
/* /*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
#include "PathResolver/PathResolver.h" #include "PathResolver/PathResolver.h"
...@@ -203,6 +203,12 @@ PathResolver::find_file(const std::string& logical_file_name, ...@@ -203,6 +203,12 @@ PathResolver::find_file(const std::string& logical_file_name,
System::getEnv(search_path, path_list); System::getEnv(search_path, path_list);
#endif #endif
#ifndef XAOD_ANALYSIS
if (!logical_file_name.empty() && logical_file_name[0]=='/') {
msg(MSG::ERROR) << "Use of an absolute file name: " << logical_file_name << endmsg;
}
#endif
return (find_file_from_list (logical_file_name, path_list, search_type)); return (find_file_from_list (logical_file_name, path_list, search_type));
} }
......
<?xml version="1.0"?>
<atn>
<TEST name="PathResolverTest" type="makecheck" suite="Examples">
<package>Tools/PathResolver</package>
<timelimit>40</timelimit>
<author> Paolo Calafiura </author>
<mailto> pcalafiura@lbl.gov, snyder@bnl.gov, binet@cern.ch</mailto>
<expectations>
<errorMessage>Athena exited abnormally</errorMessage>
<errorMessage>differ</errorMessage>
<warningMessage> # WARNING_MESSAGE : post.sh> ERROR</warningMessage>
<successMessage>check ok</successMessage>
<returnValue>0</returnValue>
</expectations>
</TEST>
</atn>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment