Home | History | Annotate | Line # | Download | only in functions
dir revision 1.1
      1  1.1  christos $description = "The following test creates a makefile to test the dir "
      2  1.1  christos               ."function.";
      3  1.1  christos 
      4  1.1  christos $details = "";
      5  1.1  christos 
      6  1.1  christos # IF YOU NEED >1 MAKEFILE FOR THIS TEST, USE &get_tmpfile; TO GET
      7  1.1  christos # THE NAME OF THE MAKEFILE.  THIS INSURES CONSISTENCY AND KEEPS TRACK OF
      8  1.1  christos # HOW MANY MAKEFILES EXIST FOR EASY DELETION AT THE END.
      9  1.1  christos # EXAMPLE: $makefile2 = &get_tmpfile;
     10  1.1  christos 
     11  1.1  christos 
     12  1.1  christos open(MAKEFILE,"> $makefile");
     13  1.1  christos 
     14  1.1  christos # The Contents of the MAKEFILE ...
     15  1.1  christos 
     16  1.1  christos print MAKEFILE "string := \$(dir src${pathsep}foo.c hacks) \n"
     17  1.1  christos               ."all: \n"
     18  1.1  christos               ."\t\@echo \$(string) \n";
     19  1.1  christos 
     20  1.1  christos # END of Contents of MAKEFILE
     21  1.1  christos 
     22  1.1  christos close(MAKEFILE);
     23  1.1  christos 
     24  1.1  christos &run_make_with_options($makefile,"",&get_logfile,0);
     25  1.1  christos 
     26  1.1  christos # Create the answer to what should be produced by this Makefile
     27  1.1  christos $answer = "src${pathsep} .${pathsep}\n";
     28  1.1  christos 
     29  1.1  christos # COMPARE RESULTS
     30  1.1  christos 
     31  1.1  christos # In this call to compare output, you should use the call &get_logfile(1)
     32  1.1  christos # to send the name of the last logfile created.  You may also use
     33  1.1  christos # the special call &get_logfile(1) which returns the same as &get_logfile(1).
     34  1.1  christos 
     35  1.1  christos &compare_output($answer,&get_logfile(1));
     36  1.1  christos 
     37  1.1  christos # This tells the test driver that the perl test script executed properly.
     38  1.1  christos 1;
     39  1.1  christos 
     40  1.1  christos 
     41  1.1  christos 
     42  1.1  christos 
     43  1.1  christos 
     44  1.1  christos 
     45