Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move test utilities to the query pack. #17968

Merged
merged 24 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
91cfb30
Java: Move test utilities to the java query pack.
michaelnebel Nov 12, 2024
0a1d2d0
Java: Update all test util paths to point to the new location.
michaelnebel Nov 12, 2024
8fbd4a2
C#: Move inline-tests into the utils test folder.
michaelnebel Nov 13, 2024
c7c3f6b
C#: Update inline-tests query paths.
michaelnebel Nov 13, 2024
c4b4be9
C#: Move test utilities into the query pack.
michaelnebel Nov 13, 2024
82f8a79
C#: Update all test util paths to point to the new location.
michaelnebel Nov 13, 2024
47813e1
C++: Move test utilities into the query pack.
michaelnebel Dec 11, 2024
12008b4
C++: Update all test util paths to point to the new location.
michaelnebel Dec 11, 2024
f8e0c47
Go: Move test utilities into the query pack.
michaelnebel Dec 11, 2024
96fe144
Go: Update all test util paths to point to the new location.
michaelnebel Dec 11, 2024
0f146f1
Javascript: Move test utilities into the query pack.
michaelnebel Dec 11, 2024
c3fe3e4
Javascript: Update all test util paths to point to the new location.
michaelnebel Dec 11, 2024
1490400
Python: Move test utilities into the query pack.
michaelnebel Dec 11, 2024
2321ca5
Python: Update all test util paths to point to the new location.
michaelnebel Dec 11, 2024
dd06d50
QL: Move test utilities into the src folder.
michaelnebel Dec 11, 2024
2ca6147
QL: Update all test util paths to point to the new location.
michaelnebel Dec 11, 2024
157afff
Ruby: Move test utilities into the query pack.
michaelnebel Dec 11, 2024
138e294
Ruby: Update all test util paths to point to the new location.
michaelnebel Dec 11, 2024
ca66153
Swift: Move test utilities into the query pack.
michaelnebel Dec 11, 2024
9ecacdd
Swift: Update all test util paths to point to the new location.
michaelnebel Dec 11, 2024
cbae2cf
Rust: Move test utilities into the query pack.
michaelnebel Dec 12, 2024
864c34f
Rust: Update all test util paths to point to the new location.
michaelnebel Dec 12, 2024
941b0ab
Move modules to the library packs.
michaelnebel Dec 12, 2024
0bfc1b6
Also move the postprocessing queries to the library pack.
michaelnebel Dec 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import cpp
private import semmle.code.cpp.ir.dataflow.DataFlow::DataFlow as IRDataFlow
private import semmle.code.cpp.dataflow.DataFlow::DataFlow as AstDataFlow
import TestUtilities.InlineExpectationsTest
import utils.test.InlineExpectationsTest

module IRFlowTest<IRDataFlow::GlobalFlowSig Flow> implements TestSig {
string getARelevantTag() { result = "ir" }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import cpp
import TestUtilities.InlineExpectationsTest
import utils.test.InlineExpectationsTest
import semmle.code.cpp.dataflow.new.DataFlow::DataFlow

bindingset[s]
Expand Down
2 changes: 1 addition & 1 deletion cpp/ql/test/library-tests/dataflow/asExpr/test.ql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import cpp
import TestUtilities.InlineExpectationsTest
import utils.test.InlineExpectationsTest
import semmle.code.cpp.dataflow.new.DataFlow::DataFlow

bindingset[s]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import TestUtilities.InlineExpectationsTest
import utils.test.InlineExpectationsTest
private import cpp
private import semmle.code.cpp.ir.dataflow.DataFlow
private import semmle.code.cpp.controlflow.IRGuards
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import TestUtilities.InlineExpectationsTest
import utils.test.InlineExpectationsTest
import cpp

module AstTest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import TestUtilities.InlineExpectationsTest
import utils.test.InlineExpectationsTest
import cpp

module AstTest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import TestBase
import TestUtilities.dataflow.FlowTestCommon
import utils.test.dataflow.FlowTestCommon
import MakeTest<MergeTests<AstFlowTest<AstTest::AstFlow>, IRFlowTest<IRTest::IRFlow>>>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import cpp
import semmle.code.cpp.dataflow.new.DataFlow
import TestUtilities.InlineExpectationsTest
import utils.test.InlineExpectationsTest

module TestConfig implements DataFlow::ConfigSig {
predicate isSource(DataFlow::Node source) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import cpp
import semmle.code.cpp.dataflow.new.DataFlow
import TestUtilities.InlineExpectationsTest
import utils.test.InlineExpectationsTest

module TestConfig implements DataFlow::ConfigSig {
predicate isSource(DataFlow::Node source) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import TestUtilities.InlineExpectationsTest
import utils.test.InlineExpectationsTest
import cpp

module AstTest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import TestUtilities.dataflow.FlowTestCommon
import utils.test.dataflow.FlowTestCommon
import cpp
import semmle.code.cpp.security.FlowSources
import IRTest::IRFlow::PathGraph
Expand Down
2 changes: 1 addition & 1 deletion cpp/ql/test/library-tests/dataflow/fields/flow.ql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import TestUtilities.dataflow.FlowTestCommon
import utils.test.dataflow.FlowTestCommon

module AstTest {
import ASTConfiguration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import TestUtilities.InlineExpectationsTest
import utils.test.InlineExpectationsTest
import testModels

module InterpretElementTest implements TestSig {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import TestUtilities.dataflow.FlowTestCommon
import utils.test.dataflow.FlowTestCommon
import testModels

module IRTest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import TestUtilities.dataflow.FlowTestCommon
import utils.test.dataflow.FlowTestCommon
import semmle.code.cpp.dataflow.new.DataFlow

module ParamConfig implements DataFlow::ConfigSig {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import TestUtilities.dataflow.FlowTestCommon
import utils.test.dataflow.FlowTestCommon

module AstTest {
private import semmle.code.cpp.dataflow.TaintTracking
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** This tests that we are able to detect local flow sources. */

import cpp
import TestUtilities.InlineExpectationsTest
import utils.test.InlineExpectationsTest
import semmle.code.cpp.security.FlowSources

module LocalFlowSourceTest implements TestSig {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** This tests that we are able to detect remote flow sources and sinks. */

import cpp
import TestUtilities.InlineExpectationsTest
import utils.test.InlineExpectationsTest
import semmle.code.cpp.security.FlowSources

module RemoteFlowSourceTest implements TestSig {
Expand Down
2 changes: 1 addition & 1 deletion cpp/ql/test/library-tests/dataflow/taint-tests/taint.ql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import TestUtilities.dataflow.FlowTestCommon
import utils.test.dataflow.FlowTestCommon

module TaintModels {
class SetMemberFunction extends TaintFunction {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import semmle.code.cpp.rangeanalysis.new.internal.semantic.analysis.RangeAnalysi
import semmle.code.cpp.rangeanalysis.new.internal.semantic.analysis.RangeAnalysisImpl
import semmle.code.cpp.rangeanalysis.new.internal.semantic.SemanticExprSpecific
import semmle.code.cpp.ir.IR as IR
import TestUtilities.InlineExpectationsTest
import utils.test.InlineExpectationsTest

module ModulusAnalysisInstantiated = ModulusAnalysis<SemLocation, Sem, FloatDelta, ConstantBounds>;

Expand Down
2 changes: 1 addition & 1 deletion cpp/ql/test/library-tests/ir/points_to/points_to.ql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import cpp
private import TestUtilities.InlineExpectationsTest
private import utils.test.InlineExpectationsTest
private import semmle.code.cpp.ir.internal.IntegerConstant as Ints

private predicate ignoreAllocation(string name) {
Expand Down
2 changes: 1 addition & 1 deletion cpp/ql/test/library-tests/ir/range-analysis/Overflow.ql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import cpp
import semmle.code.cpp.rangeanalysis.new.SimpleRangeAnalysis
import TestUtilities.InlineExpectationsTest
import utils.test.InlineExpectationsTest

module RangeAnalysisTest implements TestSig {
string getARelevantTag() { result = "overflow" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import semmle.code.cpp.rangeanalysis.new.internal.semantic.analysis.RangeAnalysi
import semmle.code.cpp.rangeanalysis.new.internal.semantic.Semantic
import semmle.code.cpp.rangeanalysis.new.internal.semantic.SemanticExprSpecific
import semmle.code.cpp.ir.IR as IR
import TestUtilities.InlineExpectationsTest
import utils.test.InlineExpectationsTest

module RangeAnalysisTest implements TestSig {
string getARelevantTag() { result = "range" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import semmle.code.cpp.rangeanalysis.new.internal.semantic.analysis.FloatDelta
import semmle.code.cpp.rangeanalysis.new.internal.semantic.analysis.RangeAnalysisRelativeSpecific
import semmle.code.cpp.rangeanalysis.new.internal.semantic.SemanticExprSpecific
import semmle.code.cpp.ir.IR as IR
import TestUtilities.InlineExpectationsTest
import utils.test.InlineExpectationsTest

module SignAnalysisInstantiated = SignAnalysis<FloatDelta>;

Expand Down
2 changes: 1 addition & 1 deletion cpp/ql/test/library-tests/ir/types/irtypes.ql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
private import cpp
private import semmle.code.cpp.ir.implementation.raw.IR
import TestUtilities.InlineExpectationsTest
import utils.test.InlineExpectationsTest

module IRTypesTest implements TestSig {
string getARelevantTag() { result = "irtype" }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
query: Critical/SizeCheck.ql
postprocess: TestUtilities/InlineExpectationsTestQuery.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
query: Security/CWE/CWE-022/TaintedPath.ql
postprocess: TestUtilities/InlineExpectationsTestQuery.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import cpp
import semmle.code.cpp.security.InvalidPointerDereference.AllocationToInvalidPointer
import TestUtilities.InlineExpectationsTest
import utils.test.InlineExpectationsTest
import semmle.code.cpp.ir.IR
import semmle.code.cpp.dataflow.new.DataFlow

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import cpp
import semmle.code.cpp.security.InvalidPointerDereference.InvalidPointerToDereference
import TestUtilities.InlineExpectationsTest
import utils.test.InlineExpectationsTest
import semmle.code.cpp.ir.IR
import semmle.code.cpp.dataflow.new.DataFlow

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
query: experimental/Security Features/CWE-759/HashWithoutSalt.ql
postprocess: TestUtilities/PrettyPrintModels.ql
postprocess: utils/test/PrettyPrintModels.ql
2 changes: 1 addition & 1 deletion csharp/ql/test/library-tests/dataflow/async/Async.ql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import csharp
import TestUtilities.ProvenancePathGraph::ShowProvenance<Taint::PathNode, Taint::PathGraph>
import utils.test.ProvenancePathGraph::ShowProvenance<Taint::PathNode, Taint::PathGraph>

class MySink extends DataFlow::ExprNode {
MySink() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class StringConstCompareBarrier extends DataFlow::Node {
}
}

import TestUtilities.InlineFlowTest
import utils.test.InlineFlowTest
import PathGraph

module FlowConfig implements DataFlow::ConfigSig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

import csharp
import TestUtilities.ProvenancePathGraph::ShowProvenance<ArrayFlow::PathNode, ArrayFlow::PathGraph>
import utils.test.ProvenancePathGraph::ShowProvenance<ArrayFlow::PathNode, ArrayFlow::PathGraph>

module ArrayFlowConfig implements DataFlow::ConfigSig {
predicate isSource(DataFlow::Node src) { src.asExpr() instanceof ObjectCreation }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

import csharp
import TestUtilities.InlineFlowTest
import utils.test.InlineFlowTest
import ValueFlowTest<DefaultFlowConfig>
import PathGraph

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import csharp
import semmle.code.csharp.dataflow.internal.ExternalFlow
import TestUtilities.ProvenancePathGraph::ShowProvenance<Taint::PathNode, Taint::PathGraph>
import utils.test.ProvenancePathGraph::ShowProvenance<Taint::PathNode, Taint::PathGraph>
import ModelValidation

module TaintConfig implements DataFlow::ConfigSig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

import csharp
import TestUtilities.InlineFlowTest
import utils.test.InlineFlowTest
import DefaultFlowTest
import PathGraph

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import csharp
import semmle.code.csharp.security.dataflow.flowsources.FlowSources
import TestUtilities.InlineFlowTest
import utils.test.InlineFlowTest
import TaintFlowTest<DatabaseConfig>

module DatabaseConfig implements DataFlow::ConfigSig {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import csharp
import semmle.code.csharp.security.dataflow.flowsources.FlowSources
import TestUtilities.InlineFlowTest
import utils.test.InlineFlowTest
import TaintFlowTest<FilesConfig>

module FilesConfig implements DataFlow::ConfigSig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import csharp
import Common
import TestUtilities.ProvenancePathGraph::ShowProvenance<Flow::PathNode, Flow::PathGraph>
import utils.test.ProvenancePathGraph::ShowProvenance<Flow::PathNode, Flow::PathGraph>

from Flow::PathNode source, Flow::PathNode sink, string s
where
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import csharp
import Common
import TestUtilities.ProvenancePathGraph::ShowProvenance<Taint::PathNode, Taint::PathGraph>
import utils.test.ProvenancePathGraph::ShowProvenance<Taint::PathNode, Taint::PathGraph>

module Taint = TaintTracking::Global<FlowConfig>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

import csharp
import TestUtilities.InlineFlowTest
import utils.test.InlineFlowTest
import DefaultFlowTest
import PathGraph

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

import csharp
import TestUtilities.InlineFlowTest
import utils.test.InlineFlowTest
import DefaultFlowTest
import PathGraph

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

import Test
import TestUtilities.ProvenancePathGraph::ShowProvenance<ThreatModel::PathNode, ThreatModel::PathGraph>
import utils.test.ProvenancePathGraph::ShowProvenance<ThreatModel::PathNode, ThreatModel::PathGraph>

from ThreatModel::PathNode source, ThreatModel::PathNode sink
where ThreatModel::flowPath(source, sink)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import Test
import TestUtilities.ProvenancePathGraph::ShowProvenance<ThreatModel::PathNode, ThreatModel::PathGraph>
import utils.test.ProvenancePathGraph::ShowProvenance<ThreatModel::PathNode, ThreatModel::PathGraph>

from ThreatModel::PathNode source, ThreatModel::PathNode sink
where ThreatModel::flowPath(source, sink)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import Test
import TestUtilities.ProvenancePathGraph::ShowProvenance<ThreatModel::PathNode, ThreatModel::PathGraph>
import utils.test.ProvenancePathGraph::ShowProvenance<ThreatModel::PathNode, ThreatModel::PathGraph>

from ThreatModel::PathNode source, ThreatModel::PathNode sink
where ThreatModel::flowPath(source, sink)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

import Test
import TestUtilities.ProvenancePathGraph::ShowProvenance<ThreatModel::PathNode, ThreatModel::PathGraph>
import utils.test.ProvenancePathGraph::ShowProvenance<ThreatModel::PathNode, ThreatModel::PathGraph>

from ThreatModel::PathNode source, ThreatModel::PathNode sink
where ThreatModel::flowPath(source, sink)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import Test
import TestUtilities.ProvenancePathGraph::ShowProvenance<ThreatModel::PathNode, ThreatModel::PathGraph>
import utils.test.ProvenancePathGraph::ShowProvenance<ThreatModel::PathNode, ThreatModel::PathGraph>

from ThreatModel::PathNode source, ThreatModel::PathNode sink
where ThreatModel::flowPath(source, sink)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import Test
import TestUtilities.ProvenancePathGraph::ShowProvenance<ThreatModel::PathNode, ThreatModel::PathGraph>
import utils.test.ProvenancePathGraph::ShowProvenance<ThreatModel::PathNode, ThreatModel::PathGraph>

from ThreatModel::PathNode source, ThreatModel::PathNode sink
where ThreatModel::flowPath(source, sink)
Expand Down
2 changes: 1 addition & 1 deletion csharp/ql/test/library-tests/dataflow/tuples/Tuples.ql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

import csharp
import TestUtilities.InlineFlowTest
import utils.test.InlineFlowTest
import DefaultFlowTest
import PathGraph

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

import csharp
import TestUtilities.InlineFlowTest
import utils.test.InlineFlowTest
import DefaultFlowTest
import PathGraph

Expand Down
Loading
Loading