mirror of
https://github.com/rizsotto/scan-build.git
synced 2025-12-16 12:00:08 +01:00
try fix windows builds
This commit is contained in:
17
.github/workflows/python-package.yml
vendored
17
.github/workflows/python-package.yml
vendored
@@ -15,6 +15,11 @@ jobs:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
python-version: [3.7, 3.8, 3.9]
|
||||
exclude:
|
||||
- os: macos-latest
|
||||
python-version: 3.8
|
||||
- os: macos-latest
|
||||
python-version: 3.9
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@@ -22,6 +27,10 @@ jobs:
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install Clang (on Windows)
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
choco install llvm
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
@@ -35,7 +44,13 @@ jobs:
|
||||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||
- name: Test with nose
|
||||
run: |
|
||||
nosetests tests/unit --with-coverage --cover-branches
|
||||
nosetests tests/unit --verbose
|
||||
- name: Test with lit
|
||||
if: runner.os != 'Windows'
|
||||
run: |
|
||||
lit -v tests
|
||||
- name: Test with lit (on Windows)
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
pip install . --use-feature=in-tree-build
|
||||
lit -DUSE_INSTALLED=true -v tests
|
||||
|
||||
@@ -17,9 +17,6 @@ config.environment['test_input_dir'] = os.path.join(this_dir, 'Input')
|
||||
config.environment['CC'] = 'clang'
|
||||
config.environment['CXX'] = 'clang++'
|
||||
|
||||
# this hack is needed to run the right compiler on travis-ci
|
||||
clang=os.environ.get('TRAVIS_CLANG', 'clang')
|
||||
|
||||
ab = 'analyze-build'
|
||||
sb = 'scan-build'
|
||||
ib = 'intercept-build'
|
||||
@@ -33,28 +30,28 @@ if lit_config.params.get('USE_INSTALLED') is None:
|
||||
config.environment['PATH'] = os.pathsep.join([bin_dir, os.environ['PATH']])
|
||||
config.environment['PYTHONPATH'] = project_dir
|
||||
|
||||
# run with coverage if the tool is available
|
||||
if 'coverage' in config.available_features:
|
||||
rc_file=os.path.join(project_dir, '.coveragerc')
|
||||
config.environment['COVERAGE_PROCESS_START'] = rc_file
|
||||
# run with coverage if the tool is available
|
||||
if 'coverage' in config.available_features:
|
||||
rc_file=os.path.join(project_dir, '.coveragerc')
|
||||
config.environment['COVERAGE_PROCESS_START'] = rc_file
|
||||
|
||||
coverage = 'coverage run --rcfile={rc}'.format(rc=rc_file)
|
||||
ab = '{coverage} {path}'.format(
|
||||
coverage=coverage,
|
||||
path=os.path.join(bin_dir, 'analyze-build'))
|
||||
sb = '{coverage} {path}'.format(
|
||||
coverage=coverage,
|
||||
path=os.path.join(bin_dir, 'scan-build'))
|
||||
ib = '{coverage} {path}'.format(
|
||||
coverage=coverage,
|
||||
path=os.path.join(bin_dir, 'intercept-build'))
|
||||
coverage = 'coverage run --rcfile={rc}'.format(rc=rc_file)
|
||||
ab = '{coverage} {path}'.format(
|
||||
coverage=coverage,
|
||||
path=os.path.join(bin_dir, 'analyze-build'))
|
||||
sb = '{coverage} {path}'.format(
|
||||
coverage=coverage,
|
||||
path=os.path.join(bin_dir, 'scan-build'))
|
||||
ib = '{coverage} {path}'.format(
|
||||
coverage=coverage,
|
||||
path=os.path.join(bin_dir, 'intercept-build'))
|
||||
|
||||
config.substitutions.append(
|
||||
('%{analyze-build}',
|
||||
'{cmd} --use-analyzer={clang} -vvvv'.format(cmd=ab, clang=clang)))
|
||||
'{cmd} -vvvv'.format(cmd=ab)))
|
||||
config.substitutions.append(
|
||||
('%{scan-build}',
|
||||
'{cmd} --use-analyzer={clang} -vvvv'.format(cmd=sb, clang=clang)))
|
||||
'{cmd} -vvvv'.format(cmd=sb)))
|
||||
config.substitutions.append(
|
||||
('%{intercept-build}',
|
||||
'{cmd} -vvvv'.format(cmd=ib)))
|
||||
@@ -64,3 +61,9 @@ config.substitutions.append(
|
||||
config.substitutions.append(
|
||||
('%{expect}',
|
||||
'{python} {expect}'.format(python=sys.executable, expect=os.path.join(tool_dir, 'expect.py'))))
|
||||
|
||||
|
||||
print("lit.local.cfg config")
|
||||
print(config.substitutions)
|
||||
print(config.environment)
|
||||
print(config.available_features)
|
||||
|
||||
@@ -75,4 +75,10 @@ else:
|
||||
sys.path.append(project_dir)
|
||||
from libscanbuild.intercept import is_preload_disabled
|
||||
if not is_preload_disabled(sys.platform):
|
||||
config.available_features.add('preload')
|
||||
config.available_features.add('preload')
|
||||
|
||||
|
||||
print("lit.cfg config")
|
||||
print(config.substitutions)
|
||||
print(config.environment)
|
||||
print(config.available_features)
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# The LLVM Compiler Infrastructure
|
||||
#
|
||||
# This file is distributed under the University of Illinois Open Source
|
||||
# License. See LICENSE.TXT for details.
|
||||
|
||||
import os.path
|
||||
import lit.util
|
||||
|
||||
# test_source_root: The root path where tests are located.
|
||||
this_dir = os.path.dirname(__file__)
|
||||
parent_dir = os.path.dirname(this_dir)
|
||||
project_dir = os.path.dirname(parent_dir)
|
||||
|
||||
|
||||
config.environment['PYTHONPATH'] = project_dir
|
||||
@@ -1 +0,0 @@
|
||||
# RUN: %{python} -m unittest discover -v
|
||||
Reference in New Issue
Block a user