File: lit.cfg

package info (click to toggle)
webkit2gtk 2.48.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 429,764 kB
  • sloc: cpp: 3,697,587; javascript: 194,444; ansic: 169,997; python: 46,499; asm: 19,295; ruby: 18,528; perl: 16,602; xml: 4,650; yacc: 2,360; sh: 2,098; java: 1,993; lex: 1,327; pascal: 366; makefile: 298
file content (42 lines) | stat: -rw-r--r-- 1,388 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# vi: ft=python

import lit.formats
import os
import site
import sys

current_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(current_dir, '..', '..', '..', '..', 'Tools', 'Scripts'))

from webkitpy.common.host import Host

host = Host()
port = host.port_factory.get()
wgslc = port._build_path('wgslc')

config.name = 'WGSL'
config.suffixes = ['.wgsl']
config.test_format = lit.formats.ShTest(True)
config.test_exec_root = os.environ['LIT_TEST_DIR']
config.environment['DYLD_FRAMEWORK_PATH'] = port._build_path()

# FIXME: fix these so this list is empty
ignored_warnings = [
    '-Wno-unused-variable',
    '-Wno-unused-function',
    '-Wno-missing-braces',
    '-Wno-c++17-extensions',
    '-Wno-parentheses-equality'
]

config.substitutions.append(('%check', '{}/bin/OutputCheck --comment=".*//" %s'.format(site.getuserbase())))
config.substitutions.append(('%wgslc', '{} %s _ 2>&1'.format(wgslc)))
config.substitutions.append(('%not', 'eval !'))
config.substitutions.append(('%metal-compile', (
    "function metal_compile() {"
    "     set -e -o pipefail;"
    f"    {wgslc} --dump-generated-code '%s' \"$1\" > '%t.metal' || exit 1;"
    f"    xcrun -sdk macosx metal -Werror {' '.join(ignored_warnings)} -c '%t.metal' -o /dev/null;"
    "};"
    "metal_compile ")))
config.substitutions.append(('%metal', '{} --dump-generated-code %s'.format(wgslc)))