-
-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathMakefile_test.go
More file actions
45 lines (41 loc) · 1.08 KB
/
Makefile_test.go
File metadata and controls
45 lines (41 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package main
import (
"os"
"strings"
"testing"
)
func TestMakefileIncludesNewCommandsInBuildAndInstall(t *testing.T) {
data, err := os.ReadFile("Makefile")
if err != nil {
t.Fatalf("ReadFile(Makefile) error = %v", err)
}
text := string(data)
for _, needle := range []string{
"BUILDCMD_LSDIFF=$(GOBUILD) ./cmd/lsdiff",
"BUILDCMD_LSSHFS=$(GOBUILD) ./cmd/lsshfs",
"BUILDCMD_LSMUX=$(GOBUILD) ./cmd/lsmux",
"$(BUILDCMD_LSDIFF)",
"$(BUILDCMD_LSSHFS)",
"$(BUILDCMD_LSMUX)",
"cp lsdiff $(INSTALL_PATH_LSDIFF)",
"cp lsshfs $(INSTALL_PATH_LSSHFS)",
"cp lsmux $(INSTALL_PATH_LSMUX)",
"cp lspipe $(INSTALL_PATH_LSPIPE)",
} {
if !strings.Contains(text, needle) {
t.Fatalf("Makefile missing %q", needle)
}
}
}
func TestMakefileCompletionTargetsExist(t *testing.T) {
data, err := os.ReadFile("Makefile")
if err != nil {
t.Fatalf("ReadFile(Makefile) error = %v", err)
}
text := string(data)
for _, target := range []string{"install-completions:", "install-completions-user:"} {
if !strings.Contains(text, target) {
t.Fatalf("Makefile missing target %q", target)
}
}
}