forked from Ericsson/CodeCompass
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance test project and fix C++ test expectations
- Added notification about setting `TEST_DB` CMake configuration variable at creation of project build folder. If missing, the user is given a warning on the command-line too. C++-specific: - There was a test for the C++ references where the comment rightfully said 8 expected references, but only 7 was in the code. This has been fixed. - Better output from the `cpptest` binary and explained what the arguments given mean.
- Loading branch information
1 parent
5981349
commit 81ebd3b
Showing
9 changed files
with
116 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Testing-specific configurations and setup calls. | ||
|
||
if (NOT DEFINED TEST_DB) | ||
set(FUNCTIONAL_TESTING_ENABLED | ||
FALSE | ||
CACHE INTERNAL | ||
"Whether testing executable functionality was configured for the build.") | ||
|
||
message(WARNING "TEST_DB variable not set. Skipping generation of functional \ | ||
tests... To enable, set a database connection string which \ | ||
can be used for the parsing of the test projects' files.") | ||
else() | ||
enable_testing() | ||
|
||
# Initialize the variable in the cache and mark it as a string. | ||
set(TEST_DB "" CACHE STRING | ||
"Database connection string used in running functional tests.") | ||
|
||
set(FUNCTIONAL_TESTING_ENABLED | ||
TRUE | ||
CACHE INTERNAL | ||
"Whether testing executable functionality was configured for the build.") | ||
|
||
# Ensure that if TEST_DB is set, then it uses the database backend CodeCompass | ||
# will be built with. | ||
string(FIND "${TEST_DB}" "${DATABASE}:" testDbUsesProperBackend) | ||
if (NOT TEST_DB STREQUAL "" AND NOT testDbUsesProperBackend EQUAL 0) | ||
string(FIND "${TEST_DB}" ":" findPos) | ||
string(SUBSTRING "${TEST_DB}" 0 ${findPos} testDbBackend) | ||
message("${testDbBackend}") | ||
message(FATAL_ERROR "CodeCompass is being built with database backend \ | ||
'${DATABASE}', but TEST_DB was set to use \ | ||
'${testDbBackend}'. The same database system must be \ | ||
used, otherwise the tests won't run.") | ||
endif() | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
cmake_minimum_required(VERSION 2.6) | ||
project(CppTestProject) | ||
|
||
# This is a dummy CMakeList that can be used to generate a build for the | ||
# C++ test input files. | ||
|
||
add_library(CppTestProject STATIC | ||
inheritance.cpp | ||
nestedclass.cpp | ||
simpleclass.cpp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters