diff --git a/CMakeLists.txt b/CMakeLists.txt index f5ac8d2b2d..3fefd115e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -244,7 +244,10 @@ foreach(SAMPLES IN ITEMS algorithms graph linear_solver constraint_solver sat) add_subdirectory(ortools/${SAMPLES}/samples) endforeach() -# Same for examples/contrib +# Same for examples foreach(EXAMPLES IN ITEMS contrib cpp python java dotnet) add_subdirectory(examples/${EXAMPLES}) endforeach() + +# Add tests in examples/tests +add_subdirectory(examples/tests) diff --git a/examples/tests/CMakeLists.txt b/examples/tests/CMakeLists.txt new file mode 100644 index 0000000000..d0fc577589 --- /dev/null +++ b/examples/tests/CMakeLists.txt @@ -0,0 +1,31 @@ +if(NOT BUILD_EXAMPLES) + return() +endif() + +if(BUILD_CXX_EXAMPLES) + file(GLOB CXX_SRCS "*.cc") + foreach(FILE_NAME IN LISTS CXX_SRCS) + #add_cxx_test(${FILE_NAME}) + endforeach() +endif() + +if(BUILD_PYTHON_EXAMPLES) + file(GLOB PYTHON_SRCS "*.py") + foreach(FILE_NAME IN LISTS PYTHON_SRCS) + #add_python_test(${FILE_NAME}) + endforeach() +endif() + +if(BUILD_JAVA_EXAMPLES) + file(GLOB JAVA_SRCS "*.java") + foreach(FILE_NAME IN LISTS JAVA_SRCS) + add_java_test(${FILE_NAME}) + endforeach() +endif() + +if(BUILD_DOTNET_EXAMPLES) + file(GLOB DOTNET_SRCS "*.cs") + foreach(FILE_NAME IN LISTS DOTNET_SRCS) + #add_dotnet_test(${FILE_NAME}) + endforeach() +endif() diff --git a/examples/tests/LinearSolverTest.java b/examples/tests/LinearSolverTest.java index 589c571060..72a9eb8d12 100644 --- a/examples/tests/LinearSolverTest.java +++ b/examples/tests/LinearSolverTest.java @@ -17,7 +17,6 @@ import com.google.ortools.linearsolver.MPConstraint; import com.google.ortools.linearsolver.MPObjective; import com.google.ortools.linearsolver.MPSolver; import com.google.ortools.linearsolver.MPVariable; -import com.google.ortools.linearsolver.main_research_linear_solver; import java.util.Arrays; import java.util.ArrayList; import java.util.logging.Logger;