CMakeLists.txt 2.6 KB
Newer Older
1 2 3 4
file(
  GLOB TEST_OPS
  RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
  "test_*.py")
5
string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}")
6
set(GC_ENVS FLAGS_eager_delete_tensor_gb=0.0)
7
set(DY2ST_EAGER_TEST_ENVS ${GC_ENVS})
8

9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
set(TEST_EAGER_OPS
    test_bmn
    test_break_continue
    test_ifelse
    test_loop
    test_mnist_amp
    test_mnist_pure_fp16
    test_mobile_net
    test_program_translator
    test_ptb_lm
    test_reinforcement_learning
    test_resnet
    test_resnet_amp
    test_resnet_pure_fp16
    test_se_resnet
    test_sentiment
    test_seq2seq
    test_tsm
    test_word2vec
    test_yolov3
    test_bert
    test_cycle_gan
    test_lstm
    test_simnet
    test_transformer)
34
list(REMOVE_ITEM TEST_OPS test_lac)
W
Wilber 已提交
35 36
# NOTE(Aurelius84): In case of Windows CI, if open ON_INFER, RWLOCK of Scope
# will be removed and will cause some random failed in multi-thread.
37
if(WITH_PYTHON)
38
  py_test_modules(test_lac MODULES test_lac)
39
  set_tests_properties(test_lac PROPERTIES TIMEOUT 120)
40 41
endif()

42
if(WIN32 AND NOT WITH_GPU)
43 44
  list(REMOVE_ITEM TEST_OPS test_resnet_amp
  )# disable on Windows CPU CI for timeout
45 46
endif()

47
foreach(TEST_OP ${TEST_OPS})
48 49 50 51 52 53
  list(FIND TEST_EAGER_OPS ${TEST_OP} WAS_FOUND)
  if(NOT WAS_FOUND EQUAL -1)
    py_test_modules(${TEST_OP} MODULES ${TEST_OP} ENVS ${DY2ST_EAGER_TEST_ENVS})
  else()
    py_test_modules(${TEST_OP} MODULES ${TEST_OP} ENVS ${GC_ENVS})
  endif()
W
Wilber 已提交
54
endforeach()
55

56
set_tests_properties(test_se_resnet PROPERTIES TIMEOUT 900)
57 58
set_tests_properties(test_yolov3 PROPERTIES TIMEOUT 900 LABELS
                                            "RUN_TYPE=EXCLUSIVE")
Y
YUNSHEN XIE 已提交
59
set_tests_properties(test_mobile_net PROPERTIES TIMEOUT 120)
60
set_tests_properties(test_seq2seq PROPERTIES TIMEOUT 150)
Y
YUNSHEN XIE 已提交
61
set_tests_properties(test_cycle_gan PROPERTIES TIMEOUT 150)
Y
YUNSHEN XIE 已提交
62 63 64 65 66
set_tests_properties(test_bert PROPERTIES TIMEOUT 120)
set_tests_properties(test_basic_api_transformation PROPERTIES TIMEOUT 120)
set_tests_properties(test_reinforcement_learning PROPERTIES TIMEOUT 120)
set_tests_properties(test_transformer PROPERTIES TIMEOUT 200)
set_tests_properties(test_bmn PROPERTIES TIMEOUT 120)
67
#set_tests_properties(test_mnist PROPERTIES TIMEOUT 120)
68
set_tests_properties(test_build_strategy PROPERTIES TIMEOUT 120)
69 70

if(NOT WIN32)
71 72 73
  set_tests_properties(test_resnet_v2 PROPERTIES TIMEOUT 120)
  set_tests_properties(test_tsm PROPERTIES TIMEOUT 900)
  #set_tests_properties(test_resnet PROPERTIES TIMEOUT 120)
74
endif()
J
Jiabin Yang 已提交
75 76

if(APPLE)
77 78 79 80
  set_tests_properties(test_bmn PROPERTIES TIMEOUT 300)
  set_tests_properties(test_build_strategy PROPERTIES TIMEOUT 300)
  set_tests_properties(test_mobile_net PROPERTIES TIMEOUT 300)
  set_tests_properties(test_resnet_v2 PROPERTIES TIMEOUT 300)
J
Jiabin Yang 已提交
81
endif()