1 # -*- Python -*- vim: set ft=python ts=4 sw=4 expandtab tw=79:
2 # Configuration file for the 'lit' test runner.
9 # Tell pylint that we know config and lit_config exist somewhere.
10 if 'PYLINT_IMPORT' in os.environ:
14 def append_dynamic_library_path(path):
15 if config.operating_system == 'Windows':
18 elif config.operating_system == 'Darwin':
19 name = 'DYLD_LIBRARY_PATH'
22 name = 'LD_LIBRARY_PATH'
24 if name in config.environment:
25 config.environment[name] = path + sep + config.environment[name]
27 config.environment[name] = path
28 # config.environment['PYTHONPATH'] = config.ompd_module + sep + config.environment['PYTHON_PATH']
30 # name: The name of this test suite.
31 config.name = 'ompd-test'
33 # suffixes: A list of file extensions to treat as test files.
34 config.suffixes = ['.c']
36 # test_source_root: The root path where tests are located.
37 #config.test_source_root = os.path.dirname(__file__)
38 config.test_source_root = config.ompd_test_src
40 # test_exec_root: The root object directory where output is placed
41 config.test_exec_root = config.ompd_obj_root
44 config.test_format = lit.formats.ShTest()
47 config.test_flags = " -I " + config.test_source_root + " -I " + config.ompt_include_dir + \
48 " " + config.test_extra_flags + " -L " + config.library_dir
50 append_dynamic_library_path(config.library_dir)
51 append_dynamic_library_path(config.ompd_library_dir)
53 # Disable OMPT tests if FileCheck was not found
54 if config.test_filecheck == "":
55 lit_config.note("Not testing OMPT_OMPD because FileCheck was not found")
57 if 'Linux' in config.operating_system:
58 config.available_features.add("linux")
60 # to run with icc INTEL_LICENSE_FILE must be set
61 if 'INTEL_LICENSE_FILE' in os.environ:
62 config.environment['INTEL_LICENSE_FILE'] = os.environ['INTEL_LICENSE_FILE']
63 if 'OMP_NUM_THREADS' in os.environ:
64 config.environment['OMP_NUM_THREADS'] = os.environ['OMP_NUM_THREADS']
65 #config.environment['ompd'] = "/home/gu620893/LLVM-openmp-master/install/"
67 config.substitutions.append(("%gdb-compile-and-run", "%gdb-compile && %gdb-run"))
69 config.substitutions.append(("%gdb-compile",
70 "%test_c_compiler -fopenmp -g -gdwarf-4 %s -o %t " + config.test_flags))
71 config.substitutions.append(("%test_c_compiler", config.test_c_compiler))
72 config.substitutions.append(("%gdb-run",
73 "env OMP_DEBUG=enabled gdb -x " + config.ompd_obj_root + "/../gdb-plugin/python-module/ompd/__init__.py -x " \
74 + config.ompd_test_src + "/test.cmd %t "))
76 config.substitutions.append(("%gdb-test",
77 "env OMP_DEBUG=enabled gdb -x " + config.ompd_obj_root + "/../gdb-plugin/python-module/ompd/__init__.py "))
79 config.substitutions.append(("%ompt-tool",
82 config.substitutions.append(("FileCheck", config.test_filecheck))