You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
116 lines
3.2 KiB
Plaintext
116 lines
3.2 KiB
Plaintext
! garble
|
|
stderr 'Garble obfuscates Go code'
|
|
stderr 'garble \[garble flags\] command'
|
|
! stderr 'usage: go build'
|
|
! stdout .
|
|
|
|
! garble -h
|
|
stderr 'Garble obfuscates Go code'
|
|
stderr 'garble \[garble flags\] command'
|
|
! stdout .
|
|
|
|
! garble help
|
|
stderr 'Garble obfuscates Go code'
|
|
stderr 'garble \[garble flags\] command'
|
|
! stdout .
|
|
|
|
! garble help foo bar
|
|
stderr 'usage: garble help'
|
|
! stderr 'Garble obfuscates Go code'
|
|
! stdout .
|
|
|
|
! garble help -h
|
|
stderr 'usage: garble help'
|
|
! stdout .
|
|
|
|
! garble build -h
|
|
stderr 'garble \[garble flags\] build'
|
|
stderr 'This command wraps "go build"'
|
|
stderr 'usage: go build'
|
|
stderr 'Run .go help build.'
|
|
! stderr 'Garble obfuscates Go code'
|
|
! stdout .
|
|
|
|
! garble test -h
|
|
stderr 'garble \[garble flags\] test'
|
|
stderr 'This command wraps "go test"'
|
|
stderr 'usage: go test'
|
|
stderr 'Run .go help test.'
|
|
! stderr 'Garble obfuscates Go code'
|
|
! stdout .
|
|
|
|
! garble reverse -h
|
|
stderr 'garble \[garble flags\] reverse \[build flags\] package \[files\]'
|
|
! stderr 'usage: go '
|
|
! stdout .
|
|
|
|
! garble help reverse
|
|
stderr 'garble \[garble flags\] reverse \[build flags\] package \[files\]'
|
|
! stderr 'usage: go '
|
|
! stdout .
|
|
|
|
! garble -badflag
|
|
stderr 'flag provided but not defined'
|
|
stderr 'garble \[garble flags\] command'
|
|
! stdout .
|
|
|
|
! garble badcmd
|
|
stderr 'unknown command'
|
|
|
|
! garble build -badflag
|
|
stderr 'usage: go build' # TODO: is this confusing?
|
|
! stdout .
|
|
|
|
! garble build -tiny
|
|
stderr 'must precede command, like: garble -tiny build \./pkg'
|
|
! stdout .
|
|
|
|
! garble build -literals
|
|
stderr 'must precede command, like: garble -literals build \./pkg'
|
|
! stdout .
|
|
|
|
! garble build -seed=random
|
|
stderr 'must precede command, like: garble -seed=random build \./pkg'
|
|
! stdout .
|
|
|
|
[!windows] ! garble /does/not/exist/compile
|
|
[windows] ! garble C:\does\not\exist\compile
|
|
stderr 'run "garble \[command\]"'
|
|
|
|
# Test the version command. Note that test binaries exclude VCS build info,
|
|
# and we reuse the test binary for garble itself, so that's missing.
|
|
# To avoid building another garble binary,
|
|
# and to be able to use static VCS info, use an environment variable.
|
|
# First, test without the information, and then with it.
|
|
#
|
|
# Note that Go 1.18.0 shipped with -buildvcs=true for "go test",
|
|
# so it's a special case that we need to handle until 1.18.1 is out.
|
|
garble version
|
|
stdout -count=1 'mvdan.cc/garble \(devel\)'
|
|
stdout -count=1 'Build settings'
|
|
stdout -count=3 '-compiler|GOOS|GOARCH'
|
|
[go1.19] ! stdout 'vcs'
|
|
|
|
# Obtained from a real build while developing.
|
|
env GARBLE_TEST_SETTINGS='[{"Key":"vcs","Value":"git"},{"Key":"vcs.revision","Value":"91ea246349544769f5100c29f79cb0f173abfeea"},{"Key":"vcs.time","Value":"2022-03-18T13:45:11Z"},{"Key":"vcs.modified","Value":"true"}]'
|
|
garble version
|
|
stdout -count=1 'mvdan\.cc/garble v0\.0\.0-20220318134511-91ea24634954'
|
|
stdout -count=1 'Build settings'
|
|
stdout -count=3 '-compiler|GOOS|GOARCH'
|
|
[go1.19] stdout -count=1 'vcs git'
|
|
[go1.19] stdout -count=1 'vcs\.revision 91ea246349544769f5100c29f79cb0f173abfeea'
|
|
[go1.19] stdout -count=1 'vcs\.time 2022-03-18T13:45:11Z'
|
|
[go1.19] stdout -count=1 'vcs\.modified true'
|
|
|
|
! garble version -flag
|
|
stderr 'usage: garble version'
|
|
|
|
! garble version arg
|
|
stderr 'usage: garble version'
|
|
|
|
# We need a dummy module for "garble build -badflag".
|
|
-- go.mod --
|
|
module dummy
|
|
-- dummy.go --
|
|
package dummy
|