auto test both. logic is correct now. seems to work

This commit is contained in:
Jeff Carr 2025-01-09 16:02:53 -06:00
parent fe98085712
commit b1961c371d
3 changed files with 13 additions and 5 deletions

View File

@ -29,7 +29,8 @@ auto:
rm -f auto.sort.pb.go auto.newsort.pb.go # auto.marshal.pb.go rm -f auto.sort.pb.go auto.newsort.pb.go # auto.marshal.pb.go
test: test:
make -C example full make -C example rawproto
make -C example modproto
junk: junk:
cd example; rm -f go.* *.pb.go cd example; rm -f go.* *.pb.go

View File

@ -1,7 +1,10 @@
VERSION = $(shell git describe --tags) VERSION = $(shell git describe --tags)
BUILDTIME = $(shell date +%Y.%m.%d_%H%M) BUILDTIME = $(shell date +%Y.%m.%d_%H%M)
full: clean auto goimports vet build modproto: clean withMutex goimports vet build
./example
rawproto: clean withoutMutex goimports vet build
./example ./example
vet: vet:
@ -10,9 +13,12 @@ vet:
build: build:
GO111MODULE=off go build GO111MODULE=off go build
auto: withMutex:
../autogenpb --proto fruit.proto --package main --mutex ../autogenpb --proto fruit.proto --package main --mutex
withoutMutex:
../autogenpb --proto fruit.proto --package main
goimports: goimports:
goimports -w *.go goimports -w *.go

View File

@ -191,9 +191,10 @@ func (pf *File) appendUnique(w io.Writer, blah *MsgName, names map[string]string
var LOCK string = pf.Bases.Lockname var LOCK string = pf.Bases.Lockname
if argv.Mutex { if argv.Mutex {
LOCK = pf.Bases.Lockname // use the mutex lock from the modified protoc.pb.go file
} else {
LOCK = "all.Lock" LOCK = "all.Lock"
} else {
LOCK = pf.Bases.Lockname
} }
fmt.Fprintln(w, "// enforces "+BASE+" is unique") fmt.Fprintln(w, "// enforces "+BASE+" is unique")