Blame tests/scripts/functions/notdir
|
Packit |
26a39e |
$description = "The following test creates a makefile to test the notdir "
|
|
Packit |
26a39e |
."function.";
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
$details = "";
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
# IF YOU NEED >1 MAKEFILE FOR THIS TEST, USE &get_tmpfile; TO GET
|
|
Packit |
26a39e |
# THE NAME OF THE MAKEFILE. THIS INSURES CONSISTENCY AND KEEPS TRACK OF
|
|
Packit |
26a39e |
# HOW MANY MAKEFILES EXIST FOR EASY DELETION AT THE END.
|
|
Packit |
26a39e |
# EXAMPLE: $makefile2 = &get_tmpfile;
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
open(MAKEFILE,"> $makefile");
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
# The Contents of the MAKEFILE ...
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
print MAKEFILE "string := \$(notdir ${pathsep}src${pathsep}foo.c hacks) \n"
|
|
Packit |
26a39e |
."all: \n"
|
|
Packit |
26a39e |
."\t\@echo \$(string) \n";
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
# END of Contents of MAKEFILE
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
close(MAKEFILE);
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
&run_make_with_options($makefile,"",&get_logfile,0);
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
# Create the answer to what should be produced by this Makefile
|
|
Packit |
26a39e |
$answer = "foo.c hacks\n";
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
# COMPARE RESULTS
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
# In this call to compare output, you should use the call &get_logfile(1)
|
|
Packit |
26a39e |
# to send the name of the last logfile created. You may also use
|
|
Packit |
26a39e |
# the special call &get_logfile(1) which returns the same as &get_logfile(1).
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
&compare_output($answer,&get_logfile(1));
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
# This tells the test driver that the perl test script executed properly.
|
|
Packit |
26a39e |
1;
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
|
|
Packit |
26a39e |
|