Skip to content

Commit

Permalink
#603: Update github-ci for cmake pyclustering build-test job.
Browse files Browse the repository at this point in the history
  • Loading branch information
annoviko committed Nov 11, 2020
1 parent f326a4b commit faeb4fa
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 18 deletions.
36 changes: 18 additions & 18 deletions ccore/bvt/shared-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,28 +56,28 @@


const std::unordered_map<int, std::string> EXIT_CODE_DESCRIPTION = {
{ SUCCESS, "Build verification test for C++ pyclustering shared library is successfully passed." },
{ FAILURE_IMPOSSIBLE_TO_LOAD_LIBRARY, "Error: Impossible to load C++ pyclustering shared library." },
{ FAILURE_IMPOSSIBLE_TO_LOAD_FUNCTION, "Error: Impossible to load function from C++ pyclustering shared library." },
{ FAILURE_IMPOSSIBLE_TO_CHECK_VERSION, "Error: Impossible to check version of C++ pyclustering shared library." },
{ FAILURE_IMPOSSIBLE_TO_CHECK_DESCRIPTION, "Error: Impossible to check description of C++ pyclustering shared library." },
{ FAILURE_INCORRECT_VERSION, "Error: C++ pyclustering library contains wrong version." },
{ FAILURE_INCORRECT_DESCRIPTION, "Error: C++ pyclustering library contains wrong description." }
{ SUCCESS, "Build verification test for C++ pyclustering shared library is successfully passed." },
{ FAILURE_IMPOSSIBLE_TO_LOAD_LIBRARY, "Error: Impossible to load C++ pyclustering shared library." },
{ FAILURE_IMPOSSIBLE_TO_LOAD_FUNCTION, "Error: Impossible to load function from C++ pyclustering shared library." },
{ FAILURE_IMPOSSIBLE_TO_CHECK_VERSION, "Error: Impossible to check version of C++ pyclustering shared library." },
{ FAILURE_IMPOSSIBLE_TO_CHECK_DESCRIPTION, "Error: Impossible to check description of C++ pyclustering shared library." },
{ FAILURE_INCORRECT_VERSION, "Error: C++ pyclustering library contains wrong version." },
{ FAILURE_INCORRECT_DESCRIPTION, "Error: C++ pyclustering library contains wrong description." }
};


void exit_with_code(const int p_code) {
const auto iter = EXIT_CODE_DESCRIPTION.find(p_code);
if (iter != EXIT_CODE_DESCRIPTION.cend()) {
if (p_code != SUCCESS) {
std::cerr << iter->second << std::endl;
}
else {
std::cout << iter->second << std::endl;
}
}

std::exit(p_code);
const auto iter = EXIT_CODE_DESCRIPTION.find(p_code);
if (iter != EXIT_CODE_DESCRIPTION.cend()) {
if (p_code != SUCCESS) {
std::cerr << iter->second << std::endl;
}
else {
std::cout << iter->second << std::endl;
}
}

std::exit(p_code);
}


Expand Down
12 changes: 12 additions & 0 deletions ci/github-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ print_info() {
}


check_failure() {
if [ $? -ne 0 ] ; then
if [ -z $1 ] ; then
print_error $1
else
print_error "Failure exit code is detected."
fi
exit 1
fi
}


run_pypi_install_job() {
print_info "PyPi Installer Testing."
print_info "- Download and install the library using pip3."
Expand Down

0 comments on commit faeb4fa

Please sign in to comment.