Browse Source

Move shortcut keys test to CMake

So that when you run tests locally, you also test this one.
Ghostkeeper 6 years ago
parent
commit
4e54f13145
2 changed files with 9 additions and 15 deletions
  1. 0 14
      Jenkinsfile
  2. 9 1
      cmake/CuraTests.cmake

+ 0 - 14
Jenkinsfile

@@ -12,20 +12,6 @@ parallel_nodes(['linux && cura', 'windows && cura']) {
 
         // If any error occurs during building, we want to catch it and continue with the "finale" stage.
         catchError {
-            stage('Pre Checks') {
-                if (isUnix()) {
-                    // Check shortcut keys
-                    try {
-                        sh """
-                            echo 'Check for duplicate shortcut keys in all translation files.'
-                            ${env.CURA_ENVIRONMENT_PATH}/master/bin/python3 scripts/check_shortcut_keys.py
-                        """
-                    } catch(e) {
-                        currentBuild.result = "UNSTABLE"
-                    }
-                }
-            }
-
             // Building and testing should happen in a subdirectory.
             dir('build') {
                 // Perform the "build". Since Uranium is Python code, this basically only ensures CMake is setup.

+ 9 - 1
cmake/CuraTests.cmake

@@ -57,5 +57,13 @@ endforeach()
 #Add code style test.
 add_test(
     NAME "code-style"
-    COMMAND ${PYTHON_EXECUTABLE} run_mypy.py WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+    COMMAND ${PYTHON_EXECUTABLE} run_mypy.py
+    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+)
+
+#Add test for whether the shortcut alt-keys are unique in every translation.
+add_test(
+    NAME "shortcut-keys"
+    COMMAND ${PYTHON_EXECUTABLE} scripts/check_shortcut_keys.py
+    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
 )