Skip to content

Commit

Permalink
Merge pull request #262 from pieterdavid/tests_exitlater
Browse files Browse the repository at this point in the history
Tests: exit a bit later (for a more detailed report)
  • Loading branch information
OlivierBondu authored Sep 26, 2017
2 parents b1458db + 84e904b commit 3e56d6b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
12 changes: 7 additions & 5 deletions bin/testFrameworkOutput.cc
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ TEST_CASE("Check if trees are equals", "[diff]") {
std::cout << " " << b << std::endl;
}
}
REQUIRE(test_tree->GetNbranches() == n_branches);
CHECK(test_tree->GetNbranches() == n_branches);

size_t entries = ref_tree->GetEntries();
REQUIRE(test_tree->GetEntries() == entries);
Expand All @@ -164,13 +164,15 @@ TEST_CASE("Check if trees are equals", "[diff]") {
ref_branch->GetEntry(entry);

TBranch* test_branch = test_tree->GetBranch(ref_branch->GetName());
REQUIRE(test_branch);
CHECK(test_branch);
if ( test_branch ) {

test_branch->GetEntry(entry);
test_branch->GetEntry(entry);

REQUIRE(test_branch->GetListOfBranches()->GetEntries() == ref_branch->GetListOfBranches()->GetEntries());
REQUIRE(test_branch->GetListOfBranches()->GetEntries() == ref_branch->GetListOfBranches()->GetEntries());

REQUIRE(diffBranches(entry, ref_branch, test_branch));
REQUIRE(diffBranches(entry, ref_branch, test_branch));
}
}
}
}
Expand Down
12 changes: 11 additions & 1 deletion test/run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#!/bin/bash

first_failure_status=0
first_failure_message=""
# Pass in name and status
function die { echo $1: status $2 ; exit $2; }
function die {
first_failure_message=$1
first_failure_status=$2
echo "${first_failure_message}: status ${first_failure_status}"
}

. download_dependencies.sh

Expand All @@ -16,3 +22,7 @@ F2=${LOCAL_TEST_DIR}/unit_tests_data.py
F3=${LOCAL_TEST_DIR}/unit_tests_mc_with_db.py
(cmsRun $F3 ) || die "Failure using $F3" $?
(cp3llbbTestFrameworkOutput ${LOCAL_TEST_DIR}/unit_tests_mc_with_db_ref.root output_mc.root) || die "Output file does not match reference file" $?

if [ ${first_failure_status} -ne 0 ]; then
exit $first_failure_status
fi

0 comments on commit 3e56d6b

Please sign in to comment.