File tree Expand file tree Collapse file tree 12 files changed +112
-25
lines changed
Expand file tree Collapse file tree 12 files changed +112
-25
lines changed Original file line number Diff line number Diff line change @@ -19,4 +19,4 @@ RUN apt-get update && \
1919 apt-get install -y build-essential libncursesw5-dev libreadline-dev libssl-dev libgdbm-dev libc6-dev libsqlite3-dev tk-dev libbz2-dev zlib1g-dev libffi-dev
2020RUN git clone https://github.com/python/cpython.git cpython
2121RUN git clone --depth 1 https://github.com/python/library-fuzzers.git
22- COPY build.sh $SRC/
22+ COPY run_tests.sh build.sh $SRC/
Original file line number Diff line number Diff line change 1+ #! /bin/bash -eu
2+ # Copyright 2026 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+
18+ # Disable leak sanitizer
19+ export ASAN_OPTIONS=" detect_leaks=0"
20+
21+ # Run unit test (2 unit tests that required network connection are skipped)
22+ ctest --test-dir $SRC /cpython -j$( nproc) -E " test_urllib2|test_urllibnet"
Original file line number Diff line number Diff line change 1616
1717FROM gcr.io/oss-fuzz-base/base-builder
1818RUN apt-get update && \
19- apt-get install -y make autoconf automake libtool cmake
20- RUN git clone --depth 1 https://github.com/google/googletest && \
21- cd $SRC/googletest && \
22- mkdir build && \
23- cd build && \
24- cmake .. && \
25- make -j$(nproc) && \
26- make install
19+ apt-get install -y make autoconf automake libtool cmake libgtest-dev
2720RUN git clone --depth 1 https://github.com/Tencent/rapidjson.git rapidjson
2821WORKDIR rapidjson
2922COPY *.sh fuzzer.cpp $SRC/
Original file line number Diff line number Diff line change 2727 export CXXFLAGS=" $CXXFLAGS -DASAN"
2828fi
2929
30- # First build library and tests, which is needed for OSS-Fuzz's Chronos.
31- mkdir build
32- cd build
33- cmake ../
34- make -j$( nproc)
35- cd ../
36-
3730# Build fuzz harness.
3831$CXX $CXXFLAGS -D_GLIBCXX_DEBUG -I $SRC /rapidjson/include $SRC /fuzzer.cpp $LIB_FUZZING_ENGINE -o $OUT /fuzzer
3932
33+ # Build unit test and perf test only
34+ mkdir build
35+ cd build
36+ NO_ERROR=" -Wno-error=character-conversion"
37+ NO_ERROR=" $NO_ERROR -Wno-error=deprecated-declarations"
38+ NO_ERROR=" $NO_ERROR -Wno-error=uninitialized-const-pointer"
39+ export LDFLAGS=" -pthread"
40+ cmake -DRAPIDJSON_BUILD_CXX17=ON \
41+ -DRAPIDJSON_BUILD_CXX11=OFF \
42+ -DRAPIDJSON_BUILD_THIRDPARTY_GTEST=OFF \
43+ -DCMAKE_CXX_FLAGS=" $NO_ERROR " \
44+ ..
45+ make -j$( nproc) unittest perftest
Original file line number Diff line number Diff line change 1515#
1616# ##############################################################################
1717
18- ./build/bin/unittest
19-
20- # The below fails when run in OSS-Fuzz.
21- # TODO: adjust so this runs in a regular ASAN OSS-Fuzz build environment.
22- # ./build/bin/perftest
18+ $SRC /rapidjson/build/bin/unittest && $SRC /rapidjson/build/bin/perftest
Original file line number Diff line number Diff line change @@ -19,4 +19,4 @@ RUN apt-get update && apt-get install -y python3-pip
1919RUN unset CFLAGS CXXFLAGS && pip3 install -U meson ninja
2020RUN git clone --depth 1 https://github.com/rauc/rauc.git rauc
2121WORKDIR rauc
22- COPY build.sh $SRC/
22+ COPY run_tests.sh build.sh $SRC/
Original file line number Diff line number Diff line change 1+ #! /bin/bash -eu
2+ #
3+ # Copyright 2026 Google LLC
4+ #
5+ # Licensed under the Apache License, Version 2.0 (the "License");
6+ # you may not use this file except in compliance with the License.
7+ # You may obtain a copy of the License at
8+ #
9+ # http://www.apache.org/licenses/LICENSE-2.0
10+ #
11+ # Unless required by applicable law or agreed to in writing, software
12+ # distributed under the License is distributed on an "AS IS" BASIS,
13+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ # See the License for the specific language governing permissions and
15+ # limitations under the License.
16+ #
17+ # ###############################################################################
18+
19+ # Disable leak sanitizer
20+ export ASAN_OPTIONS=" detect_leaks=0"
21+
22+ # Run unit testing, skipping some that requires hardware or network configuration
23+ meson test -C $WORK /build --suite rauc -j$( nproc) artifacts bootchooser checksum config_file context event_log hash_index manifest progress slot stats status_file utils
24+
25+ # Test skipped that requires hardware or network configuration
26+ # meson test -C $WORK/build --suite rauc -j$(nproc) boot_raw_fallback bundle dm install service signature update_handler
Original file line number Diff line number Diff line change @@ -20,5 +20,5 @@ RUN apt-get update && apt-get install -y ninja-build wget
2020
2121RUN git clone --depth 1 https://github.com/simdjson/simdjson.git simdjson
2222WORKDIR simdjson
23- COPY build.sh $SRC/
23+ COPY run_tests.sh build.sh $SRC/
2424
Original file line number Diff line number Diff line change 1+ #! /bin/bash -eu
2+ #
3+ # Copyright 2026 Google LLC
4+ #
5+ # Licensed under the Apache License, Version 2.0 (the "License");
6+ # you may not use this file except in compliance with the License.
7+ # You may obtain a copy of the License at
8+ #
9+ # http://www.apache.org/licenses/LICENSE-2.0
10+ #
11+ # Unless required by applicable law or agreed to in writing, software
12+ # distributed under the License is distributed on an "AS IS" BASIS,
13+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ # See the License for the specific language governing permissions and
15+ # limitations under the License.
16+ #
17+ # ###############################################################################
18+
19+ # Disable leak sanitizer
20+ export ASAN_OPTIONS=" detect_leaks=0"
21+
22+ # Exclude failing unit test cases and run the remaining unit testing
23+ ctest --test-dir $SRC /simdjson/build -j$( nproc) -E \
24+ " minify_tests|prettify_tests|ondemand_tostring_tests|ondemand_cacheline|builder_string_builder_tests"
Original file line number Diff line number Diff line change @@ -63,4 +63,4 @@ RUN git clone --depth 1 --recursive https://github.com/zeek/spicy spicy \
6363
6464WORKDIR ${SRC}/spicy
6565
66- COPY build.sh $SRC/
66+ COPY run_tests.sh build.sh $SRC/
You can’t perform that action at this time.
0 commit comments