Skip to content

Commit c6e2f95

Browse files
jsonnet: add run_tests.sh (#13531)
``` $ docker run --rm -ti us-central1-docker.pkg.dev/oss-fuzz/oss-fuzz-gen/jsonnet-ofg-cached-address /src/run_tests.sh Running tests... Test project /src/jsonnet/build Start 1: unicode_test 1/10 Test #1: unicode_test ..................... Passed 0.06 sec Start 2: lexer_test 2/10 Test #2: lexer_test ....................... Passed 0.01 sec Start 3: parser_test 3/10 Test #3: parser_test ...................... Passed 0.02 sec Start 4: libjsonnet_test 4/10 Test #4: libjsonnet_test .................. Passed 0.25 sec Start 5: libjsonnet_test_file 5/10 Test #5: libjsonnet_test_file ............. Passed 0.31 sec Start 6: libjsonnet_test_snippet 6/10 Test #6: libjsonnet_test_snippet .......... Passed 0.23 sec Start 7: jsonnet_test_snippet 7/10 Test #7: jsonnet_test_snippet ............. Passed 0.23 sec Start 8: libjsonnet++_test 8/10 Test #8: libjsonnet++_test ................ Passed 1.20 sec Start 9: libjsonnet_test_locale 9/10 Test #9: libjsonnet_test_locale ........... Passed 0.23 sec Start 10: regression_test 10/10 Test #10: regression_test .................. Passed 121.46 sec 100% tests passed, 0 tests failed out of 10 Total Test time (real) = 124.00 sec ``` Signed-off-by: David Korczynski <david@adalogics.com>
1 parent 2d893db commit c6e2f95

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

projects/jsonnet/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ RUN apt-get update && apt-get install -y build-essential cmake
1919
RUN git clone --depth 1 https://github.com/google/jsonnet.git jsonnet
2020
WORKDIR $SRC/
2121

22-
COPY build.sh $SRC/
22+
COPY build.sh run_tests.sh $SRC/
2323
COPY *.cc $SRC/

projects/jsonnet/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
mkdir jsonnet/build
1919
pushd jsonnet/build
2020
cmake -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" \
21-
-DCMAKE_C_FLAGS="$CFLAGS" -DCMAKE_CXX_FLAGS="$CXXFLAGS" -DBUILD_TESTS=OFF ..
22-
make -j$(nproc) libjsonnet_static
21+
-DCMAKE_C_FLAGS="$CFLAGS" -DCMAKE_CXX_FLAGS="$CXXFLAGS" -DBUILD_TESTS=ON ..
22+
make -j$(nproc) all
2323
popd
2424

2525
INSTALL_DIR="$SRC/jsonnet"

projects/jsonnet/run_tests.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
18+
cd $SRC/jsonnet/build
19+
make test

0 commit comments

Comments
 (0)