Module Name:    src
Committed By:   rillig
Date:           Fri Dec  3 21:55:10 UTC 2021

Modified Files:
        src/usr.bin/make/unit-tests: opt-tracefile.exp opt-tracefile.mk

Log Message:
tests/make: test option '-T' for tracing job events


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/opt-tracefile.exp
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/opt-tracefile.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/unit-tests/opt-tracefile.exp
diff -u src/usr.bin/make/unit-tests/opt-tracefile.exp:1.1 src/usr.bin/make/unit-tests/opt-tracefile.exp:1.2
--- src/usr.bin/make/unit-tests/opt-tracefile.exp:1.1	Sun Aug 16 12:07:51 2020
+++ src/usr.bin/make/unit-tests/opt-tracefile.exp	Fri Dec  3 21:55:10 2021
@@ -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

Index: src/usr.bin/make/unit-tests/opt-tracefile.mk
diff -u src/usr.bin/make/unit-tests/opt-tracefile.mk:1.2 src/usr.bin/make/unit-tests/opt-tracefile.mk:1.3
--- src/usr.bin/make/unit-tests/opt-tracefile.mk:1.2	Sun Aug 16 14:25:16 2020
+++ src/usr.bin/make/unit-tests/opt-tracefile.mk	Fri Dec  3 21:55:10 2021
@@ -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

Reply via email to