Skip to content

Commit

Permalink
Add unit tests support (#2368)
Browse files Browse the repository at this point in the history
* Add support for unit testing

* Rename test py to functional tests

* Add test-cpp and test-rs

* Remove func test, rename to test-units

* Fix test func

* Minor refinements

---------

Co-authored-by: Prasanna Loganathar <[email protected]>
  • Loading branch information
sieniven and prasannavl authored Aug 23, 2023
1 parent 4b0725e commit ea7b180
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -462,15 +462,9 @@ fmt_lib() {
# ---

test() {
local make_jobs=${MAKE_JOBS}
local make_args=${MAKE_ARGS:-}
local build_target_dir=${BUILD_TARGET_DIR}

_ensure_enter_dir "${build_target_dir}"

_fold_start "unit-tests"
# shellcheck disable=SC2086
make -j$make_jobs check
test_unit
_fold_end

_fold_start "functional-tests"
Expand All @@ -481,6 +475,26 @@ test() {
_exit_dir
}

test_unit() {
test_cpp
test_rs
}

test_cpp() {
local make_jobs=${MAKE_JOBS}
local make_args=${MAKE_ARGS:-}
local build_target_dir=${BUILD_TARGET_DIR}

_ensure_enter_dir "${build_target_dir}"
# shellcheck disable=SC2086
make -j$make_jobs check "$@"
_exit_dir
}

test_rs() {
lib test "$@"
}

# shellcheck disable=SC2120
test_py() {
local build_target_dir=${BUILD_TARGET_DIR}
Expand Down

0 comments on commit ea7b180

Please sign in to comment.