refactor: change makefile to reflect drop of php5 and run make
This commit is contained in:
parent
d820a72c72
commit
66cc411e7c
47
Makefile
47
Makefile
@ -1,5 +1,3 @@
|
|||||||
PHPFILE=example.php
|
|
||||||
|
|
||||||
all: compile fmt build
|
all: compile fmt build
|
||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
@ -16,47 +14,42 @@ cover:
|
|||||||
go test ./... --cover
|
go test ./... --cover
|
||||||
|
|
||||||
bench:
|
bench:
|
||||||
go test -benchmem -bench=. ./internal/php5
|
go test -benchmem -bench=. ./internal/php8
|
||||||
go test -benchmem -bench=. ./internal/php7
|
go test -benchmem -bench=. ./internal/php7
|
||||||
|
|
||||||
compile: ./internal/php5/php5.go ./internal/php7/php7.go ./internal/php8/php8.go ./internal/php8/scanner.go ./internal/scanner/scanner.go
|
compile: ./internal/php8/php8.go ./internal/php7/php7.go ./internal/php8/scanner.go ./internal/php7/scanner.go
|
||||||
sed -i -e 's/yyErrorVerbose = false/yyErrorVerbose = true/g' ./internal/php5/php5.go
|
|
||||||
sed -i -e 's/yyErrorVerbose = false/yyErrorVerbose = true/g' ./internal/php7/php7.go
|
|
||||||
sed -i -e 's/yyErrorVerbose = false/yyErrorVerbose = true/g' ./internal/php8/php8.go
|
sed -i -e 's/yyErrorVerbose = false/yyErrorVerbose = true/g' ./internal/php8/php8.go
|
||||||
sed -i -e 's/\/\/line/\/\/ line/g' ./internal/php5/php5.go
|
sed -i -e 's/yyErrorVerbose = false/yyErrorVerbose = true/g' ./internal/php7/php7.go
|
||||||
sed -i -e 's/\/\/line/\/\/ line/g' ./internal/php7/php7.go
|
|
||||||
sed -i -e 's/\/\/line/\/\/ line/g' ./internal/php8/php8.go
|
sed -i -e 's/\/\/line/\/\/ line/g' ./internal/php8/php8.go
|
||||||
sed -i -e 's/\/\/line/\/\/ line/g' ./internal/scanner/scanner.go
|
sed -i -e 's/\/\/line/\/\/ line/g' ./internal/php7/php7.go
|
||||||
sed -i -e 's/\/\/line/\/\/ line/g' ./internal/php8/scanner.go
|
sed -i -e 's/\/\/line/\/\/ line/g' ./internal/php8/scanner.go
|
||||||
|
sed -i -e 's/\/\/line/\/\/ line/g' ./internal/php7/scanner.go
|
||||||
rm -f y.output
|
rm -f y.output
|
||||||
|
|
||||||
./internal/scanner/scanner.go: ./internal/scanner/scanner.rl
|
|
||||||
ragel -Z -G2 -o $@ $<
|
|
||||||
|
|
||||||
./internal/php5/php5.go: ./internal/php5/php5.y
|
|
||||||
goyacc -o $@ $<
|
|
||||||
|
|
||||||
./internal/php7/php7.go: ./internal/php7/php7.y
|
|
||||||
goyacc -o $@ $<
|
|
||||||
|
|
||||||
./internal/php8/php8.go: ./internal/php8/php8.y
|
./internal/php8/php8.go: ./internal/php8/php8.y
|
||||||
goyacc -o $@ $<
|
goyacc -o $@ $<
|
||||||
|
|
||||||
./internal/php8/scanner.go: ./internal/php8/scanner.rl
|
./internal/php8/scanner.go: ./internal/php8/scanner.rl
|
||||||
ragel -Z -G2 -o $@ $<
|
ragel -Z -G2 -o $@ $<
|
||||||
|
|
||||||
|
./internal/php7/scanner.go: ./internal/php7/scanner.rl
|
||||||
|
ragel -Z -G2 -o $@ $<
|
||||||
|
|
||||||
|
./internal/php7/php7.go: ./internal/php7/php7.y
|
||||||
|
goyacc -o $@ $<
|
||||||
|
|
||||||
cpu_pprof:
|
cpu_pprof:
|
||||||
|
go test -cpuprofile cpu.pprof -bench=. -benchtime=20s ./internal/php8
|
||||||
|
go tool pprof ./php8.test cpu.pprof
|
||||||
|
|
||||||
|
mem_pprof:
|
||||||
|
go test -memprofile mem.pprof -bench=. -benchtime=20s -benchmem ./internal/php8
|
||||||
|
go tool pprof -alloc_objects ./php8.test mem.pprof
|
||||||
|
|
||||||
|
cpu_pprof_php7:
|
||||||
go test -cpuprofile cpu.pprof -bench=. -benchtime=20s ./internal/php7
|
go test -cpuprofile cpu.pprof -bench=. -benchtime=20s ./internal/php7
|
||||||
go tool pprof ./php7.test cpu.pprof
|
go tool pprof ./php7.test cpu.pprof
|
||||||
|
|
||||||
mem_pprof:
|
mem_pprof_php5:
|
||||||
go test -memprofile mem.pprof -bench=. -benchtime=20s -benchmem ./internal/php7
|
go test -memprofile mem.pprof -bench=. -benchtime=20s -benchmem ./internal/php7
|
||||||
go tool pprof -alloc_objects ./php7.test mem.pprof
|
go tool pprof -alloc_objects ./php7.test mem.pprof
|
||||||
|
|
||||||
cpu_pprof_php5:
|
|
||||||
go test -cpuprofile cpu.prof -bench=. -benchtime=20s ./internal/php5
|
|
||||||
go tool pprof ./php5.test cpu.prof
|
|
||||||
|
|
||||||
mem_pprof_php5:
|
|
||||||
go test -memprofile mem.prof -bench=. -benchtime=20s -benchmem ./internal/php5
|
|
||||||
go tool pprof -alloc_objects ./php5.test mem.prof
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -3,8 +3,8 @@ package tester
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/VKCOM/php-parser/internal/php8"
|
|
||||||
"github.com/VKCOM/php-parser/internal/php7"
|
"github.com/VKCOM/php-parser/internal/php7"
|
||||||
|
"github.com/VKCOM/php-parser/internal/php8"
|
||||||
"github.com/VKCOM/php-parser/pkg/conf"
|
"github.com/VKCOM/php-parser/pkg/conf"
|
||||||
"github.com/VKCOM/php-parser/pkg/version"
|
"github.com/VKCOM/php-parser/pkg/version"
|
||||||
"gotest.tools/assert"
|
"gotest.tools/assert"
|
||||||
|
@ -3,8 +3,8 @@ package tester
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/VKCOM/php-parser/internal/php8"
|
|
||||||
"github.com/VKCOM/php-parser/internal/php7"
|
"github.com/VKCOM/php-parser/internal/php7"
|
||||||
|
"github.com/VKCOM/php-parser/internal/php8"
|
||||||
"github.com/VKCOM/php-parser/pkg/conf"
|
"github.com/VKCOM/php-parser/pkg/conf"
|
||||||
"github.com/VKCOM/php-parser/pkg/token"
|
"github.com/VKCOM/php-parser/pkg/token"
|
||||||
"github.com/VKCOM/php-parser/pkg/version"
|
"github.com/VKCOM/php-parser/pkg/version"
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
A Parser for PHP written in Go
|
A Parser for PHP written in Go
|
||||||
|
|
||||||
Package usage example:
|
Package usage example:
|
||||||
|
Loading…
Reference in New Issue
Block a user