mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Go: Run resolve build-environment in integration tests
This commit is contained in:
@@ -1,15 +1,22 @@
|
||||
import os
|
||||
from create_database_utils import *
|
||||
from diagnostics_test_utils import *
|
||||
from resolve_environment_utils import *
|
||||
|
||||
def go_integration_test(source = "src", db = "db", runFunction = runSuccessfully):
|
||||
def go_integration_test(toolchain=None, source = "src", db = "db", runFunction = runSuccessfully):
|
||||
# Set up a GOPATH relative to this test's root directory;
|
||||
# we set os.environ instead of using extra_env because we
|
||||
# need it to be set for the call to "go clean -modcache" later
|
||||
goPath = os.path.join(os.path.abspath(os.getcwd()), ".go")
|
||||
os.environ['GOPATH'] = goPath
|
||||
|
||||
extra_env = None
|
||||
|
||||
if toolchain != None:
|
||||
extra_env = { 'GOTOOLCHAIN': toolchain }
|
||||
|
||||
try:
|
||||
run_codeql_resolve_build_environment(lang="go", source=source, extra_env=extra_env)
|
||||
run_codeql_database_create([], lang="go", source=source, db=db, runFunction=runFunction)
|
||||
|
||||
check_diagnostics()
|
||||
|
||||
Reference in New Issue
Block a user