tests/thirdparty: package metadata (#223)

Fetches third-party package metadata from Github.
This commit is contained in:
Michael McLoughlin
2021-11-07 16:13:33 -08:00
committed by GitHub
parent afe2d539b8
commit f355d27b13
9 changed files with 544 additions and 24 deletions

View File

@@ -2,6 +2,7 @@
package test
import (
"flag"
"io"
"io/ioutil"
"log"
@@ -12,6 +13,17 @@ import (
"testing"
)
var network = flag.Bool("net", false, "allow network access")
// RequiresNetwork declares that a test requires network access. The test is
// skipped if network access isn't enabled with the -net flag.
func RequiresNetwork(t *testing.T) {
t.Helper()
if !*network {
t.Skip("requires network: enable with -net flag")
}
}
// Assembles asserts that the given assembly code passes the go assembler.
func Assembles(t *testing.T, asm []byte) {
t.Helper()