Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:36:18

0001 #include<string>
0002 #include<iostream>
0003 #include <cstdlib>
0004 #include <cassert>
0005 
0006 struct TestArea {
0007 
0008    static void execIt(std::string const & command) {
0009      std::cerr <<"executing: " << command << std::endl;
0010      system(command.c_str());
0011    }
0012 
0013    explicit TestArea(std::string  const & pkg) {
0014      assert(!pkg.empty());
0015      std::cerr << "setting up " << pkg + "/ExprEval" << std::endl;
0016      srcArea += "$CMSSW_BASE/src/" +pkg;
0017      incArea += "$CMSSW_BASE/include/$SCRAM_ARCH/" +pkg;  
0018 
0019      // clean up (in case of previous failure)
0020      execIt(std::string("rm -rf ") + srcArea +" "+ incArea);
0021 
0022      execIt("echo CMSSW_BASE = $CMSSW_BASE");
0023      execIt(std::string("mkdir -p ") + srcArea + "/ExprEval/src");
0024      execIt(std::string("cp $CMSSW_BASE/src/CommonTools/Utils/test/ExprEvalStubs/*.h ") + srcArea + "/ExprEval/src/.");
0025      execIt(std::string("cp $CMSSW_BASE/src/CommonTools/Utils/test/ExprEvalStubs/BuildFile.xml ") + srcArea + "/ExprEval/.");
0026      execIt("pushd $CMSSW_BASE; scram b -j 2; popd");
0027      execIt("ls $CMSSW_BASE/src");
0028      execIt(std::string("ls -l ") + srcArea + "/ExprEval/src");
0029      execIt(std::string("ls -l ") + incArea +"/ExprEval/src");
0030   }
0031 
0032   ~TestArea() {
0033      execIt(std::string("rm -rf ") + srcArea +" "+ incArea);
0034   }
0035      std::string srcArea;
0036      std::string incArea;
0037 
0038 };