Daniel Martí
b8aec97e86
don't garble any embedded fields
...
In the added test case, we'd see a failure, since we garbled the name of
the "Embedded" type but not its use as an anonymous field. Garble both.
This might possibly break some reflect code, but it doesn't seem like we
have an option. When we garble a type, it's impossible to tell if it's
going to be used as an anonymous field later.
Updates #9 .
5 years ago
Daniel Martí
302cc137b6
test that filenames are garbled
...
We've done this for a while, but we weren't testing it.
Fixes #1 .
5 years ago
Daniel Martí
308e984293
don't use regexes when searching binaries for strings
...
This is a bit simpler, and saves us a small amount of CPU work in the
tests.
5 years ago
Daniel Martí
4d5ad43f10
allow garble to test itself
...
With this patch, 'go install && garble test' works.
5 years ago
Daniel Martí
1ce5310440
don't garble exported struct fields
...
They might reasonably affect the behavior of the code, such as when
encoding/json is used without tags.
5 years ago
Daniel Martí
ce0137fa6a
don't break TestMain funcs
...
Important for 'garble test', if a package uses one.
5 years ago
Daniel Martí
5ccf56662a
don't panic with struct pointer anonymous fields
...
While at it, make the "object of type" code shared and more robust.
5 years ago
Daniel Martí
2067ad57aa
ensure that tests with separate packages work
5 years ago
Daniel Martí
30524ea282
shorten 'go test -short' run time
...
Down from ~11s to ~7s, as we can skip some extra checks.
While at it, avoid duplicate 'go test' builds in test.txt.
5 years ago
Daniel Martí
9cf7df925d
make "no such file" test pass on Windows
5 years ago
Daniel Martí
bee30aff41
add initial support for running tests
...
For now, it mainly consists of not garbling Test* funcs, and not
garbling the _testmain.go file that will run them.
Updates #6 .
5 years ago
Daniel Martí
5556be7402
make the tool work on Windows, enable tests
...
The tests required a few last tweaks to work on Windows.
5 years ago
Daniel Martí
0058dfc12a
make output binaries deterministic
...
We were leaking temporary file paths, which is no longer the case.
5 years ago
Daniel Martí
ab560ff007
start testing on GitHub Actions
...
No windows yet, because a few portability issues remain.
5 years ago
Daniel Martí
e08dd99c1e
introduce a binary grep command for the tests
...
The problem with the "grep" built-in command is that it prints the
entire data if there is an error. We don't want megabytes of binary
output for a test.
5 years ago
Daniel Martí
63cbc01628
support anonymous fields better
5 years ago
Daniel Martí
a87002e662
don't break types implementing interfaces
5 years ago
Daniel Martí
3f35fb07f2
remove module info from the resulting binary
5 years ago
Daniel Martí
aba66758ca
support type switches with symbolic vars
5 years ago
Daniel Martí
766bb47b82
support std imports
5 years ago
Daniel Martí
1fe0351517
garbling imported packages starts being supported
5 years ago
Daniel Martí
764af03e89
introduce 'garble build' shortcut
...
This way, the user doesn't need to remember to use flags like -a and
-trimpath. Also because we might need more 'go build' flags in the
future.
5 years ago
Daniel Martí
63f58242fb
move garble binary setup with $PATH to Setup
...
This way, it's ready for multiple scripts.
5 years ago
Daniel Martí
8119fa0e62
use readelf in a way that it prints less output
5 years ago
Daniel Martí
f4e356ab13
start hashing identifiers
5 years ago
Daniel Martí
f47c12caba
add a bit more docs
5 years ago
Daniel Martí
a670f80fe9
error if the user forgot -trimpath
5 years ago
Daniel Martí
f81b92a0fa
start enforcing the link flags -w -s
5 years ago
Daniel Martí
f5f72ef626
initial commit
5 years ago