Skip to content

Commit 9deb58f

Browse files
jmragutkin
authored andcommitted
scripts: Add testing scripts
Add convenience scripts for testing. It's hard to remember the right CMake incantations. PiperOrigin-RevId: 881486773
1 parent 8957795 commit 9deb58f

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

scripts/test_bazel.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright 2026 The OpenFst Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
#!/bin/bash
16+
17+
set -euxo pipefail
18+
19+
echo "--- Running Bazel tests ---"
20+
21+
# Mirroring the bazel_x64_linux workflow.
22+
bazel test -c fastbuild --config=dev \
23+
--test_size_filters=-enormous \
24+
--test_output=errors \
25+
//openfst/...

scripts/test_cmake.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright 2026 The OpenFst Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
#!/bin/bash
16+
17+
set -euxo pipefail
18+
19+
echo "--- Running CMake tests ---"
20+
21+
# Using -DOPENFST_ENABLE_FSTS=ON and -DOPENFST_ENABLE_GRM=ON ensures we test
22+
# all extensions, similar to the CI workflow.
23+
cmake -S . -B build \
24+
-DOPENFST_ENABLE_BIN=ON \
25+
-DOPENFST_BUILD_TESTS=ON \
26+
-DOPENFST_ENABLE_FSTS=ON \
27+
-DOPENFST_ENABLE_GRM=ON \
28+
-DOPENFST_ENABLE_PYTHON=ON \
29+
-DBUILD_SHARED_LIBS=ON
30+
31+
cmake --build build -j$(nproc)
32+
ctest --test-dir build --output-on-failure -j$(nproc)

0 commit comments

Comments
 (0)