The NetBSD Project

CVS log for src/usr.bin/make/unit-tests/hanoi-include.mk

[BACK] Up to [cvs.NetBSD.org] / src / usr.bin / make / unit-tests

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.5 / (download) - annotate - [select for diffs], Thu Oct 19 18:24:33 2023 UTC (4 months ago) by rillig
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +4 -3 lines
Diff to previous 1.4 (colored)

tests/make: clean up, explain and reorganize several tests

Revision 1.4 / (download) - annotate - [select for diffs], Thu Jan 19 22:48:42 2023 UTC (13 months ago) by rillig
Branch: MAIN
Changes since 1.3: +12 -6 lines
Diff to previous 1.3 (colored)

tests/make: remove dependency on expr(1) from a test

This saves 124 calls to the shell.

Revision 1.3 / (download) - annotate - [select for diffs], Sun May 8 07:27:50 2022 UTC (21 months, 2 weeks ago) by rillig
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10
Changes since 1.2: +13 -12 lines
Diff to previous 1.2 (colored)

tests/make: add test for option '-X', clean up comments

Revision 1.2 / (download) - annotate - [select for diffs], Sat Jan 8 22:13:43 2022 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.1: +3 -3 lines
Diff to previous 1.1 (colored)

tests/make: test line numbers in debug output for parsing files

Revision 1.1 / (download) - annotate - [select for diffs], Sat Oct 3 17:30:54 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
CVS Tags: cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x

make(1): add test demonstrating the Towers of Hanoi puzzle

It's not the primary task of make to handle procedure calls with
parameters, combined with lexical scoping, therefore the code does not
look as straight-forward or clean as in other programming languages.  It
feels more like squeezing a programming problem from the imperative
world into the world of declarative dependencies.

A more idiomatic way of implementing this puzzle should be as a
dependency graph since that's both the natural structure of the puzzle
and the primary domain of make.  Something like having a main target
"hanoi-5" that depends on intermediate targets of the form
"move-1.2.3.4.5-_._._._._-_._._._._", each representing a single
configuration of the stacks.  These targets could be generated
dynamically.  A benefit of this implementation would be that the puzzle
could be resumed from an arbitrary configuration, just just from the
initial configuration.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>