Skip to content

Commit

Permalink
Fix unit test to find FWCore/Catalog/test/override_catalog.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
mrodozov committed May 16, 2017
1 parent 2bdd8b2 commit 960f8e8
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions FWCore/Catalog/test/FileLocator_t.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
#include "FWCore/Catalog/interface/FileLocator.h"


#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/ServiceRegistry/interface/ServiceRegistry.h"

#include "FWCore/PluginManager/interface/standard.h"
#include "FWCore/PluginManager/interface/PluginManager.h"
#include <boost/filesystem.hpp>
#include <iostream>


int main() {

try {
Expand Down Expand Up @@ -51,8 +48,14 @@ int main() {
}

{
edm::FileLocator fl("trivialcatalog_file:FWCore/Catalog/test/override_catalog.xml?protocol=override", false);


std::string CMSSW_BASE(std::getenv("CMSSW_BASE"));
std::string CMSSW_RELEASE_BASE(std::getenv("CMSSW_RELEASE_BASE"));
std::string file_name("/src/FWCore/Catalog/test/override_catalog.xml");
std::string full_file_name = boost::filesystem::exists((CMSSW_BASE+file_name).c_str()) ? CMSSW_BASE+file_name : CMSSW_RELEASE_BASE+file_name;

edm::FileLocator fl(("trivialcatalog_file:"+full_file_name+"?protocol=override").c_str(), false);

const char * lfn[] = {
"/store/unmerged/relval/CMSSW_3_8_0_pre3/RelValZTT/GEN-SIM-DIGI-RAW-HLTDEBUG/START38_V2-v1/0666/80EC0BCD-D279-DF11-B1DB-0030487C90EE.root",
"/store/group/bha/bho",
Expand All @@ -79,7 +82,9 @@ int main() {
}
catch (cms::Exception const & e) {
std::cout << e.what() << std::endl;
return 1;
}

catch (...) {
std::cout << "got a problem..." << std::endl;
return 1;
Expand Down

0 comments on commit 960f8e8

Please sign in to comment.