summaryrefslogtreecommitdiffstats
path: root/src/kmk/tests/scripts/features/mult_targets
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-11 08:21:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-11 08:21:29 +0000
commit29cd838eab01ed7110f3ccb2e8c6a35c8a31dbcc (patch)
tree63ef546b10a81d461e5cf5ed9e98a68cd7dee1aa /src/kmk/tests/scripts/features/mult_targets
parentInitial commit. (diff)
downloadkbuild-29cd838eab01ed7110f3ccb2e8c6a35c8a31dbcc.tar.xz
kbuild-29cd838eab01ed7110f3ccb2e8c6a35c8a31dbcc.zip
Adding upstream version 1:0.1.9998svn3589+dfsg.upstream/1%0.1.9998svn3589+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/kmk/tests/scripts/features/mult_targets')
-rw-r--r--src/kmk/tests/scripts/features/mult_targets46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/kmk/tests/scripts/features/mult_targets b/src/kmk/tests/scripts/features/mult_targets
new file mode 100644
index 0000000..c8ff418
--- /dev/null
+++ b/src/kmk/tests/scripts/features/mult_targets
@@ -0,0 +1,46 @@
+$description = "The following test creates a makefile to test that a \n "
+ ."rule with multiple targets is equivalent to writing \n"
+ ."many rules, each with one target, and all identical aside\n"
+ ."from that.";
+
+$details = "A makefile is created with one rule and two targets. Make \n"
+ ."is called twice, once for each target, and the output which \n"
+ ."contains the target name with \$@ is looked at for the changes.\n"
+ ."This test also tests the substitute function by replacing \n"
+ ."the word output with nothing in the target name giving either\n"
+ ."an output of \"I am little\" or \"I am big\"";
+
+open(MAKEFILE,"> $makefile");
+
+# The Contents of the MAKEFILE ...
+
+print MAKEFILE "bigoutput littleoutput: test.h\n";
+print MAKEFILE "\t\@echo I am \$(subst output,,\$@)\n";
+
+# END of Contents of MAKEFILE
+
+close(MAKEFILE);
+
+&touch("test.h");
+
+&run_make_with_options($makefile,"bigoutput",&get_logfile);
+
+
+# Create the answer to what should be produced by this Makefile
+$answer = "I am big\n";
+
+&compare_output($answer,&get_logfile(1));
+
+&run_make_with_options($makefile,"littleoutput",&get_logfile);
+$answer = "I am little\n";
+&compare_output($answer,&get_logfile(1));
+
+unlink "test.h";
+
+1;
+
+
+
+
+
+