Skip to content

Commit 9d1ca1b

Browse files
andrurogerzcompnerd
authored andcommitted
add a test case that uses compilation database
1 parent df63759 commit 9d1ca1b

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

Tests/GlobalIncludes.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: rm -rf %t
2+
// RUN: mkdir %t
3+
// RUN: echo "[{\"directory\":\"%p\",\"command\":\"clang++ -c GlobalIncludes.cc -I%p/include\",\"file\":\"%t/GlobalIncludes.obj\"}]" | sed -e 's/\\/\\\\/g' > %t/compile_commands.json
4+
// RUN: %idt -p %t -export-macro IDT_TEST_ABI %s 2>&1 | %FileCheck %s
5+
#include <GlobalHeader.h>
6+
// CHECK: [[PATH:(.*[\\\/])?include[\\\/]GlobalHeader\.h]]:1:1: remark: unexported public interface 'globalFunction'
7+
8+
static void testFunction() {
9+
globalFunction();
10+
}

Tests/include/GlobalHeader.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
void globalFunction();

Tests/lit.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ if not use_lit_shell:
3939

4040
config.test_format = lit.formats.ShTest(execute_external = False)
4141

42-
config.suffixes = ['.hh']
42+
config.suffixes = ['.hh', '.cc']
4343
config.excludes = ['CMakeLists.txt']
4444

4545
config.test_source_root = os.path.join(ids_src_root, 'Tests')

0 commit comments

Comments
 (0)