Skip to content

Commit

Permalink
travis updated to bionic. run tests quietly (only print errors)
Browse files Browse the repository at this point in the history
  • Loading branch information
dd23 committed Jul 29, 2019
1 parent 9571fde commit 2b13460
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 22 deletions.
14 changes: 8 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
language: cpp
compiler: g++
dist: xenial
dist: bionic

install: make get-deps

addons:
apt:
sources:
- sourceline: 'ppa:ubuntu-toolchain-r/test'
- ubuntu-toolchain-r-test
- sourceline: 'ppa:mhier/libboost-latest'
packages:
- g++-8
Expand All @@ -24,10 +26,10 @@ before_install:
script:
- mkdir build_debug
- cd build_debug
- CC=/usr/bin/gcc-8 CXX=/usr/bin/g++-8 cmake .. -DCMAKE_BUILD_TYPE=Debug -DABY_BUILD_EXE=On
- make
- ./bin/abytest -r 0 &
- ./bin/abytest -r 1
- CC=gcc-8 CXX=g++-8 cmake .. -DCMAKE_BUILD_TYPE=Debug -DABY_BUILD_EXE=On
- make -j 2
- ./bin/abytest -r 0 -q &
- ./bin/abytest -r 1 -q

notifications:
- email: false
42 changes: 26 additions & 16 deletions src/test/abytest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ int32_t test_standard_ops(aby_ops_t* test_ops, ABYParty* party, uint32_t bitlen,
vector<Sharing*>& sharings = party->GetSharings();
Circuit *bc, *yc, *ac;

if (quiet) {std::cout << "Running operation test quietly."<< std::endl;}

for (uint32_t r = 0; r < num_test_runs; r++) {
for (uint32_t i = 0; i < nops; i++) {
Circuit* circ = sharings[test_ops[i].sharing]->GetCircuitBuildRoutine();
Expand Down Expand Up @@ -286,8 +288,7 @@ int32_t test_standard_ops(aby_ops_t* test_ops, ABYParty* party, uint32_t bitlen,
shrout = circ->PutOUTGate(shrres, ALL);

if (!quiet){
std::cout << "Running test no. " << i << " on operation " << test_ops[i].opname;
std::cout << std::endl;
std::cout << "Running test no. " << i << " on operation " << test_ops[i].opname << std::endl;
}

party->ExecCircuit();
Expand All @@ -299,8 +300,13 @@ int32_t test_standard_ops(aby_ops_t* test_ops, ABYParty* party, uint32_t bitlen,
}
party->Reset();

if(!ignore_verification){
assert(verify == c);
if (!ignore_verification) {
if (verify != c) {
std::cerr << "ERROR in test verification! " << std::endl;
std::cerr << get_role_name(role) << " " << test_ops[i].opname << ": values: a = " << a
<< ", b = " << b << ", c = " << c << ", verify = " << verify << std::endl;
exit(EXIT_FAILURE);
}
}
}
}
Expand Down Expand Up @@ -550,24 +556,31 @@ int32_t test_vector_ops(aby_ops_t* test_ops, ABYParty* party, uint32_t bitlen, u

party->Reset();
for (uint32_t j = 0; j < nvals; j++) {
if (!quiet)
if (!quiet){
std::cout << "\t" << get_role_name(role) << " " << test_ops[i].opname << ": values[" << j <<
"]: a = " << avec[j] << ", b = " << bvec[j] << ", c = " << cvec[j] << ", verify = " <<
verifyvec[j] << std::endl;
}
if(!ignore_verification){
assert(verifyvec[j] == cvec[j]);
if(verifyvec[j] != cvec[j]){
std::cerr << "ERROR in test verification! " << std::endl;
std::cerr << "\t" << get_role_name(role) << " " << test_ops[i].opname << ": values[" << j <<
"]: a = " << avec[j] << ", b = " << bvec[j] << ", c = " << cvec[j] << ", verify = " <<
verifyvec[j] << std::endl;
exit(EXIT_FAILURE);
}
}

}
free(cvec);
std::free(cvec);
}
}

free(sa);
free(sb);
free(avec);
free(bvec);
free(verifyvec);
std::free(sa);
std::free(sb);
std::free(avec);
std::free(bvec);
std::free(verifyvec);

return EXIT_SUCCESS;

Expand Down Expand Up @@ -614,6 +627,3 @@ int32_t read_test_options(int32_t* argcp, char*** argvp, e_role* role, uint32_t*

return EXIT_SUCCESS;
}



0 comments on commit 2b13460

Please sign in to comment.