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.
With the many refactors building up to v0.1.0, we broke "garble test" as we no longer dealt with test packages well. Luckily, now that we can depend on TOOLEXEC_IMPORTPATH, we can support the test command again, as we can always figure out what package we're currently compiling, without having to track a "main" package. Note that one major pitfall there is test packages, where TOOLEXEC_IMPORTPATH does not agree with ImportPath from "go list -json". However, we can still work around that with a bit of glue code, which is also copiously documented. The second change necessary is to consider test packages private depending on whether their non-test package is private or not. This can be done via the ForTest field in "go list -json". The third change is to obfuscate "_testmain.go" files, which are the code-generated main functions which actually run tests. We used to not need to obfuscate them, since test function names are never obfuscated and we used to not obfuscate import paths at compilation time. Now we do rewrite import paths, so we must do that for "_testmain.go" too. The fourth change is to re-enable test.txt, and expand it with more sanity checks and edge cases. Finally, document "garble test" again. Fixes #241. |
5 years ago | |
|---|---|---|
| .. | ||
| bench | 6 years ago | |
| mod | 5 years ago | |
| scripts | 5 years ago | |