Sun Dec 20 22:57:40 2020 UTC ()
make(1): add tests for variable modifiers on trailing slashes


(rillig)
diff -r1.2 -r1.3 src/usr.bin/make/unit-tests/varmod-extension.exp
diff -r1.2 -r1.3 src/usr.bin/make/unit-tests/varmod-head.exp
diff -r1.2 -r1.3 src/usr.bin/make/unit-tests/varmod-root.exp
diff -r1.2 -r1.3 src/usr.bin/make/unit-tests/varmod-tail.exp
diff -r1.3 -r1.4 src/usr.bin/make/unit-tests/varmod-extension.mk
diff -r1.3 -r1.4 src/usr.bin/make/unit-tests/varmod-head.mk
diff -r1.3 -r1.4 src/usr.bin/make/unit-tests/varmod-root.mk
diff -r1.3 -r1.4 src/usr.bin/make/unit-tests/varmod-tail.mk

cvs diff -r1.2 -r1.3 src/usr.bin/make/unit-tests/varmod-extension.exp (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/varmod-extension.exp 2020/08/23 15:09:15 1.2
+++ src/usr.bin/make/unit-tests/varmod-extension.exp 2020/12/20 22:57:40 1.3
@@ -1,10 +1,11 @@ @@ -1,10 +1,11 @@
1extension of 'a/b/c' is '' 1extension of 'a/b/c' is ''
2extension of 'def' is '' 2extension of 'def' is ''
3extension of 'a.b.c' is 'c' 3extension of 'a.b.c' is 'c'
4extension of 'a.b/c' is 'b/c' 4extension of 'a.b/c' is 'b/c'
5extension of 'a' is '' 5extension of 'a' is ''
6extension of 'a.a' is 'a' 6extension of 'a.a' is 'a'
7extension of '.gitignore' is 'gitignore' 7extension of '.gitignore' is 'gitignore'
8extension of 'a' is '' 8extension of 'a' is ''
9extension of 'a.a' is 'a' 9extension of 'a.a' is 'a'
 10extension of 'trailing/' is ''
10exit status 0 11exit status 0

cvs diff -r1.2 -r1.3 src/usr.bin/make/unit-tests/varmod-head.exp (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/varmod-head.exp 2020/08/23 15:09:15 1.2
+++ src/usr.bin/make/unit-tests/varmod-head.exp 2020/12/20 22:57:40 1.3
@@ -1,10 +1,11 @@ @@ -1,10 +1,11 @@
1head (dirname) of 'a/b/c' is 'a/b' 1head (dirname) of 'a/b/c' is 'a/b'
2head (dirname) of 'def' is '.' 2head (dirname) of 'def' is '.'
3head (dirname) of 'a.b.c' is '.' 3head (dirname) of 'a.b.c' is '.'
4head (dirname) of 'a.b/c' is 'a.b' 4head (dirname) of 'a.b/c' is 'a.b'
5head (dirname) of 'a' is '.' 5head (dirname) of 'a' is '.'
6head (dirname) of 'a.a' is '.' 6head (dirname) of 'a.a' is '.'
7head (dirname) of '.gitignore' is '.' 7head (dirname) of '.gitignore' is '.'
8head (dirname) of 'a' is '.' 8head (dirname) of 'a' is '.'
9head (dirname) of 'a.a' is '.' 9head (dirname) of 'a.a' is '.'
 10head (dirname) of 'trailing/' is 'trailing'
10exit status 0 11exit status 0

cvs diff -r1.2 -r1.3 src/usr.bin/make/unit-tests/varmod-root.exp (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/varmod-root.exp 2020/08/23 15:09:15 1.2
+++ src/usr.bin/make/unit-tests/varmod-root.exp 2020/12/20 22:57:40 1.3
@@ -1,10 +1,11 @@ @@ -1,10 +1,11 @@
1root of 'a/b/c' is 'a/b/c' 1root of 'a/b/c' is 'a/b/c'
2root of 'def' is 'def' 2root of 'def' is 'def'
3root of 'a.b.c' is 'a.b' 3root of 'a.b.c' is 'a.b'
4root of 'a.b/c' is 'a' 4root of 'a.b/c' is 'a'
5root of 'a' is 'a' 5root of 'a' is 'a'
6root of 'a.a' is 'a' 6root of 'a.a' is 'a'
7root of '.gitignore' is '' 7root of '.gitignore' is ''
8root of 'a' is 'a' 8root of 'a' is 'a'
9root of 'a.a' is 'a' 9root of 'a.a' is 'a'
 10root of 'trailing/' is 'trailing/'
10exit status 0 11exit status 0

cvs diff -r1.2 -r1.3 src/usr.bin/make/unit-tests/varmod-tail.exp (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/varmod-tail.exp 2020/08/23 15:09:15 1.2
+++ src/usr.bin/make/unit-tests/varmod-tail.exp 2020/12/20 22:57:40 1.3
@@ -1,10 +1,11 @@ @@ -1,10 +1,11 @@
1tail (basename) of 'a/b/c' is 'c' 1tail (basename) of 'a/b/c' is 'c'
2tail (basename) of 'def' is 'def' 2tail (basename) of 'def' is 'def'
3tail (basename) of 'a.b.c' is 'a.b.c' 3tail (basename) of 'a.b.c' is 'a.b.c'
4tail (basename) of 'a.b/c' is 'c' 4tail (basename) of 'a.b/c' is 'c'
5tail (basename) of 'a' is 'a' 5tail (basename) of 'a' is 'a'
6tail (basename) of 'a.a' is 'a.a' 6tail (basename) of 'a.a' is 'a.a'
7tail (basename) of '.gitignore' is '.gitignore' 7tail (basename) of '.gitignore' is '.gitignore'
8tail (basename) of 'a' is 'a' 8tail (basename) of 'a' is 'a'
9tail (basename) of 'a.a' is 'a.a' 9tail (basename) of 'a.a' is 'a.a'
 10tail (basename) of 'trailing/' is ''
10exit status 0 11exit status 0

cvs diff -r1.3 -r1.4 src/usr.bin/make/unit-tests/varmod-extension.mk (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/varmod-extension.mk 2020/08/23 15:09:15 1.3
+++ src/usr.bin/make/unit-tests/varmod-extension.mk 2020/12/20 22:57:40 1.4
@@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
1# $NetBSD: varmod-extension.mk,v 1.3 2020/08/23 15:09:15 rillig Exp $ 1# $NetBSD: varmod-extension.mk,v 1.4 2020/12/20 22:57:40 rillig Exp $
2# 2#
3# Tests for the :E variable modifier, which returns the filename extension 3# Tests for the :E variable modifier, which returns the filename extension
4# of each word in the variable. 4# of each word in the variable.
5 5
6all: 6all:
7.for path in a/b/c def a.b.c a.b/c a a.a .gitignore a a.a 7.for path in a/b/c def a.b.c a.b/c a a.a .gitignore a a.a trailing/
8 @echo "extension of '"${path:Q}"' is '"${path:E:Q}"'" 8 @echo "extension of '"${path:Q}"' is '"${path:E:Q}"'"
9.endfor 9.endfor

cvs diff -r1.3 -r1.4 src/usr.bin/make/unit-tests/varmod-head.mk (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/varmod-head.mk 2020/08/23 15:09:15 1.3
+++ src/usr.bin/make/unit-tests/varmod-head.mk 2020/12/20 22:57:40 1.4
@@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
1# $NetBSD: varmod-head.mk,v 1.3 2020/08/23 15:09:15 rillig Exp $ 1# $NetBSD: varmod-head.mk,v 1.4 2020/12/20 22:57:40 rillig Exp $
2# 2#
3# Tests for the :H variable modifier, which returns the dirname of 3# Tests for the :H variable modifier, which returns the dirname of
4# each of the words in the variable value. 4# each of the words in the variable value.
5 5
6all: 6all:
7.for path in a/b/c def a.b.c a.b/c a a.a .gitignore a a.a 7.for path in a/b/c def a.b.c a.b/c a a.a .gitignore a a.a trailing/
8 @echo "head (dirname) of '"${path:Q}"' is '"${path:H:Q}"'" 8 @echo "head (dirname) of '"${path:Q}"' is '"${path:H:Q}"'"
9.endfor 9.endfor

cvs diff -r1.3 -r1.4 src/usr.bin/make/unit-tests/varmod-root.mk (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/varmod-root.mk 2020/08/23 15:09:15 1.3
+++ src/usr.bin/make/unit-tests/varmod-root.mk 2020/12/20 22:57:40 1.4
@@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
1# $NetBSD: varmod-root.mk,v 1.3 2020/08/23 15:09:15 rillig Exp $ 1# $NetBSD: varmod-root.mk,v 1.4 2020/12/20 22:57:40 rillig Exp $
2# 2#
3# Tests for the :R variable modifier, which returns the filename root 3# Tests for the :R variable modifier, which returns the filename root
4# without the extension. 4# without the extension.
5 5
6all: 6all:
7.for path in a/b/c def a.b.c a.b/c a a.a .gitignore a a.a 7.for path in a/b/c def a.b.c a.b/c a a.a .gitignore a a.a trailing/
8 @echo "root of '"${path:Q}"' is '"${path:R:Q}"'" 8 @echo "root of '"${path:Q}"' is '"${path:R:Q}"'"
9.endfor 9.endfor

cvs diff -r1.3 -r1.4 src/usr.bin/make/unit-tests/varmod-tail.mk (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/varmod-tail.mk 2020/08/23 15:09:15 1.3
+++ src/usr.bin/make/unit-tests/varmod-tail.mk 2020/12/20 22:57:40 1.4
@@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
1# $NetBSD: varmod-tail.mk,v 1.3 2020/08/23 15:09:15 rillig Exp $ 1# $NetBSD: varmod-tail.mk,v 1.4 2020/12/20 22:57:40 rillig Exp $
2# 2#
3# Tests for the :T variable modifier, which returns the basename of each of 3# Tests for the :T variable modifier, which returns the basename of each of
4# the words in the variable value. 4# the words in the variable value.
5 5
6all: 6all:
7.for path in a/b/c def a.b.c a.b/c a a.a .gitignore a a.a 7.for path in a/b/c def a.b.c a.b/c a a.a .gitignore a a.a trailing/
8 @echo "tail (basename) of '"${path:Q}"' is '"${path:T:Q}"'" 8 @echo "tail (basename) of '"${path:Q}"' is '"${path:T:Q}"'"
9.endfor 9.endfor