Changeset 4f7f34e


Ignore:
Timestamp:
Jun 25, 2010, 8:11:20 AM (15 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
a356f2
Parents:
d0fbec
Message:

ParseCommandLineOptions() is not used anymore.

  • TESTFIX: boost::program_options returns 134 in case of missing argument, not 255 and also no more CRITICAL message is given: testsuite-standard_options and testsuite-simple_configurations
Files:
4 added
8 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/Makefile.am

    rd0fbec r4f7f34e  
    120120  WorldAction/CenterOnEdgeAction.cpp \
    121121  WorldAction/ChangeBoxAction.cpp \
     122  WorldAction/InputAction.cpp \
     123  WorldAction/OutputAction.cpp \
    122124  WorldAction/RemoveSphereOfAtomsAction.cpp \
    123125  WorldAction/RepeatBoxAction.cpp \
     
    131133  WorldAction/CenterOnEdgeAction.hpp \
    132134  WorldAction/ChangeBoxAction.hpp \
     135  WorldAction/InputAction.hpp \
     136  WorldAction/OutputAction.hpp \
    133137  WorldAction/RemoveSphereOfAtomsAction.hpp \
    134138  WorldAction/RepeatBoxAction.hpp \
  • src/Actions/MapOfActions.cpp

    rd0fbec r4f7f34e  
    8383  DescriptionMap["fragment-mol"] = "create for a given molecule into fragments up to given order";
    8484  DescriptionMap["help"] = "Give this help screen";
     85  DescriptionMap["input"] = "specify input files";
    8586  DescriptionMap["linear-interpolate"] = "linear interpolation in discrete steps between start and end position of a molecule";
    8687  DescriptionMap["nonconvex-envelope"] = "create the non-convex envelope for a molecule";
    8788  DescriptionMap["molecular-volume"] = "calculate the volume of a given molecule";
     89  DescriptionMap["output"] = "specify output formats";
    8890  DescriptionMap["pair-correlation"] = "pair correlation analysis between two elements, element and point or element and surface";
    8991  DescriptionMap["parse-xyz"] = "parse xyz file into World";
     
    190192  TypeMap["molecular-volume"] = Molecule;
    191193  TypeMap["nonconvex-envelope"] = Molecule;
     194  TypeMap["output"] = String;
    192195  TypeMap["parse-xyz"] = String;
    193196  TypeMap["pair-correlation"] = String;
     
    262265  generic.insert("fragment-mol");
    263266  generic.insert("help");
    264         generic.insert("linear-interpolate");
     267  generic.insert("input");
     268  generic.insert("linear-interpolate");
    265269//  generic.insert("molecular-volume");
    266270  generic.insert("nonconvex-envelope");
     271  generic.insert("output");
    267272        generic.insert("pair-correlation");
    268273        generic.insert("parse-xyz");
  • src/CommandLineParser.cpp

    rd0fbec r4f7f34e  
    5656{
    5757  // go through all arguments
     58  cout << Verbose(1) << "By default putting input into the sequence." << endl;
     59  // TODO: This may be bad, because const string "input" is destroyed at end of function
     60  SequenceOfActions.push_back("input");
    5861  for (int i=1;i<argc;i++) {
    5962    (cout << Verbose(1) << "Checking on " << argv[i] << endl);
  • src/Makefile.am

    rd0fbec r4f7f34e  
    6363
    6464ACTIONSHEADER = \
    65   ${ANALYSISACTIONHEADER} \
    66   ${ATOMACTIONHEADER} \
    67   ${CMDACTIONHEADER} \
    68   ${FRAGMENTATIONACTIONHEADER} \
    69   ${MOLECULEACTIONHEADER} \
    70   ${PARSERACTIONHEADER} \
    71   ${TESSELATIONACTIONHEADER} \
    72   ${WORLDACTIONHEADER} \
    7365  Actions/Action.hpp \
    7466  Actions/ActionHistory.hpp \
  • src/UIElements/CommandLineUI/CommandLineWindow.cpp

    rd0fbec r4f7f34e  
    4747#include "Actions/WorldAction/CenterOnEdgeAction.hpp"
    4848#include "Actions/WorldAction/ChangeBoxAction.hpp"
     49#include "Actions/WorldAction/InputAction.hpp"
     50#include "Actions/WorldAction/OutputAction.hpp"
    4951#include "Actions/WorldAction/RemoveSphereOfAtomsAction.hpp"
    5052#include "Actions/WorldAction/RepeatBoxAction.hpp"
     
    8183
    8284void CommandLineWindow::display() {
     85  //cout << ActionRegistry::getInstance();
     86
    8387  // go through all possible actions
    8488  for (std::list<std::string>::iterator CommandRunner = CommandLineParser::getInstance().SequenceOfActions.begin(); CommandRunner != CommandLineParser::getInstance().SequenceOfActions.end(); ++CommandRunner) {
     
    156160  new WorldCenterOnEdgeAction();
    157161  new WorldChangeBoxAction();
     162  new WorldInputAction();
     163  new WorldOutputAction();
    158164  new WorldRemoveSphereOfAtomsAction();
    159165  new WorldRepeatBoxAction();
  • src/builder.cpp

    rd0fbec r4f7f34e  
    21812181    int ExitFlag = 0;
    21822182    bool ArgumentsCopied = false;
    2183     char *ConfigFileName = new char[MAXSTRINGSIZE];
     2183    //char *ConfigFileName = new char[MAXSTRINGSIZE];
    21842184    std::string BondGraphFileName("\n");
    21852185    FormatParserStorage::getInstance().addMpqc();
     
    22102210    // Parse command line options and if present create respective UI
    22112211    {
    2212       set<int> ArgcList;
    2213       ArgcList.insert(0); // push back program!
    2214       ArgcList.insert(1); // push back config file name
     2212      //set<int> ArgcList;
     2213      //ArgcList.insert(0); // push back program!
     2214      //ArgcList.insert(1); // push back config file name
    22152215      // handle arguments by ParseCommandLineOptions()
    2216       ExitFlag = ParseCommandLineOptions(argc,argv,World::getInstance().getMolecules(),World::getInstance().getPeriode(),*World::getInstance().getConfig(), &ConfigFileName, BondGraphFileName, ArgcList);
    2217       World::getInstance().setExitFlag(ExitFlag);
     2216      //ExitFlag = ParseCommandLineOptions(argc,argv,World::getInstance().getMolecules(),World::getInstance().getPeriode(),*World::getInstance().getConfig(), &ConfigFileName, BondGraphFileName, ArgcList);
     2217      //World::getInstance().setExitFlag(ExitFlag);
    22182218      // copy all remaining arguments to a new argv
    2219       Arguments = new char *[ArgcList.size()];
     2219      Arguments = new char *[argc];
    22202220      cout << "The following arguments are handled by CommandLineParser: ";
    2221       for (set<int>::iterator ArgcRunner = ArgcList.begin(); ArgcRunner != ArgcList.end(); ++ArgcRunner) {
    2222         Arguments[ArgcSize] = new char[strlen(argv[*ArgcRunner])+2];
    2223         strcpy(Arguments[ArgcSize], argv[*ArgcRunner]);
    2224         cout << " " << argv[*ArgcRunner];
     2221      for (int ArgcRunner=0;ArgcRunner<argc;ArgcRunner++) {
     2222      //for (set<int>::iterator ArgcRunner = ArgcList.begin(); ArgcRunner != ArgcList.end(); ++ArgcRunner) {
     2223        Arguments[ArgcSize] = new char[strlen(argv[ArgcRunner])+2];
     2224        strcpy(Arguments[ArgcSize], argv[ArgcRunner]);
     2225        cout << " " << argv[ArgcRunner];
    22252226        ArgcSize++;
    22262227      }
     
    22582259    }
    22592260
    2260     std::string FilenamePrefix(ConfigFileName);
    2261     FormatParserStorage::getInstance().SetOutputPrefixForAll(FilenamePrefix);
    22622261    FormatParserStorage::getInstance().SaveAll();
    22632262    ChangeTracker::getInstance().saveStatus();
     
    22692268    delete[](Arguments);
    22702269  }
    2271   delete[](ConfigFileName);
     2270  //delete[](ConfigFileName);
    22722271
    22732272  ExitFlag = World::getInstance().getExitFlag();
  • tests/regression/testsuite-simple_configuration.at

    rd0fbec r4f7f34e  
    5252AT_SETUP([Simple configuration - invalid commands on empty configs])
    5353AT_KEYWORDS([configuration])
    54 AT_CHECK([../../molecuilder empty.conf -e ${abs_top_srcdir}/src/ -t -s -b -E -c -b -a -U -T -u], 255, [ignore], [stderr])
    55 AT_CHECK([fgrep -c "Not enough" stderr], 0, [1
    56 ], [ignore])
     54AT_CHECK([../../molecuilder empty.conf -e ${abs_top_srcdir}/src/ -t -s -b -E -c -b -a -U -T -u], 134, [ignore], [stderr])
    5755AT_CLEANUP
    5856
     
    6159AT_KEYWORDS([configuration])
    6260AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/7/pre/test.conf .], 0)
    63 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -t], 255, [ignore], [stderr])
    64 AT_CHECK([fgrep -c "CRITICAL: Not enough" stderr], 0, [ignore], [ignore])
    65 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -s -b -E -c -b -a -U -T -u], 255, [ignore], [stderr])
    66 AT_CHECK([fgrep -c "CRITICAL: Not enough" stderr], 0, [ignore], [ignore])
    67 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -b -E -c -b -a -U -T -u], 255, [ignore], [stderr])
    68 AT_CHECK([fgrep -c "CRITICAL: Not enough" stderr], 0, [ignore], [ignore])
    69 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -E -c -b -a -U -T -u], 255, [ignore], [stderr])
    70 AT_CHECK([fgrep -c "CRITICAL: Not enough" stderr], 0, [ignore], [ignore])
    71 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -c -b -a -U -T -u], 255, [ignore], [stderr])
    72 AT_CHECK([fgrep -c "CRITICAL: Not enough" stderr], 0, [ignore], [ignore])
    73 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -b -a -U -T -u], 255, [ignore], [stderr])
    74 AT_CHECK([fgrep -c "CRITICAL: Not enough" stderr], 0, [ignore], [ignore])
    75 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -a -U -T -u], 255, [ignore], [stderr])
    76 AT_CHECK([fgrep -c "CRITICAL: Not enough" stderr], 0, [ignore], [ignore])
    77 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -U -T -u], 255, [ignore], [stderr])
    78 AT_CHECK([fgrep -c "CRITICAL: Not enough" stderr], 0, [ignore], [ignore])
    79 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -T -u], 255, [ignore], [stderr])
    80 AT_CHECK([fgrep -c "CRITICAL: Not enough" stderr], 0, [ignore], [ignore])
    81 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -u], 255, [ignore], [stderr])
    82 AT_CHECK([fgrep -c "CRITICAL: Not enough" stderr], 0, [ignore], [ignore])
     61AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -t], 134, [ignore], [stderr])
     62AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -s -b -E -c -b -a -U -T -u], 134, [ignore], [stderr])
     63AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -b -E -c -b -a -U -T -u], 134, [ignore], [stderr])
     64AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -E -c -b -a -U -T -u], 134, [ignore], [stderr])
     65AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -c -b -a -U -T -u], 134, [ignore], [stderr])
     66AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -b -a -U -T -u], 134, [ignore], [stderr])
     67AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -a -U -T -u], 134, [ignore], [stderr])
     68AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -U -T -u], 134, [ignore], [stderr])
     69AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -T -u], 134, [ignore], [stderr])
     70AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -u], 134, [ignore], [stderr])
    8371AT_CLEANUP
    8472
  • tests/regression/testsuite-standard_options.at

    rd0fbec r4f7f34e  
    1818AT_SETUP([Standard Options - no element database])
    1919AT_KEYWORDS([options])
    20 AT_CHECK([../../molecuilder -e], 255, [ignore], [stderr])
    21 AT_CHECK([fgrep "Not enough or invalid arguments" stderr], 0, [ignore], [ignore])
     20AT_CHECK([../../molecuilder -e], 134, [ignore], [stderr])
    2221AT_CLEANUP
    2322
Note: See TracChangeset for help on using the changeset viewer.