Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
asapo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
GitLab update on
10 April 7 a.m. CEST
Show more breadcrumbs
Joao Alvim Oliveira Dias De Almeida
asapo
Commits
b2f63059
Commit
b2f63059
authored
7 years ago
by
Sergey Yakubov
Browse files
Options
Downloads
Patches
Plain Diff
refactor tests
parent
31369bc9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeModules/testing_cpp.cmake
+24
-1
24 additions, 1 deletion
CMakeModules/testing_cpp.cmake
common/cpp/src/system_io_linux.cpp
+2
-6
2 additions, 6 deletions
common/cpp/src/system_io_linux.cpp
tests/system_io/CMakeLists.txt
+4
-29
4 additions, 29 deletions
tests/system_io/CMakeLists.txt
with
30 additions
and
36 deletions
CMakeModules/testing_cpp.cmake
+
24
−
1
View file @
b2f63059
...
...
@@ -20,7 +20,7 @@ function(gtest target test_source_files test_libraries)
if
(
CMAKE_COMPILER_IS_GNUCXX
)
include
(
CodeCoverage
)
APPEND_COVERAGE_COMPILER_FLAGS
()
set
(
COVERAGE_EXCLUDES '*/unittests/*'
)
set
(
COVERAGE_EXCLUDES '*/unittests/*'
)
SETUP_TARGET_FOR_COVERAGE
(
NAME coverage-
${
target
}
EXECUTABLE test-
${
target
}
${
target
}
)
add_test
(
NAME coveragetest-
${
target
}
COMMAND
${
CMAKE_MODULE_PATH
}
/check_test.sh
...
...
@@ -32,3 +32,26 @@ function(gtest target test_source_files test_libraries)
endif
()
endif
()
endfunction
()
function
(
add_test_setup_cleanup exename
)
if
(
BUILD_TESTS
)
add_test
(
NAME test-
${
exename
}
-setup COMMAND bash
${
CMAKE_CURRENT_SOURCE_DIR
}
/setup.sh
)
add_test
(
NAME test-
${
exename
}
-cleanup COMMAND bash
${
CMAKE_CURRENT_SOURCE_DIR
}
/cleanup.sh
)
set_tests_properties
(
test-
${
exename
}
-setup PROPERTIES FIXTURES_SETUP test-
${
exename
}
-fixture
)
set_tests_properties
(
test-
${
exename
}
-cleanup PROPERTIES FIXTURES_CLEANUP test-
${
exename
}
-fixture
)
endif
()
endfunction
()
function
(
add_integration_test exename testname commandargs
)
if
(
BUILD_TESTS
)
set
(
args
${
commandargs
}
)
separate_arguments
(
args
)
add_test
(
NAME test-
${
exename
}
-
${
testname
}
COMMAND
${
exename
}
${
args
}
)
set_tests_properties
(
test-
${
exename
}
-
${
testname
}
PROPERTIES
LABELS
"integration;all"
FIXTURES_REQUIRED test-
${
exename
}
-fixture
)
endif
()
endfunction
()
This diff is collapsed.
Click to expand it.
common/cpp/src/system_io_linux.cpp
+
2
−
6
View file @
b2f63059
...
...
@@ -83,17 +83,13 @@ void CollectFileInformationRecursivly(const std::string& path,
if
(
IsDirectory
(
current_entity
))
{
CollectFileInformationRecursivly
(
path
+
"/"
+
current_entity
->
d_name
,
files
,
err
);
if
(
*
err
!=
IOErrors
::
NO_ERROR
)
{
closedir
(
dir
);
return
;
}
}
else
{
ProcessFileEntity
(
current_entity
,
path
,
files
,
err
);
}
ProcessFileEntity
(
current_entity
,
path
,
files
,
err
);
if
(
*
err
!=
IOErrors
::
NO_ERROR
)
{
closedir
(
dir
);
return
;
}
}
*
err
=
IOErrorFromErrno
();
closedir
(
dir
);
...
...
This diff is collapsed.
Click to expand it.
tests/system_io/CMakeLists.txt
+
4
−
29
View file @
b2f63059
...
...
@@ -13,33 +13,8 @@ set_target_properties(${TARGET_NAME} PROPERTIES LINKER_LANGUAGE CXX)
# Testing
################################
add_test
(
NAME test-
${
TARGET_NAME
}
-create_list COMMAND
${
TARGET_NAME
}
test 23subtest/subtest241
)
add_test
(
NAME test-
${
TARGET_NAME
}
-foldernotfound COMMAND
${
TARGET_NAME
}
test_notexist notfound
)
add_test
(
NAME test-
${
TARGET_NAME
}
-foldernoaccess COMMAND
${
TARGET_NAME
}
test_noaccess noaccess
)
set_tests_properties
(
test-
${
TARGET_NAME
}
-create_list PROPERTIES
LABELS
"integration;all"
FIXTURES_REQUIRED
${
TARGET_NAME
}
-fixture
)
set_tests_properties
(
test-
${
TARGET_NAME
}
-foldernotfound PROPERTIES
LABELS
"integration;all"
# FIXTURES_REQUIRED ${TARGET_NAME}-fixture
)
set_tests_properties
(
test-
${
TARGET_NAME
}
-foldernoaccess PROPERTIES
LABELS
"integration;all"
FIXTURES_REQUIRED
${
TARGET_NAME
}
-fixture
)
add_test
(
NAME test-
${
TARGET_NAME
}
-setup COMMAND bash
${
CMAKE_CURRENT_SOURCE_DIR
}
/setup.sh
)
add_test
(
NAME test-
${
TARGET_NAME
}
-cleanup COMMAND bash
${
CMAKE_CURRENT_SOURCE_DIR
}
/cleanup.sh
)
set_tests_properties
(
test-
${
TARGET_NAME
}
-setup PROPERTIES FIXTURES_SETUP
${
TARGET_NAME
}
-fixture
)
set_tests_properties
(
test-
${
TARGET_NAME
}
-cleanup PROPERTIES FIXTURES_CLEANUP
${
TARGET_NAME
}
-fixture
)
add_test_setup_cleanup
(
${
TARGET_NAME
}
)
add_integration_test
(
${
TARGET_NAME
}
create_list
"test 23subtest/subtest241"
)
add_integration_test
(
${
TARGET_NAME
}
foldernotfound
"test_notexist notfound"
)
add_integration_test
(
${
TARGET_NAME
}
foldernoaccess
"test_noaccess noaccess"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment