forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathConfigurationTestFile.qll
More file actions
44 lines (40 loc) · 1.17 KB
/
ConfigurationTestFile.qll
File metadata and controls
44 lines (40 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* Provides classes for identifying files that created to test the
* build configuration. It is often desirable to exclude these files
* from analysis.
*/
import File
/**
* A file created to test the system configuration.
*/
abstract class ConfigurationTestFile extends File { }
/**
* A file created by CMake to test the system configuration.
*/
class CmakeTryCompileFile extends ConfigurationTestFile {
CmakeTryCompileFile() {
exists(Folder folder, Folder parent |
folder = this.getParentContainer() and
parent = folder.getParentContainer()
|
folder.getBaseName().matches("TryCompile-%") and
parent.getBaseName() = "CMakeScratch" and
parent.getParentContainer().getBaseName() = "CMakeFiles"
)
}
}
/**
* A file created by Meson to test the system configuration.
*/
class MesonPrivateTestFile extends ConfigurationTestFile {
MesonPrivateTestFile() {
this.getBaseName() = "testfile.c" and
exists(Folder folder, Folder parent |
folder = this.getParentContainer() and
parent = folder.getParentContainer()
|
folder.getBaseName().matches("tmp%") and
parent.getBaseName() = "meson-private"
)
}
}