Skip to content

Commit 1ff6532

Browse files
authored
valijson: add run_tests.sh (#13605)
Adds run_tests.sh to the valijson project. run_tests.sh is used as part of Chronos with cached builds: https://github.com/google/oss-fuzz/tree/master/infra/experimental/chronos#check-tests `infra/experimental/chronos/check_tests.sh valijson c` ``` Running main() from /src/valijson/thirdparty/googletest/googletest/src/gtest_main.cc [==========] Running 125 tests from 16 test suites. [----------] Global test environment set-up. [----------] 21 tests from TestAdapterComparison [ RUN ] TestAdapterComparison.JsonCppVsJsonCpp [ OK ] TestAdapterComparison.JsonCppVsJsonCpp (9 ms) [ RUN ] TestAdapterComparison.JsonCppVsPicoJson [ OK ] TestAdapterComparison.JsonCppVsPicoJson (3 ms) [ RUN ] TestAdapterComparison.JsonCppVsRapidJson [ OK ] TestAdapterComparison.JsonCppVsRapidJson (5 ms) [ RUN ] TestAdapterComparison.JsonCppVsRapidJsonCrtAlloc [ OK ] TestAdapterComparison.JsonCppVsRapidJsonCrtAlloc (5 ms) ... ``` Signed-off-by: Adam Korczynski <adam@adalogics.com>
1 parent d888e51 commit 1ff6532

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

projects/valijson/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,7 @@ FROM gcr.io/oss-fuzz-base/base-builder
1919
RUN apt-get update && apt-get install -y make autoconf automake libtool \
2020
pkg-config cmake libcurlpp-dev libcurl4-openssl-dev
2121
RUN git clone --depth 1 https://github.com/tristanpenman/valijson
22+
COPY run_tests.diff run_tests.sh $SRC/
23+
RUN cd valijson && git apply $SRC/run_tests.diff
2224
WORKDIR valijson
2325
RUN cp $SRC/valijson/tests/fuzzing/oss-fuzz-build.sh $SRC/build.sh

projects/valijson/run_tests.diff

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/tests/fuzzing/oss-fuzz-build.sh b/tests/fuzzing/oss-fuzz-build.sh
2+
index be9757c..fdf5c90 100755
3+
--- a/tests/fuzzing/oss-fuzz-build.sh
4+
+++ b/tests/fuzzing/oss-fuzz-build.sh
5+
@@ -5,7 +5,7 @@ git submodule update --init --depth 1 thirdparty
6+
mkdir build
7+
cd build
8+
cmake \
9+
- -Dvalijson_BUILD_TESTS=FALSE \
10+
+ -Dvalijson_BUILD_TESTS=ON \
11+
-Dvalijson_BUILD_EXAMPLES=FALSE \
12+
-Dvalijson_EXCLUDE_BOOST=TRUE \
13+
..

projects/valijson/run_tests.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash -eu
2+
# Copyright 2025 Google LLC.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
################################################################################
17+
cd $SRC/valijson/build
18+
./test_suite

0 commit comments

Comments
 (0)