-
Notifications
You must be signed in to change notification settings - Fork 1.7k
C++: Turn header variant tests that use PCH files into integration tests #19410
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#include "a.h" | ||
#define FOUR 4 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
int main() { | ||
return ONE + FOUR; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#import "d.h" | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
int main() { | ||
return SEVENTEEN; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#if 1 | ||
#pragma hdrstop | ||
extern int x; | ||
#define SEEN_F | ||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#ifdef SEEN_F | ||
static int g() { | ||
return 20; | ||
} | ||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#include "h1.h" | ||
#pragma hdrstop | ||
#include "h2.h" | ||
#define SEEN_H |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import os | ||
|
||
|
||
def test(codeql, cpp): | ||
os.mkdir("pch") | ||
redsun82 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
extractor = cpp.get_tool("extractor") | ||
codeql.database.create(command=[ | ||
f'"{extractor}" --mimic-clang -emit-pch -o pch/a.pch a.c', | ||
f'"{extractor}" --mimic-clang -include-pch pch/a.pch -Iextra_dummy_path b.c', | ||
f'"{extractor}" --mimic-clang -include pch/a -Iextra_dummy_path c.c', | ||
f'"{extractor}" --mimic-clang -emit-pch -o pch/d.pch d.c', | ||
f'"{extractor}" --mimic-clang -include-pch pch/d.pch e.c', | ||
f'"{extractor}" --mimic-clang -emit-pch -o pch/f.pch f.c', | ||
f'"{extractor}" --mimic-clang -include-pch pch/f.pch g.c', | ||
f'"{extractor}" --mimic-clang -emit-pch -o pch/h.pch h.c', | ||
f'"{extractor}" --mimic-clang -include-pch pch/h.pch i.c', | ||
]) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include "a.h" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#pragma hdrstop | ||
#include "b.h" | ||
|
||
int b() { | ||
return A; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include "d.h" | ||
#include "c.h" | ||
|
||
int c() { | ||
return A; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import os | ||
|
||
|
||
def test(codeql, cpp): | ||
os.mkdir("pch") | ||
extractor = cpp.get_tool("extractor") | ||
codeql.database.create(command=[ | ||
f'"{extractor}" --mimic-cl /Yca.h /Fppch/a.pch a.c', | ||
f'"{extractor}" --mimic-cl /Yub.h /Fppch/a.pch b.c', | ||
f'"{extractor}" --mimic-cl /Yuc.h /Fppch/a.pch c.c', | ||
]) |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.