2222import glob
2323from common .base import TestBase
2424
25- BAZEL_BIN_DIR = os .path .join ("../../.." , "bazel-bin" , "test" ,
26- "unit" , "virtual_include" )
27- BAZEL_TESTLOGS_DIR = os .path .join ("../../.." , "bazel-testlogs" , "test" ,
28- "unit" , "virtual_include" )
25+ BAZEL_BIN_DIR = os .path .join ("../../.." , "bazel-bin" , "test" , "unit" , "virtual_include" )
26+ BAZEL_TESTLOGS_DIR = os .path .join (
27+ "../../.." , "bazel-testlogs" , "test" , "unit" , "virtual_include"
28+ )
29+
2930
3031class TestVirtualInclude (TestBase ):
3132 """Tests checking virtual include path resolution"""
32- # This line is mandatory
33+
34+ # This line is mandatory
3335 __test_path__ = os .path .dirname (os .path .abspath (__file__ ))
3436
3537 def setUp (self ):
@@ -39,16 +41,27 @@ def setUp(self):
3941
4042 def test_bazel_plist_path_resolved (self ):
4143 """Test: bazel build :codechecker_virtual_include"""
42- self .check_command ("bazel build //test/unit/virtual_include:codechecker_virtual_include" , exit_code = 0 )
43- self .check_command ("bazel build //test/unit/virtual_include:code_checker_virtual_include" , exit_code = 0 )
44- plist_files = glob .glob (os .path .join (BAZEL_BIN_DIR , "**" , "*.plist" ), recursive = True )
44+ self .check_command (
45+ "bazel build //test/unit/virtual_include:codechecker_virtual_include" ,
46+ exit_code = 0 ,
47+ )
48+ self .check_command (
49+ "bazel build //test/unit/virtual_include:code_checker_virtual_include" ,
50+ exit_code = 0 ,
51+ )
52+ plist_files = glob .glob (
53+ os .path .join (BAZEL_BIN_DIR , "**" , "*.plist" ), recursive = True
54+ )
4555 self .assertTrue (os .path .isdir (f"{ BAZEL_BIN_DIR } /_virtual_includes" ))
4656 for plist_file in plist_files :
4757 logging .debug (f"Checking file: { plist_file } " )
48- with open (plist_file , "r" ) as f :
58+ with open (plist_file , "r" ) as f :
4959 content = f .read ()
5060 if re .search (r"/_virtual_includes/" , content ):
51- self .fail (f"Found unresolved symlink within CodeChecker report: { plist_file } " )
61+ self .fail (
62+ f"Found unresolved symlink within CodeChecker report: { plist_file } "
63+ )
64+
5265
5366if __name__ == "__main__" :
54- unittest .main (buffer = True )
67+ unittest .main (buffer = True )
0 commit comments