Compare commits

...
4 Commits
2 changed files with 30 additions and 22 deletions
+30 -20
View File
@@ -1,5 +1,9 @@
language: cpp
os:
- linux
- freebsd
# use Ubuntu 20.04 (Focal Fossa) that defaults to Python 3
dist: focal
@@ -10,25 +14,35 @@ compiler:
- gcc
- clang
# preinstalled packages
addons:
apt:
packages:
- bison
- python3-docutils
before_install:
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then apt install bison python3-docutils ; fi
- if [ "$TRAVIS_OS_NAME" = "freebsd" ]; then pkg install textproc/py-docutils; fi
# configurations: cmake/autotools, in-tree/out-of-tree, release/debug, etc.
env:
- CMAKE=no BUILD_DIR=. CONFIG_DIR=. COMMON_FLAGS="-O2 -g"
- CMAKE=no BUILD_DIR=.build CONFIG_DIR=.. CONFIG_FLAGS="--enable-debug" COMMON_FLAGS="-O2 -g"
- CMAKE=yes BUILD_DIR=. CONFIG_DIR=. BUILD_TYPE=Debug COMMON_FLAGS="-O2 -g"
- CMAKE=yes BUILD_DIR=.build CONFIG_DIR=.. BUILD_TYPE=Debug COMMON_FLAGS="-O2 -g" SKELETON=yes
- CMAKE=no BUILD_DIR=. CONFIG_DIR=. COMMON_FLAGS="-O2 -g"
- CMAKE=no BUILD_DIR=.build CONFIG_DIR=.. COMMON_FLAGS="-O2 -g"
- CMAKE=yes BUILD_DIR=. CONFIG_DIR=. BUILD_TYPE=Debug
- CMAKE=yes BUILD_DIR=.build CONFIG_DIR=.. BUILD_TYPE=Release
- CMAKE=yes BUILD_DIR=.build CONFIG_DIR=.. BUILD_TYPE=Debug COMMON_FLAGS="-O2 -g -fsanitize=address"
- CMAKE=yes BUILD_DIR=.build CONFIG_DIR=.. BUILD_TYPE=Debug COMMON_FLAGS="-O2 -g -fsanitize=undefined"
- CMAKE=yes BUILD_DIR=. CONFIG_DIR=. BUILD_TYPE=Asan
- CMAKE=yes BUILD_DIR=.build CONFIG_DIR=.. BUILD_TYPE=Ubsan
jobs:
exclude:
- os: freebsd
env: BUILD_TYPE=Asan
- os: freebsd
env: BUILD_TYPE=Ubsan
script:
- |
function ncpus() {
if [ "$TRAVIS_OS_NAME" = "freebsd" ]; then
sysctl -n hw.ncpu
else
nproc
fi
}
function run_cmake() {
cmake \
-B . -S ${CONFIG_DIR} \
@@ -41,7 +55,6 @@ script:
}
function run_configure() {
${CONFIG_DIR}/configure \
${CONFIG_FLAGS} \
CFLAGS="${COMMON_FLAGS}" \
CXXFLAGS="${COMMON_FLAGS}" \
LDFLAGS="${COMMON_FLAGS}" \
@@ -56,7 +69,7 @@ script:
mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
run_configure --prefix="$(pwd)/install"
fi
- make -j$(nproc)
- make -j$(ncpus)
- make install
- |
if [ x${CMAKE} = "xyes" ]; then
@@ -75,10 +88,7 @@ script:
RE2C_FOR_BUILD="$(pwd)/install/bin/re2c"
fi
- find ${CONFIG_DIR}/src -name '*.re' | xargs touch
- make -j$(nproc)
- make -j$(ncpus)
- |
if [ x${SKELETON} = "xyes" ]; then
./run_tests.py --skeleton
else
make -j$(nproc) check VERBOSE=1
fi
make -j$(ncpus) check VERBOSE=1
./run_tests.py --skeleton
-2
View File
@@ -12,7 +12,6 @@ import signal
import subprocess
import sys
import textwrap as _textwrap
from dataclasses import dataclass
from datetime import datetime
from functools import cmp_to_key
from pathlib import Path
@@ -40,7 +39,6 @@ FILEPATH_CONTEXT_PATTERN = re.compile(b'('
+ b')')
@dataclass
class Context:
"""Class for passing a context to parallel processes."""