Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/make/unit-tests tests/make: test option '-T' for tra...
details: https://anonhg.NetBSD.org/src/rev/3068d71035c2
branches: trunk
changeset: 1026639:3068d71035c2
user: rillig <rillig%NetBSD.org@localhost>
date: Fri Dec 03 21:55:10 2021 +0000
description:
tests/make: test option '-T' for tracing job events
diffstat:
usr.bin/make/unit-tests/opt-tracefile.exp | 11 +++++++++++
usr.bin/make/unit-tests/opt-tracefile.mk | 17 ++++++++++++-----
2 files changed, 23 insertions(+), 5 deletions(-)
diffs (40 lines):
diff -r 1b255975a556 -r 3068d71035c2 usr.bin/make/unit-tests/opt-tracefile.exp
--- a/usr.bin/make/unit-tests/opt-tracefile.exp Fri Dec 03 18:43:52 2021 +0000
+++ b/usr.bin/make/unit-tests/opt-tracefile.exp Fri Dec 03 21:55:10 2021 +0000
@@ -1,1 +1,12 @@
+Making dependency1 from <nothing>.
+Making dependency2 from <nothing>.
+Making trace from dependency1 dependency2.
+0 BEG
+1 JOB
+1 DON
+1 JOB
+1 DON
+1 JOB
+1 DON
+0 END
exit status 0
diff -r 1b255975a556 -r 3068d71035c2 usr.bin/make/unit-tests/opt-tracefile.mk
--- a/usr.bin/make/unit-tests/opt-tracefile.mk Fri Dec 03 18:43:52 2021 +0000
+++ b/usr.bin/make/unit-tests/opt-tracefile.mk Fri Dec 03 21:55:10 2021 +0000
@@ -1,8 +1,15 @@
-# $NetBSD: opt-tracefile.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $
+# $NetBSD: opt-tracefile.mk,v 1.3 2021/12/03 21:55:10 rillig Exp $
#
-# Tests for the -T command line option.
+# Tests for the command line option '-T', which in jobs mode appends a trace
+# record to a trace log whenever a job is started or completed.
-# TODO: Implementation
+all: .PHONY
+ @rm -f opt-tracefile.log
+ @${MAKE} -f opt-tracefile.mk -j1 -Topt-tracefile.log trace
+ # Remove timestamps, process IDs and directory paths.
+ @awk '{ print $$2, $$3 }' opt-tracefile.log
-all:
- @:;
+trace dependency1 dependency2: .PHONY
+ @echo 'Making ${.TARGET} from ${.ALLSRC:S,^$,<nothing>,W}.'
+
+trace: dependency1 dependency2
Home |
Main Index |
Thread Index |
Old Index