Skip to content

Commit

Permalink
Make sure that the test binding actually makes any output at all!
Browse files Browse the repository at this point in the history
  • Loading branch information
rcurtin committed Apr 24, 2024
1 parent 7d54cfb commit ed77e91
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/mlpack/bindings/R/mlpack/tests/testthat/test-R_binding.R
Original file line number Diff line number Diff line change
Expand Up @@ -319,19 +319,19 @@ test_that("TestSerialization", {
# Make sure that the verbose argument does anything at all.
test_that("TestVerbose", {
expect_output(test_r_binding(4.0, 12, "hello",
build_model=TRUE,
verbose=TRUE))
build_model=TRUE,
verbose=TRUE))
})

# Test that we get no output when verbose output is disabled.
test_that("TestNotVerbose", {
expect_silent(test_r_binding(4.0, 12, "hello",
build_model=TRUE))
build_model=TRUE))
})

# Test that we get no output when verbose output is explicitly disabled.
test_that("TestReallyNotVerbose", {
expect_silent(test_r_binding(4.0, 12, "hello",
build_model=TRUE,
verbose=FALSE))
build_model=TRUE,
verbose=FALSE))
})
3 changes: 3 additions & 0 deletions src/mlpack/bindings/R/tests/test_r_binding_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,7 @@ void BINDING_FUNCTION(util::Params& params, util::Timers& /* timers */)
params.Get<double>("model_bw_out") =
params.Get<GaussianKernel*>("model_in")->Bandwidth() * 2.0;
}

// Provide some output if the user asked for it.
Log::Info << "Here is some verbose output!" << std::endl;
}

0 comments on commit ed77e91

Please sign in to comment.