Skip to content

Commit

Permalink
CMake: Tests require Nlopt
Browse files Browse the repository at this point in the history
  • Loading branch information
jschueller committed May 2, 2024
1 parent 87b4f0f commit ae34d68
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
8 changes: 2 additions & 6 deletions distro/rpm/otrobopt.spec
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,15 @@ Python textual interface to OTRobOpt uncertainty library
%build
%cmake -DINSTALL_DESTDIR:PATH=%{buildroot} \
-DCMAKE_SKIP_INSTALL_RPATH:BOOL=ON \
-DCMAKE_UNITY_BUILD=ON \
-DUSE_SPHINX=OFF .
make %{?_smp_mflags}

%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}

%check
make tests %{?_smp_mflags}
LD_LIBRARY_PATH=%{buildroot}%{_libdir} ctest %{?_smp_mflags} --output-on-failure

%clean
rm -rf %{buildroot}
LD_LIBRARY_PATH=%{buildroot}%{_libdir} ctest %{?_smp_mflags} -R pyinstallcheck --output-on-failure --schedule-random

%post -n libotrobopt0 -p /sbin/ldconfig
%postun -n libotrobopt0 -p /sbin/ldconfig
Expand Down
3 changes: 2 additions & 1 deletion lib/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ include_directories ( ${INTERNAL_INCLUDE_DIRS} )


ot_check_test (MeasureEvaluation_std)
if (NOT WIN32)
get_target_property (ot_features OT OPENTURNS_ENABLED_FEATURES)
if (ot_features MATCHES "nlopt" AND NOT WIN32)
ot_check_test (SequentialMonteCarloRobustAlgorithm_std)
endif()
ot_check_test (SubsetInverseSampling_std)
Expand Down
8 changes: 5 additions & 3 deletions python/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ endmacro ()
ot_pyinstallcheck_test (MeasureEvaluation_std)
ot_pyinstallcheck_test (MeasureFactory_std)
ot_pyinstallcheck_test (MeasureFunction_std)
ot_pyinstallcheck_test (SequentialMonteCarloRobustAlgorithm_std)
get_target_property (ot_features OT OPENTURNS_ENABLED_FEATURES)
if (ot_features MATCHES "nlopt")
ot_pyinstallcheck_test (SequentialMonteCarloRobustAlgorithm_std)
ot_pyinstallcheck_test (saveload)
endif ()
ot_pyinstallcheck_test (SubsetInverseSampling_R-S)
ot_pyinstallcheck_test (SubsetInverseSampling_Waarts_system_series)
ot_pyinstallcheck_test (InverseFORM_std IGNOREOUT)
Expand All @@ -56,8 +60,6 @@ if (MATPLOTLIB_FOUND)
endforeach ()
endif ()

ot_pyinstallcheck_test (saveload)

add_custom_target ( pyinstallcheck COMMAND ${CMAKE_CTEST_COMMAND} -R "^pyinstallcheck_"
COMMENT "Run Python post-installation tests" )

Expand Down

0 comments on commit ae34d68

Please sign in to comment.