proj home

Files   Classes   Functions   Hierarchy  

makestatetest.cpp

Go to the documentation of this file.
00001 #include <iostream>
00002 using namespace std;
00003 
00004 #include <cfcontainervec.h>
00005 #include <commandline.h>
00006 #include <compilationfile.h>
00007 #include <makestate.h>
00008 #include <makestatetest.h>
00009 #include <processqueuebuild.h>
00010 
00011 string makestatetest::doc[] = 
00012 {
00013   "",
00014   "Test standardbuild and print.",
00015   "Test eval(compilationfile&).",
00016   "Construct and add main.cpp onto process queue.",
00017   "$ ../makefilebuildtool/main prog=34 n=5   Step though makestate evaluation",
00018   "$ ../makefilebuildtool/main prog=35 <file=vrmltest.o>   Print a header/cpp/obj file after evaluation.", 
00019   "$ ../makefilebuildtool/main prog=36 <driver=main2>   Dependencies calculated, Pass1 and Pass2 printed. "
00020 };
00021 
00022 void makestatetest::test01()
00023 {
00024   makestate<cfcontainervec> ms;
00025   ms.standardbuild();
00026   ms.printstandard=true;
00027   ms.print();
00028   cout << endl;
00029   cout << "Is iostream contained?" << endl;
00030   if ( ms.standard["iostream"] )
00031     cout << "yes" << endl; 
00032   else
00033     cout << "no" << endl;
00034 }
00035 
00036 void makestatetest::test02()
00037 {
00038 
00039   makestate<cfcontainervec> ms;
00040   ms.standardbuild();
00041 
00042   ms.proj.construct();
00043 
00044   string s1="../vrml/vrmlshapeparse.h";
00045   compilationfile cf(s1);
00046 
00047   ms.eval(cf);
00048 
00049   ms.print();
00050 }
00051 
00052 void makestatetest::test03()
00053 {
00054   makestate<cfcontainervec> ms;
00055   ms.standardbuild();
00056 
00057   ms.proj.construct();
00058 
00059   compilationfile* x = ms.proj.files["main.cpp"];
00060   ms.processqueueadd(x);
00061 
00062   ms.print();
00063 }
00064 
00065 void makestatetest::test04(int argc, char** argv)
00066 {
00067   commandline cmd(argc,argv);
00068   uint imax=3; 
00069   cmd.mapvar(imax,"n");
00070 
00071   makestate<cfcontainervec> ms;
00072   processqueuebuild<cfcontainervec> pq(ms);
00073   ms.printunknown=false;
00074   ms.printobjs=false;
00075 
00076   uint i=0;
00077   for ( ; (i<imax)&&(!pq); ++pq, ++i )
00078     ms.print();
00079 
00080   ms.print();
00081 
00082   cout << endl;
00083   ms.printprocessqueue=false;
00084   ms.printprocessed=false;
00085   ms.printunknown=true;
00086   ms.printobjs=true;
00087   ms.print();
00088 
00089 }
00090 
00091 void makestatetest::test05(int argc, char** argv)
00092 {
00093   commandline cmd(argc,argv);
00094   string file="main.cpp";
00095   cmd.mapvar(file,"file");
00096 
00097   makestate<cfcontainervec> ms;
00098   processqueuebuild<cfcontainervec> pq(ms);
00099   //ms.printunknown=false;
00100   //ms.printobjs=false;
00101 
00102   for ( ; !pq; ++pq );
00103 
00104   ms.print();
00105 
00106   compilationfile* x = ms.proj.files[file];
00107   if (!x)
00108     x = ms.objs[file];
00109   if (!x)
00110   {
00111     cout << "error:  file "+file << " not found." << endl;
00112     return;
00113   }
00114   x->print();
00115 }
00116 
00117 void makestatetest::test06(int argc, char** argv)
00118 {
00119   commandline cmd(argc,argv);
00120 
00121   makestate<cfcontainervec> ms;
00122   cmd.mapvar(ms.driver,"driver");
00123 
00124   processqueuebuild<cfcontainervec> pq(ms);
00125   for ( ; !pq; ++pq );
00126 
00127   ms.print();
00128   
00129   //cout << "Trying now" << endl;
00130 
00131 /*
00132   ms.objs.reset();
00133   if (!ms.objs)
00134     ms.objseval(*ms.objs());
00135 */
00136   cout << "Turning on/off printing stuff" << endl << endl;
00137   ms.printobjsdependencies=true; 
00138   ms.printprocessqueue=false;
00139   ms.printunknown=false;
00140   ms.printprocessed=false;
00141   ms.printobjs=false;
00142 
00143   cout << "Pass1" << endl;
00144   ms.objsdependenciesPass1();
00145 
00146   ms.print();
00147 
00148   cout << "Pass2" << endl;
00149   ms.objsdependenciesPass2();
00150   ms.print();
00151 }
00152 
00153 

Generated on Fri Mar 4 00:49:28 2011 for Chelton Evans Source by  doxygen 1.5.8