Commit b9869658 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent fc1fa022
...@@ -626,6 +626,10 @@ func (p *Program) Import(pkgpath string) (prog *loader.Program, pkgi *loader.Pac ...@@ -626,6 +626,10 @@ func (p *Program) Import(pkgpath string) (prog *loader.Program, pkgi *loader.Pac
return nil, nil, err return nil, nil, err
} }
if !(len(prog.Created) == 0 && len(prog.Imported) == 1) {
panic("import")
}
p.progv = append(p.progv, prog) p.progv = append(p.progv, prog)
pkgi = prog.InitialPackages()[0] pkgi = prog.InitialPackages()[0]
return prog, pkgi, nil return prog, pkgi, nil
...@@ -643,10 +647,14 @@ func (p *Program) ImportWithTests(pkgpath string) (prog *loader.Program, pkgi *l ...@@ -643,10 +647,14 @@ func (p *Program) ImportWithTests(pkgpath string) (prog *loader.Program, pkgi *l
return nil, nil, nil, err return nil, nil, nil, err
} }
pkgi = prog.InitialPackages()[0] if len(prog.Imported) != 1 {
panic("import with tests")
}
if len(prog.Created) > 0 { if len(prog.Created) > 0 {
xtestPkgi = prog.Created[0] xtestPkgi = prog.Created[0]
} }
for _, pkgi = range prog.Imported {}
return prog, pkgi, xtestPkgi, nil return prog, pkgi, xtestPkgi, nil
} }
...@@ -661,6 +669,10 @@ func tracegen(pkgpath string, ctxt *build.Context, cwd string) error { ...@@ -661,6 +669,10 @@ func tracegen(pkgpath string, ctxt *build.Context, cwd string) error {
P := NewProgram(ctxt, cwd) P := NewProgram(ctxt, cwd)
lprog, pkgi, xtestPkgi, err := P.ImportWithTests(pkgpath) lprog, pkgi, xtestPkgi, err := P.ImportWithTests(pkgpath)
//fmt.Println(pkgpath)
//fmt.Printf("%#p\n", pkgi)
//fmt.Printf("%#p\n", xtestPkgi)
//panic(0)
if err != nil { if err != nil {
return err return err
} }
......
// Code generated by lab.nexedi.com/kirr/go123/tracing/cmd/gotrace; DO NOT EDIT.
package pkg3
// code generated for tracepoints
import (
"lab.nexedi.com/kirr/neo/go/xcommon/tracing"
"unsafe"
aaa1 "a/pkg1"
"net/url"
)
// traceimport: aaa1 "a/pkg1"
//go:linkname aaa1_traceDoSomething_Attach a/pkg1.traceDoSomething_Attach
func aaa1_traceDoSomething_Attach(*tracing.ProbeGroup, func(topic string)) *tracing.Probe
//go:linkname aaa1_traceNewT_Attach a/pkg1.traceNewT_Attach
func aaa1_traceNewT_Attach(*tracing.ProbeGroup, func(t *aaa1.T)) *tracing.Probe
//go:linkname aaa1_traceNewTPre_Attach a/pkg1.traceNewTPre_Attach
func aaa1_traceNewTPre_Attach(*tracing.ProbeGroup, func()) *tracing.Probe
//go:linkname aaa1_traceURLParsed_Attach a/pkg1.traceURLParsed_Attach
func aaa1_traceURLParsed_Attach(*tracing.ProbeGroup, func(u *url.URL)) *tracing.Probe
// Code generated by lab.nexedi.com/kirr/go123/tracing/cmd/gotrace; DO NOT EDIT.
package pkg3_test
// code generated for tracepoints
import (
"lab.nexedi.com/kirr/neo/go/xcommon/tracing"
"unsafe"
)
// traceimport: "b/pkg2"
//go:linkname pkg2_traceDoSomething_Attach b/pkg2.traceDoSomething_Attach
func pkg2_traceDoSomething_Attach(*tracing.ProbeGroup, func(i, j int, q string)) *tracing.Probe
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment