diff --git a/ortools/sat/samples/code_samples.bzl b/ortools/sat/samples/code_samples.bzl index d475c48072..69712cc4df 100644 --- a/ortools/sat/samples/code_samples.bzl +++ b/ortools/sat/samples/code_samples.bzl @@ -92,4 +92,15 @@ def code_sample_java(name): "//ortools/sat:sat_parameters_java_proto", "//ortools/util/java:sorted_interval_list", ], - ) \ No newline at end of file + ) + + + native.sh_test( + name = name + "_java_test", + size = "small", + srcs = ["code_samples_java_test.sh"], + args = [name], + data = [ + ":" + name + "_java", + ], + ) \ No newline at end of file diff --git a/ortools/sat/samples/code_samples_java_test.sh b/ortools/sat/samples/code_samples_java_test.sh new file mode 100755 index 0000000000..fb64ebb5a8 --- /dev/null +++ b/ortools/sat/samples/code_samples_java_test.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +# Copyright 2010-2022 Google LLC +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +declare -r DIR="${TEST_SRCDIR}/com_google_ortools/ortools/sat/samples" + +function test::ortools::code_samples_sat_java() { + "${DIR}/$1_java" +} + +test::ortools::code_samples_sat_java $1 \ No newline at end of file