Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ end_of_line = crlf
insert_final_newline = false
trim_trailing_whitespace = false

[testdata/test{input,output}{1,2,3,3A,3B,3C,6,28,29}]
[testdata/test{input,output}{1,2,3,3A,3B,3C,3D,3E,6,28,29}]
charset = latin1
8 changes: 7 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# Rather than forcing everything to check out with 'correct' (LF) line-endings
# on Windows, we currently take the approach of forcing only the files which
# are binary-like and positively do not work if incorrectly converted.

testdata/* -text
maint/manifest-* -text
maint/ucptestdata -text
*.patch -text
*.sh text eol=lf
*.patch text eol=lf
*.py text eol=lf
*.bat text eol=crlf
pcre2-config.in text eol=lf
RunTest text eol=lf
RunGrepTest text eol=lf
22 changes: 21 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ env:
CFLAGS_GCC_STYLE: '-Wall -Wextra -pedantic -Wdeclaration-after-statement -Wshadow -Wno-overlength-strings -Wimplicit-fallthrough'
CFLAGS_MSVC: '/W3'
CFLAGS_SOLARIS_CC: '-errtags=yes -erroff=E_STATEMENT_NOT_REACHED'
# For CMake 4.4 we could use (stronger): -Werror=author -Werror=uninitialized -Werror=unused-cli
# It's not available in the CI runners yet.
CMAKE_FLAGS: '-Wdev -Werror=dev -Wdeprecated -Werror=deprecated --warn-uninitialized'

jobs:
Expand Down Expand Up @@ -70,6 +72,12 @@ jobs:
- name: Test (pcre2posix program)
run: ./pcre2posix_test -v

- name: Test (Python main test script)
run: python3 ./RunTest.py

- name: Test (Python pcre2grep test script)
run: python3 ./RunGrepTest.py

- name: Install
run: |
make install "DESTDIR=`pwd`/install-dir"
Expand All @@ -83,7 +91,7 @@ jobs:
if: github.event_name != 'workflow_dispatch' || (inputs.job_id == 'all' || inputs.job_id == 'alpine')
steps:
- name: Setup
run: apk add --no-cache automake autoconf gcc libtool make musl-dev git zlib zlib-dev bzip2 bzip2-dev
run: apk add --no-cache automake autoconf gcc libtool make musl-dev git zlib zlib-dev bzip2 bzip2-dev python3

- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down Expand Up @@ -111,6 +119,12 @@ jobs:
- name: Test (pcre2posix program)
run: ./pcre2posix_test -v

- name: Test (Python main test script)
run: python3 ./RunTest.py

- name: Test (Python pcre2grep test script)
run: python3 ./RunGrepTest.py

- name: Install
run: |
make install "DESTDIR=`pwd`/install-dir"
Expand All @@ -136,6 +150,12 @@ jobs:
- name: Test
run: cd build && ctest -j$(sysctl -n hw.ncpu) --output-on-failure && (cat ./Testing/Temporary/LastTest.log || true)

- name: Test (shell scripts)
run: |
cd build
../RunTest --srcdir .. --pcre2test "`pwd`/pcre2test"
../RunGrepTest --srcdir .. --pcre2test "`pwd`/pcre2test" --pcre2grep "`pwd`/pcre2grep"

- name: Install
run: |
cd build
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ jobs:

- name: Test
run: |
srcdir=`pwd` pcre2test=`pwd`/zig-out/bin/pcre2test ./RunTest -bigstack
./RunTest --bigstack --srcdir "`pwd`" --pcre2test "`pwd`/zig-out/bin/pcre2test"

bee:
# Tests with: Bazel build system. A bee goes "buzz buzz buzz(el)".
Expand All @@ -664,7 +664,7 @@ jobs:
submodules: true

- name: Build
run: bazelisk build //... --enable_runfiles --incompatible_strict_action_env
run: bazelisk build //...

- name: Test
run: bazelisk test //... --enable_runfiles --incompatible_strict_action_env --test_output=all
run: bazelisk test //... --test_output=all
41 changes: 24 additions & 17 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
load("@bazel_skylib//rules:native_binary.bzl", "native_test")
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
load("@rules_python//python:defs.bzl", "py_test")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")

# We use `buildifier` for auto-formatting our Bazel files.
# Applied to all Bazel files using:
# > buildifier --lint=warn *.bazel

copy_file(
name = "config_h_generic",
Expand Down Expand Up @@ -94,15 +99,15 @@ cc_library(
":pcre2_chartables_c",
],
hdrs = [":pcre2_h_generic"],
implementation_deps = [":pcre2_internal_headers"],
defines = [
"PCRE2_STATIC",
],
implementation_deps = [":pcre2_internal_headers"],
linkstatic = True,
local_defines = LOCAL_DEFINES + [
"PCRE2_CODE_UNIT_WIDTH=8",
],
strip_include_prefix = "src",
linkstatic = True,
visibility = ["//visibility:public"],
)

Expand All @@ -126,11 +131,11 @@ cc_library(
":pcre2_internal_headers",
":pcre2posix_dotc_headers",
],
linkstatic = True,
local_defines = LOCAL_DEFINES + [
"PCRE2_CODE_UNIT_WIDTH=8",
],
strip_include_prefix = "src",
linkstatic = True,
visibility = ["//visibility:public"],
deps = [
":pcre2",
Expand All @@ -150,7 +155,6 @@ cc_library(
cc_library(
name = "pcre2test_dotc_headers",
hdrs = [
"src/pcre2_chkdint.c",
"src/pcre2_tables.c",
"src/pcre2_ucd.c",
"src/pcre2_valid_utf.c",
Expand All @@ -176,24 +180,27 @@ cc_binary(
],
)

filegroup(
name = "testdata",
pkg_tar(
name = "testdata_tar",
srcs = glob(["testdata/*"]),
strip_prefix = ".",
)

native_test(
py_test(
name = "pcre2_test",
size = "small",
src = select({
"@platforms//os:windows": "RunTest.bat",
"//conditions:default": "RunTest",
}),
out = select({
"@platforms//os:windows": "RunTest.bat",
"//conditions:default": "RunTest",
}),
srcs = ["RunTest.py"],
args = [
"--bazel-runfiles",
"--testdatatar",
"$(rlocationpath :testdata_tar)",
"--pcre2test",
"$(rlocationpath :pcre2test)",
],
data = [
":pcre2test",
":testdata",
":testdata_tar",
],
deps = ["@bazel_tools//tools/python/runfiles"],
main = "RunTest.py",
)
Loading
Loading