diff --git a/ortools/algorithms/samples/code_samples.bzl b/ortools/algorithms/samples/code_samples.bzl index fac7a30066..1e84c78a25 100644 --- a/ortools/algorithms/samples/code_samples.bzl +++ b/ortools/algorithms/samples/code_samples.bzl @@ -47,3 +47,13 @@ def code_sample_java(name): "//ortools/java/com/google/ortools:Loader" ], ) + + native.sh_test( + name = name + "_java_test", + size = "small", + srcs = ["code_samples_java_test.sh"], + args = [name], + data = [ + ":" + name + "_java", + ], + ) diff --git a/ortools/algorithms/samples/code_samples_java_test.sh b/ortools/algorithms/samples/code_samples_java_test.sh new file mode 100755 index 0000000000..e3f1ab60af --- /dev/null +++ b/ortools/algorithms/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/algorithms/samples" + +function test::ortools::code_samples_algorithms_java() { + "${DIR}/$1_java" +} + +test::ortools::code_samples_algorithms_java $1 \ No newline at end of file diff --git a/ortools/graph/samples/code_samples.bzl b/ortools/graph/samples/code_samples.bzl index 2a17356226..85c9d67294 100644 --- a/ortools/graph/samples/code_samples.bzl +++ b/ortools/graph/samples/code_samples.bzl @@ -101,3 +101,13 @@ def code_sample_java(name): "//ortools/java/com/google/ortools:Loader" ], ) + + native.sh_test( + name = name + "_java_test", + size = "small", + srcs = ["code_samples_java_test.sh"], + args = [name], + data = [ + ":" + name + "_java", + ], + ) diff --git a/ortools/graph/samples/code_samples_java_test.sh b/ortools/graph/samples/code_samples_java_test.sh new file mode 100755 index 0000000000..aa2c9620c7 --- /dev/null +++ b/ortools/graph/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/graph/samples" + +function test::ortools::code_samples_graph_java() { + "${DIR}/$1_java" +} + +test::ortools::code_samples_graph_java $1 \ No newline at end of file diff --git a/ortools/linear_solver/samples/code_samples.bzl b/ortools/linear_solver/samples/code_samples.bzl index 8fb50889ad..af09017983 100644 --- a/ortools/linear_solver/samples/code_samples.bzl +++ b/ortools/linear_solver/samples/code_samples.bzl @@ -84,3 +84,13 @@ def code_sample_java(name): "//ortools/java/com/google/ortools:Loader" ], ) + + native.sh_test( + name = name + "_java_test", + size = "small", + srcs = ["code_samples_java_test.sh"], + args = [name], + data = [ + ":" + name + "_java", + ], + ) diff --git a/ortools/linear_solver/samples/code_samples_java_test.sh b/ortools/linear_solver/samples/code_samples_java_test.sh new file mode 100755 index 0000000000..9724a1b7ad --- /dev/null +++ b/ortools/linear_solver/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/linear_solver/samples" + +function test::ortools::code_samples_linear_solver_java() { + "${DIR}/$1_java" +} + +test::ortools::code_samples_linear_solver_java $1 \ No newline at end of file diff --git a/ortools/sat/samples/code_samples.bzl b/ortools/sat/samples/code_samples.bzl index 69712cc4df..1954f1dc48 100644 --- a/ortools/sat/samples/code_samples.bzl +++ b/ortools/sat/samples/code_samples.bzl @@ -94,7 +94,6 @@ def code_sample_java(name): ], ) - native.sh_test( name = name + "_java_test", size = "small",