2021-03-29 15:08:47 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
|
|
|
cd $DIR
|
|
|
|
|
|
|
|
rm -rf testdb
|
|
|
|
|
|
|
|
codeql database create --language=go testdb --search-path ..
|
2021-03-31 13:14:55 +03:00
|
|
|
codeql dataset check testdb/db-go
|
2021-03-29 15:08:47 +03:00
|
|
|
codeql query run ../ql/test/library-tests/semmle/go/controlflow/ControlFlowGraph/ControlFlowNode_getASuccessor.ql --database=testdb --output=notracing-out.bqrs --search-path ..
|
|
|
|
codeql bqrs decode notracing-out.bqrs --format=csv --output=notracing-out.csv
|
2021-03-31 18:12:19 +03:00
|
|
|
diff -w -u <(sort notracing-out.csv) expected.csv
|
2021-03-29 15:08:47 +03:00
|
|
|
|
|
|
|
# Now do it again with tracing enabled
|
|
|
|
|
|
|
|
export CODEQL_EXTRACTOR_GO_BUILD_TRACING=on
|
|
|
|
|
|
|
|
rm -rf testdb
|
|
|
|
|
|
|
|
codeql database create --language=go testdb --search-path ..
|
2021-03-31 13:14:55 +03:00
|
|
|
codeql dataset check testdb/db-go
|
2021-03-29 15:08:47 +03:00
|
|
|
codeql query run ../ql/test/library-tests/semmle/go/controlflow/ControlFlowGraph/ControlFlowNode_getASuccessor.ql --database=testdb --output=tracing-out.bqrs --search-path ..
|
|
|
|
codeql bqrs decode tracing-out.bqrs --format=csv --output=tracing-out.csv
|
2021-03-31 18:12:19 +03:00
|
|
|
diff -w -u <(sort tracing-out.csv) expected.csv
|