CMakeLists.txt 831 B

12345678910111213141516171819202122232425262728293031
  1. function(kaldi_native_fbank_add_py_test source)
  2. get_filename_component(name ${source} NAME_WE)
  3. set(name "${name}_py")
  4. message(STATUS "source: ${source}")
  5. add_test(NAME ${name}
  6. COMMAND
  7. "${PYTHON_EXECUTABLE}"
  8. "${CMAKE_CURRENT_SOURCE_DIR}/${source}"
  9. )
  10. get_filename_component(kaldi_native_fbank_path ${CMAKE_CURRENT_LIST_DIR} DIRECTORY)
  11. set_property(TEST ${name}
  12. PROPERTY ENVIRONMENT "PYTHONPATH=${kaldi_native_fbank_path}:$<TARGET_FILE_DIR:_kaldi_native_fbank>:$ENV{PYTHONPATH}"
  13. )
  14. endfunction()
  15. # please sort the files in alphabetic order
  16. set(py_test_files
  17. test_frame_extraction_options.py
  18. test_mel_bank_options.py
  19. test_fbank_options.py
  20. )
  21. if(KALDI_NATIVE_FBANK_BUILD_TESTS)
  22. foreach(source IN LISTS py_test_files)
  23. kaldi_native_fbank_add_py_test(${source})
  24. endforeach()
  25. endif()