Add a test that i18nd is used throughout

This commit is contained in:
David Edmundson 2014-06-05 11:57:04 +02:00
parent 61dadaa558
commit d6b8ea9161
2 changed files with 15 additions and 0 deletions

View File

@ -60,3 +60,9 @@ ecm_mark_as_test(sortfiltermodeltest)
if(QT_QTOPENGL_FOUND)
target_link_libraries(storagetest Qt5::OpenGL)
endif()
#Add a test that i18n is not used directly in any import.
# It should /always/ be i18nd
find_program(SH bash)
add_test(i18ndcheck ${SH} ${CMAKE_CURRENT_SOURCE_DIR}/i18ndcheck.sh ${CMAKE_SOURCE_DIR}/src/declarativeimports)

9
autotests/i18ndcheck.sh Normal file
View File

@ -0,0 +1,9 @@
#!/bin/sh
#If this test fails it means you are probably using i18n() in your QML code
#This should be replaced by i18nd in order to for i18n to load the correct catalog
#First arg should be the directory to check
! find $1 -name '*.qml' | xargs grep 'i18n[^d]*('