From f2ceb0d68aa780e57641e50d972fac3b6e70bd58 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Thu, 8 Aug 2002 00:11:19 +0000 Subject: Incorporate some VMS fixes. Add -B option docs. Add .VARIABLES variable. Add a few new tests. Add a new translation: Swedish --- tests/scripts/misc/general3 | 19 ++++++++++-- tests/scripts/options/dash-B | 43 ++++++++++++++++++++++++++ tests/scripts/variables/special | 68 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 127 insertions(+), 3 deletions(-) create mode 100644 tests/scripts/options/dash-B create mode 100644 tests/scripts/variables/special (limited to 'tests/scripts') diff --git a/tests/scripts/misc/general3 b/tests/scripts/misc/general3 index a265f71..2421ed4 100644 --- a/tests/scripts/misc/general3 +++ b/tests/scripts/misc/general3 @@ -5,12 +5,14 @@ This tests random features of the parser that need to be supported, and which have either broken at some point in the past or seem likely to break."; +$makefile2 = &get_tmpfile; + open(MAKEFILE,"> $makefile"); # The contents of the Makefile ... print MAKEFILE < $makefile2"); +print MAKEFILE "all:;\@echo FOO = \$(FOO)\nFOO = foo"; +close(MAKEFILE); + +&run_make_with_options($makefile2,"",&get_logfile); +$answer = "FOO = foo\n"; &compare_output($answer,&get_logfile(1)); + 1; diff --git a/tests/scripts/options/dash-B b/tests/scripts/options/dash-B new file mode 100644 index 0000000..94932e5 --- /dev/null +++ b/tests/scripts/options/dash-B @@ -0,0 +1,43 @@ +# -*-perl-*- + +$description = "Test make -B (always remake) option.\n"; + +$details = "\ +Construct a simple makefile that builds a target. +Invoke make once, so it builds everything. Invoke it again and verify +that nothing is built. Then invoke it with -B and verify that everything +is built again."; + +open(MAKEFILE,"> $makefile"); + +print MAKEFILE <<'EOF'; +.SUFFIXES: + +.PHONY: all +all: foo + +foo: bar.x + @echo cp $< $@ + @touch $@ +EOF + +close(MAKEFILE); + + +&touch('bar.x'); + +&run_make_with_options($makefile, '', &get_logfile); +$answer = "cp bar.x foo\n"; +&compare_output($answer, &get_logfile(1)); + +&run_make_with_options($makefile, '', &get_logfile); +$answer = "$make_name: Nothing to be done for `all'.\n"; +&compare_output($answer, &get_logfile(1)); + +&run_make_with_options($makefile, '-B', &get_logfile); +$answer = "cp bar.x foo\n"; +&compare_output($answer, &get_logfile(1)); + +unlink('bar.x', 'foo') unless $keep; + +1; diff --git a/tests/scripts/variables/special b/tests/scripts/variables/special new file mode 100644 index 0000000..58c8655 --- /dev/null +++ b/tests/scripts/variables/special @@ -0,0 +1,68 @@ +# -*-perl-*- + +$description = "Test special GNU make variables."; + +$details = ""; + +$makefile2 = &get_tmpfile; + + +open(MAKEFILE, "> $makefile"); + +print MAKEFILE <<'EOF'; + +X1 := $(sort $(filter FOO BAR,$(.VARIABLES))) + +FOO := foo + +X2 := $(sort $(filter FOO BAR,$(.VARIABLES))) + +BAR := bar + +all: + @echo X1 = $(X1) + @echo X2 = $(X2) + @echo LAST = $(sort $(filter FOO BAR,$(.VARIABLES))) + +EOF + +close(MAKEFILE); + +# TEST #1 +# ------- + +&run_make_with_options($makefile, "", &get_logfile); +$answer = "X1 =\nX2 = FOO\nLAST = BAR FOO\n"; +&compare_output($answer, &get_logfile(1)); + + + + +# open(MAKEFILE, "> $makefile2"); + +# print MAKEFILE <<'EOF'; + +# X1 := $(sort $(.TARGETS)) + +# all: foo +# @echo X1 = $(X1) +# @echo X2 = $(X2) +# @echo LAST = $(sort $(.TARGETS)) + +# X2 := $(sort $(.TARGETS)) + +# foo: + +# EOF + +# close(MAKEFILE); + +# # TEST #2 +# # ------- + +# &run_make_with_options($makefile2, "", &get_logfile); +# $answer = "X1 =\nX2 = all\nLAST = all foo\n"; +# &compare_output($answer, &get_logfile(1)); + + +1; -- cgit v1.2.3