Files
2025-12-02 15:33:12 +01:00

73 lines
2.1 KiB
Python

# Copyright 2010-2025 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.
load("@rules_cc//cc:cc_test.bzl", "cc_test")
load("@rules_java//java:java_binary.bzl", "java_binary")
load("@rules_python//python:py_test.bzl", "py_test")
load("//tools/testing:bintest.bzl", "bintest")
package(default_visibility = ["//visibility:public"])
cc_test(
name = "simple_knapsack_program_test",
srcs = ["simple_knapsack_program.cc"],
deps = [
"//ortools/algorithms:knapsack_solver_lib",
"//ortools/base",
"@abseil-cpp//absl/base:log_severity",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/log:globals",
],
)
py_test(
name = "simple_knapsack_program_py3",
srcs = ["simple_knapsack_program.py"],
main = "simple_knapsack_program.py",
deps = ["//ortools/algorithms/python:knapsack_solver"],
)
cc_test(
name = "knapsack_test",
srcs = ["knapsack.cc"],
deps = [
"//ortools/algorithms:knapsack_solver_lib",
"//ortools/base",
"@abseil-cpp//absl/base:log_severity",
"@abseil-cpp//absl/log:globals",
],
)
py_test(
name = "knapsack_py3",
srcs = ["knapsack.py"],
main = "knapsack.py",
deps = ["//ortools/algorithms/python:knapsack_solver"],
)
java_binary(
name = "Knapsack",
srcs = ["Knapsack.java"],
main_class = "com.google.ortools.algorithms.samples.Knapsack",
deps = [
"//ortools/algorithms/java:knapsacksolver",
"//ortools/java/com/google/ortools:Loader",
],
)
bintest(
name = "KnapsackTest",
srcs = [":KnapsackTest.bintest"],
named_data = {"Knapsack": ":Knapsack"},
)