未验证 提交 9c99d379 编写于 作者: Z Zhou Wei 提交者: GitHub

fix unittest failed on windows (#29837)

上级 69839f8a
......@@ -31,7 +31,8 @@ wmic process where name="op_function_generator.exe" call terminate
rem ------initialize common variable------
if not defined BRANCH set BRANCH=develop
if not defined TENSORRT_ROOT set TENSORRT_ROOT="C:/TensorRT-5.1.5.0"
if not defined WITH_TENSORRT set WITH_TENSORRT=ON
if not defined TENSORRT_ROOT set TENSORRT_ROOT="D:/TensorRT"
if not defined WITH_MKL set WITH_MKL=ON
if not defined WITH_AVX set WITH_AVX=ON
if not defined WITH_TESTING set WITH_TESTING=ON
......@@ -238,13 +239,15 @@ echo cmake .. -G "Visual Studio 14 2015 Win64" -DWITH_AVX=%WITH_AVX% -DWITH_GPU=
-DWITH_TESTING=%WITH_TESTING% -DWITH_PYTHON=%WITH_PYTHON% -DON_INFER=%ON_INFER% ^
-DWITH_INFERENCE_API_TEST=%WITH_INFERENCE_API_TEST% -DTHIRD_PARTY_PATH=%THIRD_PARTY_PATH% ^
-DINFERENCE_DEMO_INSTALL_DIR=%INFERENCE_DEMO_INSTALL_DIR% -DWITH_STATIC_LIB=%WITH_STATIC_LIB% ^
-DTENSORRT_ROOT=%TENSORRT_ROOT% -DMSVC_STATIC_CRT=%MSVC_STATIC_CRT% -DWITH_UNITY_BUILD=%WITH_UNITY_BUILD%
-DWITH_TENSORRT=%WITH_TENSORRT% -DTENSORRT_ROOT=%TENSORRT_ROOT% -DMSVC_STATIC_CRT=%MSVC_STATIC_CRT% ^
-DWITH_UNITY_BUILD=%WITH_UNITY_BUILD%
cmake .. -G "Visual Studio 14 2015 Win64" -DWITH_AVX=%WITH_AVX% -DWITH_GPU=%WITH_GPU% -DWITH_MKL=%WITH_MKL% ^
-DWITH_TESTING=%WITH_TESTING% -DWITH_PYTHON=%WITH_PYTHON% -DON_INFER=%ON_INFER% ^
-DWITH_INFERENCE_API_TEST=%WITH_INFERENCE_API_TEST% -DTHIRD_PARTY_PATH=%THIRD_PARTY_PATH% ^
-DINFERENCE_DEMO_INSTALL_DIR=%INFERENCE_DEMO_INSTALL_DIR% -DWITH_STATIC_LIB=%WITH_STATIC_LIB% ^
-DTENSORRT_ROOT=%TENSORRT_ROOT% -DMSVC_STATIC_CRT=%MSVC_STATIC_CRT% -DWITH_UNITY_BUILD=%WITH_UNITY_BUILD%
-DWITH_TENSORRT=%WITH_TENSORRT% -DTENSORRT_ROOT=%TENSORRT_ROOT% -DMSVC_STATIC_CRT=%MSVC_STATIC_CRT% ^
-DWITH_UNITY_BUILD=%WITH_UNITY_BUILD%
goto:eof
:cmake_error
......
......@@ -98,13 +98,15 @@ class TestPassBuilder(unittest.TestCase):
pass_builder.remove_pass(len(pass_builder.all_passes()) - 1)
self.assertEqual(origin_len + 1, len(pass_builder.all_passes()))
viz_pass.set("graph_viz_path", "/tmp/test_viz_pass")
current_path = os.path.abspath(os.path.dirname(__file__))
graph_viz_path = current_path + os.sep + 'tmp' + os.sep + 'test_viz_pass'
viz_pass.set("graph_viz_path", graph_viz_path)
self.check_network_convergence(
use_cuda=core.is_compiled_with_cuda(),
build_strategy=build_strategy)
try:
os.stat("/tmp/test_viz_pass")
os.stat(graph_viz_path)
except os.error:
self.assertFalse(True)
......
......@@ -38,6 +38,18 @@ fi
# /*==================Fixed Disabled Windows unittests==============================*/
# TODO: fix these unittest that is bound to fail
diable_wingpu_test="^test_analysis_predictor$|\
^test_gradient_clip$|\
^test_translated_layer$|\
^test_imperative_resnet$|\
^test_imperative_resnet_sorted_gradient$|\
^test_model$|\
^test_decoupled_py_reader$|\
^test_generator_dataloader$|\
^test_ir_memory_optimize_pass$|\
^test_multiprocess_dataloader_iterable_dataset_static$|\
^test_parallel_executor_pg$|\
^test_py_reader_using_executor$|\
^test_weight_decay$|\
^test_parallel_executor_feed_persistable_var$|\
^test_parallel_executor_fetch_isolated_var$|\
^test_parallel_executor_inference_feed_partial_data$|\
......@@ -51,32 +63,20 @@ diable_wingpu_test="^test_analysis_predictor$|\
^test_buffer_shared_memory_reuse_pass_and_fuse_optimization_op_pass$|\
^test_dataloader_keep_order$|\
^test_dataloader_unkeep_order$|\
^test_model$|\
^test_add_reader_dependency$|\
^test_cholesky_op$|\
^test_dataloader_early_reset$|\
^test_decoupled_py_reader$|\
^test_decoupled_py_reader_data_check$|\
^test_eager_deletion_delete_vars$|\
^test_eager_deletion_while_op$|\
^test_fleet_base_single$|\
^test_fuse_elewise_add_act_pass$|\
^test_fuse_optimizer_pass$|\
^test_generator_dataloader$|\
^test_ir_memory_optimize_ifelse_op$|\
^test_lr_scheduler$|\
^test_multiprocess_dataloader_iterable_dataset_dynamic$|\
^test_multiprocess_dataloader_iterable_dataset_static$|\
^test_parallel_dygraph_sync_batch_norm$|\
^test_parallel_executor_drop_scope$|\
^test_parallel_executor_dry_run$|\
^test_partial_eager_deletion_transformer$|\
^test_rnn_nets$|\
^test_prune$|\
^test_py_reader_combination$|\
^test_py_reader_pin_memory$|\
^test_py_reader_push_pop$|\
^test_py_reader_using_executor$|\
^test_reader_reset$|\
^test_update_loss_scaling_op$|\
^test_imperative_se_resnext$|\
......@@ -86,17 +86,7 @@ diable_wingpu_test="^test_analysis_predictor$|\
^test_gru_rnn_op$|\
^test_rnn_op$|\
^test_simple_rnn_op$|\
^test_pass_builder$|\
^test_lstm_cudnn_op$|\
^test_inplace_addto_strategy$|\
^test_ir_inplace_pass$|\
^test_ir_memory_optimize_pass$|\
^test_memory_reuse_exclude_feed_var$|\
^test_mix_precision_all_reduce_fuse$|\
^test_parallel_executor_pg$|\
^test_print_op$|\
^test_py_func_op$|\
^test_weight_decay$|\
^test_conv2d_int8_mkldnn_op$|\
^test_crypto$|\
^test_program_prune_backward$|\
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册