MCPcopy Create free account
hub / github.com/celer-pkg/celer / TestToolchainEffectiveFlags

Function TestToolchainEffectiveFlags

configs/toolchain_test.go:9–40  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestToolchainEffectiveFlags(t *testing.T) {
10 toolchain := Toolchain{
11 CFlags: []string{"-O2"},
12 CXXFlags: []string{"-O2"},
13 LinkFlags: []string{"-Wl,--as-needed"},
14 CFlagsDebug: []string{"-O0", "-g"},
15 CXXFlagsDebug: []string{"-O0", "-g"},
16 LinkFlagsDebug: []string{"-Wl,--export-dynamic"},
17 }
18
19 cflags, cxxflags, linkflags := toolchain.effectiveFlags("debug")
20 if !reflect.DeepEqual(cflags, toolchain.CFlagsDebug) {
21 t.Fatalf("debug cflags = %v, want %v", cflags, toolchain.CFlagsDebug)
22 }
23 if !reflect.DeepEqual(cxxflags, toolchain.CXXFlagsDebug) {
24 t.Fatalf("debug cxxflags = %v, want %v", cxxflags, toolchain.CXXFlagsDebug)
25 }
26 if !reflect.DeepEqual(linkflags, toolchain.LinkFlagsDebug) {
27 t.Fatalf("debug linkflags = %v, want %v", linkflags, toolchain.LinkFlagsDebug)
28 }
29
30 cflags, cxxflags, linkflags = toolchain.effectiveFlags("release")
31 if !reflect.DeepEqual(cflags, toolchain.CFlags) {
32 t.Fatalf("release cflags = %v, want %v", cflags, toolchain.CFlags)
33 }
34 if !reflect.DeepEqual(cxxflags, toolchain.CXXFlags) {
35 t.Fatalf("release cxxflags = %v, want %v", cxxflags, toolchain.CXXFlags)
36 }
37 if !reflect.DeepEqual(linkflags, toolchain.LinkFlags) {
38 t.Fatalf("release linkflags = %v, want %v", linkflags, toolchain.LinkFlags)
39 }
40}
41
42func TestToolchainGenerate_UsesDebugFlags(t *testing.T) {
43 var buffer strings.Builder

Callers

nothing calls this directly

Calls 1

effectiveFlagsMethod · 0.95

Tested by

no test coverage detected