blob: cccca6e2616c121561b9395943ac027e8f496fc3 [file] [log] [blame]
Chandler Carruth20e41292012-06-21 05:23:23 +00001add_custom_target(ClangUnitTests)
2set_target_properties(ClangUnitTests PROPERTIES FOLDER "Clang tests")
3
Chandler Carruthf96b9ce2012-06-21 02:04:39 +00004# add_clang_unittest(test_dirname file1.cpp file2.cpp)
Jeffrey Yasskinf91ae522011-02-19 18:06:01 +00005#
6# Will compile the list of files together and link against the clang
Chandler Carruthf96b9ce2012-06-21 02:04:39 +00007# Produces a binary named 'basename(test_dirname)'.
8function(add_clang_unittest test_dirname)
Chandler Carruth20e41292012-06-21 05:23:23 +00009 add_unittest(ClangUnitTests ${test_dirname} ${ARGN})
Jeffrey Yasskin718b01d2011-02-15 07:54:28 +000010endfunction()
11
Chandler Carruthf96b9ce2012-06-21 02:04:39 +000012add_clang_unittest(BasicTests
Zhanyong Wanc515d182011-02-16 05:45:20 +000013 Basic/FileManagerTest.cpp
Argyrios Kyrtzidisd7711ec2011-12-21 16:56:29 +000014 Basic/SourceManagerTest.cpp
Chandler Carruthf96b9ce2012-06-21 02:04:39 +000015 )
16target_link_libraries(BasicTests
17 clangLex
18 )
Zhanyong Wanc515d182011-02-16 05:45:20 +000019
Chandler Carruthf96b9ce2012-06-21 02:04:39 +000020add_clang_unittest(LexTests
Argyrios Kyrtzidis19d5aea2012-01-19 15:59:01 +000021 Lex/LexerTest.cpp
Chandler Carruthf96b9ce2012-06-21 02:04:39 +000022 )
23target_link_libraries(LexTests
24 clangLex
25 )
Argyrios Kyrtzidis19d5aea2012-01-19 15:59:01 +000026
Chandler Carruthf96b9ce2012-06-21 02:04:39 +000027add_clang_unittest(FrontendTests
Jeffrey Yasskin718b01d2011-02-15 07:54:28 +000028 Frontend/FrontendActionTest.cpp
Chandler Carruthf96b9ce2012-06-21 02:04:39 +000029 )
30target_link_libraries(FrontendTests
31 clangFrontend
32 )
Manuel Klimekcb971c62012-04-04 12:07:46 +000033
Chandler Carruthf96b9ce2012-06-21 02:04:39 +000034add_clang_unittest(ToolingTests
Manuel Klimekcb971c62012-04-04 12:07:46 +000035 Tooling/CompilationDatabaseTest.cpp
36 Tooling/ToolingTest.cpp
Manuel Klimekfad7f852012-04-19 08:48:53 +000037 Tooling/RecursiveASTVisitorTest.cpp
Manuel Klimekf9d4cbd2012-05-23 16:29:20 +000038 Tooling/RefactoringTest.cpp
Manuel Klimekbfbfee52012-05-22 17:01:35 +000039 Tooling/RewriterTest.cpp
Chandler Carruthf96b9ce2012-06-21 02:04:39 +000040 )
41target_link_libraries(ToolingTests
42 clangAST
43 clangTooling
44 clangRewrite
45 )