refine gobuild: the files must be *_test.go not *test.go

this causes complications

R=rsc
DELTA=1724  (849 added, 856 deleted, 19 changed)
OCL=19667
CL=19667
This commit is contained in:
Rob Pike 2008-11-19 19:43:32 -08:00
parent 12254b6c0b
commit c0a01e9665
13 changed files with 25 additions and 32 deletions

View file

@ -290,7 +290,7 @@ char preamble[] =
"\n"
"coverage: packages\n"
"\tgotest\n"
"\t6cov -g `pwd` | grep -v '^.*test\\.go:'\n"
"\t6cov -g `pwd` | grep -v '_test\\.go:'\n"
"\n"
"%%.$O: %%.go\n"
"\t$(GC) $*.go\n"
@ -487,7 +487,7 @@ main(int argc, char **argv)
njob = 0;
job = emalloc(argc*sizeof job[0]);
for(i=0; i<argc; i++) {
if(strstr(argv[i], "test.go") != nil)
if(suffix(argv[i], "_test.go") != nil)
continue;
job[njob].name = argv[i];
job[njob].pass = -1;

View file

@ -20,7 +20,7 @@ test: packages
coverage: packages
gotest
6cov -g `pwd` | grep -v '^.*test\.go:'
6cov -g `pwd` | grep -v '_test\.go:'
%.$O: %.go
$(GC) $*.go

View file

@ -20,7 +20,7 @@ test: packages
coverage: packages
gotest
6cov -g `pwd` | grep -v '^test.*\.go:'
6cov -g `pwd` | grep -v '_test\.go:'
%.$O: %.go
$(GC) $*.go

View file

@ -20,7 +20,7 @@ test: packages
coverage: packages
gotest
6cov -g `pwd` | grep -v '^test.*\.go:'
6cov -g `pwd` | grep -v '_test\.go:'
%.$O: %.go
$(GC) $*.go

View file

@ -20,7 +20,7 @@ test: packages
coverage: packages
gotest
6cov -g `pwd` | grep -v '^.*test\.go:'
6cov -g `pwd` | grep -v '_test\.go:'
%.$O: %.go
$(GC) $*.go

View file

@ -20,7 +20,7 @@ test: packages
coverage: packages
gotest
6cov -g `pwd` | grep -v '^test.*\.go:'
6cov -g `pwd` | grep -v '_test\.go:'
%.$O: %.go
$(GC) $*.go
@ -32,35 +32,29 @@ coverage: packages
$(AS) $*.s
O1=\
fd_$(GOOS).$O\
ip.$O\
O2=\
fd_$(GOOS).$O\
fd.$O\
net_$(GOOS).$O\
O3=\
fd.$O\
O4=\
net.$O\
net.a: a1 a2 a3 a4
net.a: a1 a2 a3
a1: $(O1)
$(AR) grc net.a ip.$O
$(AR) grc net.a fd_$(GOOS).$O ip.$O
rm -f $(O1)
a2: $(O2)
$(AR) grc net.a fd_$(GOOS).$O net_$(GOOS).$O
$(AR) grc net.a fd.$O net_$(GOOS).$O
rm -f $(O2)
a3: $(O3)
$(AR) grc net.a fd.$O
rm -f $(O3)
a4: $(O4)
$(AR) grc net.a net.$O
rm -f $(O4)
rm -f $(O3)
newpkg: clean
$(AR) grc net.a
@ -68,7 +62,6 @@ newpkg: clean
$(O1): newpkg
$(O2): a1
$(O3): a2
$(O4): a3
nuke: clean
rm -f $(GOROOT)/pkg/net.a

View file

@ -20,7 +20,7 @@ test: packages
coverage: packages
gotest
6cov -g `pwd` | grep -v '^test.*\.go:'
6cov -g `pwd` | grep -v '_test\.go:'
%.$O: %.go
$(GC) $*.go
@ -35,9 +35,9 @@ O1=\
os_error.$O\
O2=\
os_env.$O\
os_file.$O\
os_time.$O\
os_env.$O\
os.a: a1 a2
@ -46,7 +46,7 @@ a1: $(O1)
rm -f $(O1)
a2: $(O2)
$(AR) grc os.a os_env.$O os_file.$O os_time.$O
$(AR) grc os.a os_file.$O os_time.$O os_env.$O
rm -f $(O2)
newpkg: clean

View file

@ -20,7 +20,7 @@ test: packages
coverage: packages
gotest
6cov -g `pwd` | grep -v '^.*test\.go:'
6cov -g `pwd` | grep -v '_test\.go:'
%.$O: %.go
$(GC) $*.go

View file

@ -175,24 +175,24 @@ export func TestAll(tt *testing.T) { // TODO(r): wrap up better
type C chan *T; // TODO: should not be necessary
var tmp = new(C);
value := reflect.NewValue(tmp);
assert(reflect.ValueToString(value), "*reflect.C·test(@)");
assert(reflect.ValueToString(value), "*reflect.C·all_test(@)");
}
{
type A [10]int;
var tmp A = A{1,2,3,4,5,6,7,8,9,10};
value := reflect.NewValue(&tmp);
assert(reflect.ValueToString(value.(reflect.PtrValue).Sub()), "reflect.A·test{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}");
assert(reflect.ValueToString(value.(reflect.PtrValue).Sub()), "reflect.A·all_test{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}");
value.(reflect.PtrValue).Sub().(reflect.ArrayValue).Elem(4).(reflect.IntValue).Set(123);
assert(reflect.ValueToString(value.(reflect.PtrValue).Sub()), "reflect.A·test{1, 2, 3, 4, 123, 6, 7, 8, 9, 10}");
assert(reflect.ValueToString(value.(reflect.PtrValue).Sub()), "reflect.A·all_test{1, 2, 3, 4, 123, 6, 7, 8, 9, 10}");
}
{
type AA []int;
tmp1 := [10]int{1,2,3,4,5,6,7,8,9,10}; // TODO: should not be necessary to use tmp1
var tmp *AA = &tmp1;
value := reflect.NewValue(tmp);
assert(reflect.ValueToString(value.(reflect.PtrValue).Sub()), "reflect.AA·test{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}");
assert(reflect.ValueToString(value.(reflect.PtrValue).Sub()), "reflect.AA·all_test{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}");
value.(reflect.PtrValue).Sub().(reflect.ArrayValue).Elem(4).(reflect.IntValue).Set(123);
assert(reflect.ValueToString(value.(reflect.PtrValue).Sub()), "reflect.AA·test{1, 2, 3, 4, 123, 6, 7, 8, 9, 10}");
assert(reflect.ValueToString(value.(reflect.PtrValue).Sub()), "reflect.AA·all_test{1, 2, 3, 4, 123, 6, 7, 8, 9, 10}");
}
{

View file

@ -20,7 +20,7 @@ test: packages
coverage: packages
gotest
6cov -g `pwd` | grep -v '^.*test\.go:'
6cov -g `pwd` | grep -v '_test\.go:'
%.$O: %.go
$(GC) $*.go

View file

@ -20,7 +20,7 @@ test: packages
coverage: packages
gotest
6cov -g `pwd` | grep -v '^.*test\.go:'
6cov -g `pwd` | grep -v '_test\.go:'
%.$O: %.go
$(GC) $*.go

View file

@ -22,7 +22,7 @@ test: packages
coverage: packages
gotest
6cov -g `pwd` | grep -v '^test.*\.go:'
6cov -g `pwd` | grep -v '_test\.go:'
%.$O: %.go
$(GC) $*.go