Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenFlipper-Free
OpenFlipper
Commits
cc6a247b
Commit
cc6a247b
authored
Mar 07, 2019
by
Jan Möbius
Browse files
Merge branch 'Introduce_python_tests' into 'master'
Introduce python tests See merge request
!138
parents
5b390585
715e424f
Changes
4
Show whitespace changes
Inline
Side-by-side
PythonInterpreter/PythonInterpreter.cc
View file @
cc6a247b
...
@@ -329,6 +329,10 @@ void PythonInterpreter::pyOutput(const char* w)
...
@@ -329,6 +329,10 @@ void PythonInterpreter::pyOutput(const char* w)
void
PythonInterpreter
::
pyError
(
const
char
*
w
)
void
PythonInterpreter
::
pyError
(
const
char
*
w
)
{
{
if
(
externalLogging_
)
{
if
(
externalLogging_
)
{
if
(
OpenFlipper
::
Options
::
nogui
())
{
std
::
cerr
<<
"Python Error! "
<<
w
<<
std
::
endl
;
exit
(
1
);
}
emit
log
(
LOGERR
,
QString
(
w
));
emit
log
(
LOGERR
,
QString
(
w
));
}
else
{
}
else
{
LogErr
+=
QString
::
fromUtf8
(
w
);
LogErr
+=
QString
::
fromUtf8
(
w
);
...
...
tests/CMakeLists.txt
View file @
cc6a247b
...
@@ -143,6 +143,17 @@ SET (CTEST_DROP_SITE_CDASH FALSE)
...
@@ -143,6 +143,17 @@ SET (CTEST_DROP_SITE_CDASH FALSE)
add_subdirectory
(
${
CMAKE_SOURCE_DIR
}
/
${
_plugin_dir
}
/tests
${
CMAKE_BINARY_DIR
}
/tests/
${
_plugin_name
}
)
add_subdirectory
(
${
CMAKE_SOURCE_DIR
}
/
${
_plugin_dir
}
/tests
${
CMAKE_BINARY_DIR
}
/tests/
${
_plugin_name
}
)
endif
()
endif
()
# If a PythonTests subdir exists, we add it here
if
(
IS_DIRECTORY
${
CMAKE_SOURCE_DIR
}
/
${
_plugin_dir
}
/PythonTests
)
# Only get the plugins name without possible collection:
string
(
REGEX MATCH
"Plugin-.+[/
\\
]?$"
_plugin_name
${
_plugin_dir
}
)
add_subdirectory
(
${
CMAKE_SOURCE_DIR
}
/
${
_plugin_dir
}
/PythonTests
${
CMAKE_BINARY_DIR
}
/PythonTests/
${
_plugin_name
}
)
endif
()
endforeach
()
endforeach
()
endif
()
endif
()
tests/run_script_test.cmake
View file @
cc6a247b
...
@@ -16,6 +16,8 @@ if ( NOT EXISTS ${test_cmd} )
...
@@ -16,6 +16,8 @@ if ( NOT EXISTS ${test_cmd} )
message
(
SEND_ERROR
"Test Executable missing!"
)
message
(
SEND_ERROR
"Test Executable missing!"
)
endif
()
endif
()
message
(
"Running :
${
test_cmd
}
${
test_args
}
"
)
# Execute the process with the given arguments
# Execute the process with the given arguments
# Timeout after 5 minutes
# Timeout after 5 minutes
execute_process
(
execute_process
(
...
...
tests/testGenerators.cmake
View file @
cc6a247b
...
@@ -129,8 +129,11 @@ endfunction()
...
@@ -129,8 +129,11 @@ endfunction()
# If TEST_SCRIPT does not exist in the tests directory of the plugin, no test will be generated!
# If TEST_SCRIPT does not exist in the tests directory of the plugin, no test will be generated!
function
(
run_local_script_test TEST_SCRIPT
)
function
(
run_local_script_test TEST_SCRIPT
)
# check if TEST_SCRIPT is at the correct place
# check if TEST_SCRIPT is at the correct place
if
(
NOT EXISTS
${
CMAKE_SOURCE_DIR
}
/
${
_plugin_dir
}
/tests/
${
TEST_SCRIPT
}
)
if
(
NOT EXISTS
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
TEST_SCRIPT
}
)
message
(
"Error, unable to locate test script:
${
CMAKE_CURRENT_SOURCE_DIR
}
/
${
TEST_SCRIPT
}
"
)
return
()
return
()
endif
()
endif
()
...
@@ -139,8 +142,8 @@ function( run_local_script_test TEST_SCRIPT )
...
@@ -139,8 +142,8 @@ function( run_local_script_test TEST_SCRIPT )
# Configure the test script from the current directory with the given filenames and variables into the test directory
# Configure the test script from the current directory with the given filenames and variables into the test directory
configure_file
(
configure_file
(
${
CMAKE_SOURCE_DIR
}
/
${
_plugin_dir
}
/tests/
${
TEST_SCRIPT
}
${
CMAKE_
CURRENT_
SOURCE_DIR
}
/
${
TEST_SCRIPT
}
${
CMAKE_BINARY_DIR
}
/
tests/
${
_plugin_name
}
/
${
TEST_SCRIPT_NAME
}
@ONLY
${
CMAKE_
CURRENT_
BINARY_DIR
}
/
${
TEST_SCRIPT_NAME
}
@ONLY
)
)
# Execute the script by OpenFlipper
# Execute the script by OpenFlipper
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment