Imported Upstream version 6.10.0.49

Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2020-01-16 16:38:04 +00:00
parent d94e79959b
commit 468663ddbb
48518 changed files with 2789335 additions and 61176 deletions

View File

@ -0,0 +1,2 @@
Utilities for the project that aren't intended to be part of a source
distribution.

View File

@ -0,0 +1,50 @@
#!/bin/sh
prog=$(basename $0)
# Expect to be run from the parent lit directory.
if [ ! -f setup.py ] || [ ! -d lit ]; then
printf 1>&2 "%s: expected to be run from base lit directory\n" "$prog"
exit 1
fi
# Parse command line arguments.
if [ "$1" = "--generate-html" ]; then
GENERATE_HTML=1
shift
fi
# If invoked with no arguments, run all the tests.
if [ $# = "0" ]; then
set -- "tests"
fi
# Check that the active python has been modified to enable coverage in its
# sitecustomize.
if ! python -c \
'import sitecustomize, sys; sys.exit("coverage" not in dir(sitecustomize))' \
>/dev/null 2>&1; then
printf 1>&2 "error: active python does not appear to enable coverage in its 'sitecustomize.py'\n"
exit 1
fi
# First, remove any existing coverage data files.
rm -f tests/.coverage
find tests -name .coverage.\* -exec rm {} \;
# Next, run the tests.
lit -sv --param check-coverage=1 "$@"
# Next, move all the data files from subdirectories up.
find tests/* -name .coverage.\* -exec mv {} tests \;
# Combine all the data files.
(cd tests && python -m coverage combine)
# Finally, generate the report.
(cd tests && python -m coverage report)
# Generate the HTML report, if requested.
if [ ! -z "$GENERATE_HTML" ]; then
(cd tests && python -m coverage html)
fi

View File

@ -0,0 +1,45 @@
#!/bin/sh
if [ $# = 1 ]; then
cd $1
fi
# Create a list of all the files in the source tree, excluding various things we
# know don't belong.
echo "Creating current directory contents list."
find . | \
grep -v '^\./.gitignore' | \
grep -v '^\./dist' | \
grep -v '^\./utils' | \
grep -v '^\./venv' | \
grep -v '^\./notes.txt' | \
grep -v '^\./lit.egg-info' | \
grep -v '^\./lit/ExampleTests' | \
grep -v '/Output' | \
grep -v '__pycache__' | \
grep -v '.pyc$' | grep -v '~$' | \
sort > /tmp/lit_source_files.txt
# Create the source distribution.
echo "Creating source distribution."
rm -rf lit.egg-info dist
python setup.py sdist > /tmp/lit_sdist_log.txt
# Creating list of files in source distribution.
echo "Creating source distribution file list."
tar zft dist/lit*.tar.gz | \
sed -e 's#lit-[0-9.dev]*/#./#' | \
sed -e 's#/$##' | \
grep -v '^\./PKG-INFO' | \
grep -v '^\./setup.cfg' | \
grep -v '^\./lit.egg-info' | \
sort > /tmp/lit_sdist_files.txt
# Diff the files.
echo "Running diff..."
if (diff /tmp/lit_source_files.txt /tmp/lit_sdist_files.txt); then
echo "Diff is clean!"
else
echo "error: there were differences in the source lists!"
exit 1
fi