diff --git a/go/ql/integration-tests/test-extraction-autobuild/test.py b/go/ql/integration-tests/test-extraction-autobuild/test.py deleted file mode 100644 index 0dc91b5212c5..000000000000 --- a/go/ql/integration-tests/test-extraction-autobuild/test.py +++ /dev/null @@ -1,4 +0,0 @@ -import os - -def test(codeql, go): - codeql.database.create(source_root="src", extractor_option = ["extract_tests=true"]) diff --git a/go/ql/integration-tests/test-extraction-traced/src/Makefile b/go/ql/integration-tests/test-extraction-traced/src/Makefile deleted file mode 100644 index 266e02877884..000000000000 --- a/go/ql/integration-tests/test-extraction-traced/src/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -all: - go get diff --git a/go/ql/integration-tests/test-extraction-traced/src/go.mod b/go/ql/integration-tests/test-extraction-traced/src/go.mod deleted file mode 100644 index c4a9f55df6c1..000000000000 --- a/go/ql/integration-tests/test-extraction-traced/src/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -go 1.14 - -module testsample diff --git a/go/ql/integration-tests/test-extraction-traced/src/go.sum b/go/ql/integration-tests/test-extraction-traced/src/go.sum deleted file mode 100644 index a8e1b59ae4b1..000000000000 --- a/go/ql/integration-tests/test-extraction-traced/src/go.sum +++ /dev/null @@ -1,45 +0,0 @@ -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/go/ql/integration-tests/test-extraction-traced/src/testme.go b/go/ql/integration-tests/test-extraction-traced/src/testme.go deleted file mode 100644 index e24138553ce9..000000000000 --- a/go/ql/integration-tests/test-extraction-traced/src/testme.go +++ /dev/null @@ -1,5 +0,0 @@ -package testsample - -func PublicFunction() int { return 1 } - -func privateFunction() int { return 2 } diff --git a/go/ql/integration-tests/test-extraction-traced/src/testme_blackbox_test.go b/go/ql/integration-tests/test-extraction-traced/src/testme_blackbox_test.go deleted file mode 100644 index 18a507b5aa38..000000000000 --- a/go/ql/integration-tests/test-extraction-traced/src/testme_blackbox_test.go +++ /dev/null @@ -1,15 +0,0 @@ -package testsample_test - -import ( - "testing" - "testsample" -) - -func TestTestMe(t *testing.T) { - - publicResult := testsample.PublicFunction() - if publicResult != 1 { - t.Errorf("Expected 1, got %d", publicResult) - } - -} diff --git a/go/ql/integration-tests/test-extraction-traced/src/testme_test.go b/go/ql/integration-tests/test-extraction-traced/src/testme_test.go deleted file mode 100644 index 183d7cd3dffe..000000000000 --- a/go/ql/integration-tests/test-extraction-traced/src/testme_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package testsample - -import ( - "testing" -) - -func TestTestMe(t *testing.T) { - - publicResult := PublicFunction() - if publicResult != 1 { - t.Errorf("Expected 1, got %d", publicResult) - } - - privateResult := privateFunction() - if privateResult != 2 { - t.Errorf("Expected 2, got %d", privateResult) - } - -} diff --git a/go/ql/integration-tests/test-extraction-traced/test.expected b/go/ql/integration-tests/test-extraction-traced/test.expected deleted file mode 100644 index 9e1585fc5ef8..000000000000 --- a/go/ql/integration-tests/test-extraction-traced/test.expected +++ /dev/null @@ -1,9 +0,0 @@ -#select -| src/testme.go:0:0:0:0 | src/testme.go | -| src/testme_blackbox_test.go:0:0:0:0 | src/testme_blackbox_test.go | -| src/testme_test.go:0:0:0:0 | src/testme_test.go | -calls -| src/testme_blackbox_test.go:10:18:10:44 | call to PublicFunction | src/testme.go:3:1:3:38 | function declaration | -| src/testme_test.go:9:18:9:33 | call to PublicFunction | src/testme.go:3:1:3:38 | function declaration | -| src/testme_test.go:14:19:14:35 | call to privateFunction | src/testme.go:5:1:5:39 | function declaration | -extractionErrors diff --git a/go/ql/integration-tests/test-extraction-traced/test.py b/go/ql/integration-tests/test-extraction-traced/test.py deleted file mode 100644 index 2887d3fa0d09..000000000000 --- a/go/ql/integration-tests/test-extraction-traced/test.py +++ /dev/null @@ -1,4 +0,0 @@ -import os - -def test(codeql, go): - codeql.database.create(source_root="src", command="go test -c") diff --git a/go/ql/integration-tests/test-extraction-traced/test.ql b/go/ql/integration-tests/test-extraction-traced/test.ql deleted file mode 100644 index 15eae8959862..000000000000 --- a/go/ql/integration-tests/test-extraction-traced/test.ql +++ /dev/null @@ -1,9 +0,0 @@ -import go -import semmle.go.DiagnosticsReporting - -from GoFile f -select f - -query predicate calls(CallExpr ce, FuncDecl f) { f = ce.getTarget().getFuncDecl() } - -query predicate extractionErrors(string msg, int sev) { reportableDiagnostics(_, msg, sev) } diff --git a/go/ql/integration-tests/test-extraction-autobuild/src/Makefile b/go/ql/integration-tests/test-extraction/src/Makefile similarity index 100% rename from go/ql/integration-tests/test-extraction-autobuild/src/Makefile rename to go/ql/integration-tests/test-extraction/src/Makefile diff --git a/go/ql/integration-tests/test-extraction-autobuild/src/go.mod b/go/ql/integration-tests/test-extraction/src/go.mod similarity index 100% rename from go/ql/integration-tests/test-extraction-autobuild/src/go.mod rename to go/ql/integration-tests/test-extraction/src/go.mod diff --git a/go/ql/integration-tests/test-extraction-autobuild/src/go.sum b/go/ql/integration-tests/test-extraction/src/go.sum similarity index 100% rename from go/ql/integration-tests/test-extraction-autobuild/src/go.sum rename to go/ql/integration-tests/test-extraction/src/go.sum diff --git a/go/ql/integration-tests/test-extraction-autobuild/src/testme.go b/go/ql/integration-tests/test-extraction/src/testme.go similarity index 100% rename from go/ql/integration-tests/test-extraction-autobuild/src/testme.go rename to go/ql/integration-tests/test-extraction/src/testme.go diff --git a/go/ql/integration-tests/test-extraction-autobuild/src/testme_blackbox_test.go b/go/ql/integration-tests/test-extraction/src/testme_blackbox_test.go similarity index 100% rename from go/ql/integration-tests/test-extraction-autobuild/src/testme_blackbox_test.go rename to go/ql/integration-tests/test-extraction/src/testme_blackbox_test.go diff --git a/go/ql/integration-tests/test-extraction-autobuild/src/testme_test.go b/go/ql/integration-tests/test-extraction/src/testme_test.go similarity index 100% rename from go/ql/integration-tests/test-extraction-autobuild/src/testme_test.go rename to go/ql/integration-tests/test-extraction/src/testme_test.go diff --git a/go/ql/integration-tests/test-extraction-autobuild/test.expected b/go/ql/integration-tests/test-extraction/test.expected similarity index 100% rename from go/ql/integration-tests/test-extraction-autobuild/test.expected rename to go/ql/integration-tests/test-extraction/test.expected diff --git a/go/ql/integration-tests/test-extraction/test.py b/go/ql/integration-tests/test-extraction/test.py new file mode 100644 index 000000000000..6419ae83f38c --- /dev/null +++ b/go/ql/integration-tests/test-extraction/test.py @@ -0,0 +1,7 @@ +import os + +def test_traced(codeql, go): + codeql.database.create(source_root="src", command="go test -c") + +def test_autobuild(codeql, go): + codeql.database.create(source_root="src", extractor_option = ["extract_tests=true"]) diff --git a/go/ql/integration-tests/test-extraction-autobuild/test.ql b/go/ql/integration-tests/test-extraction/test.ql similarity index 100% rename from go/ql/integration-tests/test-extraction-autobuild/test.ql rename to go/ql/integration-tests/test-extraction/test.ql