-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun_test.go
More file actions
38 lines (33 loc) · 811 Bytes
/
Copy pathrun_test.go
File metadata and controls
38 lines (33 loc) · 811 Bytes
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
package main
import (
"strings"
"testing"
)
func Test_doMakeKernelOpt(t *testing.T) {
target := "build"
n := 4
b := "./build_dir"
c := "arm-"
a := "arm"
m := "./mod_install"
extra := ""
expect := "build -j4 O=./build_dir CROSS_COMPILE=arm- ARCH=arm INSTALL_MOD_PATH=./mod_install"
output := doMakeKernelOpt(target, n, b, c, a, m, extra)
o := strings.Join(output, " ")
if o != expect {
t.Error("output is wrong:", o)
}
target = "config"
n = 2
b = ""
c = "arm-"
a = ""
m = ""
extra = "CFLAGS_KERNEL=-march=armv7-a CFLAGS_GCOV=-fprofile-arcs"
expect = "config -j2 CROSS_COMPILE=arm- CFLAGS_KERNEL=-march=armv7-a CFLAGS_GCOV=-fprofile-arcs"
output = doMakeKernelOpt(target, n, b, c, a, m, extra)
o = strings.Join(output, " ")
if o != expect {
t.Error("output is wrong:", o)
}
}