File tree Expand file tree Collapse file tree 2 files changed +17
-11
lines changed Expand file tree Collapse file tree 2 files changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -17,14 +17,17 @@ add_test(NAME test_Trainer
17
17
WORKING_DIRECTORY ${PROJ_ROOT} /paddle/ )
18
18
19
19
############### test_TrainerOnePass ##########################
20
- add_unittest_without_exec (test_TrainerOnePass
21
- test_TrainerOnePass.cpp )
22
- add_test (NAME test_TrainerOnePass
23
- COMMAND ${PROJ_ROOT} /paddle/.set_python_path.sh -d
24
- ${PROJ_ROOT} /python/:${PROJ_ROOT}/paddle/trainer/tests
25
- ${PROJ_ROOT} /paddle/.set_port.sh -p port ${CMAKE_CURRENT_BINARY_DIR} /test_TrainerOnePass
26
- WORKING_DIRECTORY ${PROJ_ROOT} /paddle/ )
27
-
20
+ if (WITH_PYTHON )
21
+ # only run test_TrainerOnePass when PYTHON is enabled, because train one pass
22
+ # is using PyDataProvider2.
23
+ add_unittest_without_exec (test_TrainerOnePass
24
+ test_TrainerOnePass.cpp )
25
+ add_test (NAME test_TrainerOnePass
26
+ COMMAND ${PROJ_ROOT} /paddle/.set_python_path.sh -d
27
+ ${PROJ_ROOT} /python/:${PROJ_ROOT}/paddle/trainer/tests
28
+ ${PROJ_ROOT} /paddle/.set_port.sh -p port ${CMAKE_CURRENT_BINARY_DIR} /test_TrainerOnePass
29
+ WORKING_DIRECTORY ${PROJ_ROOT} /paddle/ )
30
+ endif ()
28
31
################ test_CompareTwoNets ######################
29
32
add_unittest_without_exec (test_CompareTwoNets
30
33
test_CompareTwoNets.cpp )
Original file line number Diff line number Diff line change @@ -24,9 +24,12 @@ add_custom_target(paddle_python ALL DEPENDS
24
24
${OUTPUT_DIR} /.timestamp )
25
25
26
26
add_subdirectory (paddle/trainer_config_helpers/tests )
27
- add_subdirectory (paddle/v2/tests )
28
- add_subdirectory (paddle/v2/reader/tests )
29
- add_subdirectory (paddle/v2/plot/tests )
27
+ if (WITH_SWIG_PY )
28
+ # enable v2 API unittest only when paddle swig api is compiled
29
+ add_subdirectory (paddle/v2/tests )
30
+ add_subdirectory (paddle/v2/reader/tests )
31
+ add_subdirectory (paddle/v2/plot/tests )
32
+ endif ()
30
33
31
34
install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} /dist/
32
35
DESTINATION opt/paddle/share/wheels
You can’t perform that action at this time.
0 commit comments