Skip to content

Commit

Permalink
Bellmar/goreleaser (#31)
Browse files Browse the repository at this point in the history
* breaking out execute functions to reduce duplicate code in main and testing

* moving listener over to execute construction

* moving preprocess over to execute construction

* moving types over to execute construction

* moving llvm over to execute construction

* moving smt over to execute construction

* moving reachability over to execute construction

* moving visualize over to execute construction

* fall back to SMT generation if no solver set

* fault should be lowercase on release binaries
  • Loading branch information
mbellotti committed Mar 26, 2023
1 parent 2fca03b commit 02e37f1
Show file tree
Hide file tree
Showing 16 changed files with 439 additions and 531 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ __debug_bin
*.tokens
grammar/Makefile

__pycache__
__pycache__
dist/
45 changes: 45 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
project_name: fault

before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin

archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of uname.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

# The lines beneath this are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
17 changes: 17 additions & 0 deletions listener/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,23 @@ func NewListener(path string, testing bool, skipRun bool) *FaultListener {
}
}

func Execute(spec string, path string, flags map[string]bool/*specType bool, testing bool*/) *FaultListener {
is := antlr.NewInputStream(spec)
lexer := parser.NewFaultLexer(is)
stream := antlr.NewCommonTokenStream(lexer, antlr.TokenDefaultChannel)

p := parser.NewFaultParser(stream)

l := NewListener(path, flags["testing"], flags["skipRun"])

if flags["specType"] {
antlr.ParseTreeWalkerDefault.Walk(l, p.Spec())
} else {
antlr.ParseTreeWalkerDefault.Walk(l, p.SysSpec())
}
return l
}

func (l *FaultListener) validate() {
if l.testing { //will allow invalid specs during testing
return
Expand Down

0 comments on commit 02e37f1

Please sign in to comment.