forked from Ericsson/codechecker
-
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.
added cleanup for the temporary test package and documentation update
- Loading branch information
Gyorgy Orban
committed
Jun 1, 2016
1 parent
7326a36
commit 18cea7c
Showing
7 changed files
with
88 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "Removing temporary directory created for testing: " $TEST_CODECHECKER_PACKAGE_DIR | ||
|
||
rm -rf $TEST_CODECHECKER_PACKAGE_DIR | ||
|
||
echo "Unsetting environment variables used for testing" | ||
unset TEST_TESTS_DIR | ||
unset TEST_CODECHECKER_PACKAGE_DIR | ||
unset TEST_CODECHECKER_DIR | ||
unset TEST_CLANG_VERSION | ||
unset TEST_TEST_PROJECT_CONFIG |
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 |
---|---|---|
@@ -1,7 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
# setup environment variables, temporary directories | ||
. tests/test_env_setup.sh | ||
|
||
# build the package used for the tests | ||
./build_package.py -o $TEST_CODECHECKER_PACKAGE_DIR -v | ||
|
||
# run all the tests | ||
nosetests tests/test_packages/ | ||
|
||
# cleanup the environment variables and temporary | ||
# directories | ||
clean_tests.sh | ||
|
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,63 @@ | ||
# How to run the tests | ||
|
||
## Rrequirements | ||
|
||
Additionaly to the package building requirements the python nosetest running framework is required. | ||
|
||
~~~~~~{.sh} | ||
# source the already created python virtualenv for package building | ||
source ~/checker_env/bin/activate | ||
# install nosetest | ||
pip install nose | ||
~~~~~~ | ||
|
||
## Running the tests | ||
|
||
To run the tests call the run_test.sh script. | ||
It will build a package, and run the all the unit and functional tests. | ||
~~~~~~{.sh} | ||
run_tests.sh | ||
~~~~~~ | ||
|
||
## More detailed test running | ||
~~~~~~{.sh} | ||
# setup some required environment variables to run the tests | ||
# create temporary directories | ||
source tests/test_env_setup.sh | ||
# build the CodeChecker package | ||
build_package.py -o $TEST_CODECHECKER_PACKAGE_DIR -v | ||
# do not use PostgreSQL for running the tests (SQLite will be used) | ||
export TEST_USE_POSTGRESQL=false | ||
# run all the tests | ||
nosetests tests/test_packages/ | ||
# run only the unittests | ||
nosetests tests/test_packages/unit | ||
# run only the functional tests | ||
nosetests tests/test_packages/functional | ||
# remove the temporary directories and unset the environment variables | ||
# set by sourcing the test_env_setup.sh script | ||
clean_tests.sh | ||
~~~~~~ | ||
|
||
### Testing with PostgresSQL database backend | ||
|
||
To run the tests with PostgreSQL backend set these environment variables: | ||
~~~~~~{.sh} | ||
export TEST_USE_POSTGRESQL=true | ||
~~~~~~ | ||
|
||
Multiple PostgreSQL database drivers are supported (psycopg2, pg8000). | ||
Select explicitly a database driver to used for testing. | ||
~~~~~~{.sh} | ||
export CODECHECKER_DB_DRIVER=psycopg2 | ||
~~~~~~ | ||
|
||
At least one of the database drivers needs to be available to use the PostgreSQL database backend. | ||
Psycopg2 is used by default if not found pg8000 is used. |
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 was deleted.
Oops, something went wrong.