Skip to content

Commit 2b13460

Browse files
committed
travis updated to bionic. run tests quietly (only print errors)
1 parent 9571fde commit 2b13460

2 files changed

Lines changed: 34 additions & 22 deletions

File tree

.travis.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
language: cpp
22
compiler: g++
3-
dist: xenial
3+
dist: bionic
4+
5+
install: make get-deps
46

57
addons:
68
apt:
79
sources:
8-
- sourceline: 'ppa:ubuntu-toolchain-r/test'
10+
- ubuntu-toolchain-r-test
911
- sourceline: 'ppa:mhier/libboost-latest'
1012
packages:
1113
- g++-8
@@ -24,10 +26,10 @@ before_install:
2426
script:
2527
- mkdir build_debug
2628
- cd build_debug
27-
- CC=/usr/bin/gcc-8 CXX=/usr/bin/g++-8 cmake .. -DCMAKE_BUILD_TYPE=Debug -DABY_BUILD_EXE=On
28-
- make
29-
- ./bin/abytest -r 0 &
30-
- ./bin/abytest -r 1
29+
- CC=gcc-8 CXX=g++-8 cmake .. -DCMAKE_BUILD_TYPE=Debug -DABY_BUILD_EXE=On
30+
- make -j 2
31+
- ./bin/abytest -r 0 -q &
32+
- ./bin/abytest -r 1 -q
3133

3234
notifications:
3335
- email: false

src/test/abytest.cpp

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ int32_t test_standard_ops(aby_ops_t* test_ops, ABYParty* party, uint32_t bitlen,
151151
vector<Sharing*>& sharings = party->GetSharings();
152152
Circuit *bc, *yc, *ac;
153153

154+
if (quiet) {std::cout << "Running operation test quietly."<< std::endl;}
155+
154156
for (uint32_t r = 0; r < num_test_runs; r++) {
155157
for (uint32_t i = 0; i < nops; i++) {
156158
Circuit* circ = sharings[test_ops[i].sharing]->GetCircuitBuildRoutine();
@@ -286,8 +288,7 @@ int32_t test_standard_ops(aby_ops_t* test_ops, ABYParty* party, uint32_t bitlen,
286288
shrout = circ->PutOUTGate(shrres, ALL);
287289

288290
if (!quiet){
289-
std::cout << "Running test no. " << i << " on operation " << test_ops[i].opname;
290-
std::cout << std::endl;
291+
std::cout << "Running test no. " << i << " on operation " << test_ops[i].opname << std::endl;
291292
}
292293

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

302-
if(!ignore_verification){
303-
assert(verify == c);
303+
if (!ignore_verification) {
304+
if (verify != c) {
305+
std::cerr << "ERROR in test verification! " << std::endl;
306+
std::cerr << get_role_name(role) << " " << test_ops[i].opname << ": values: a = " << a
307+
<< ", b = " << b << ", c = " << c << ", verify = " << verify << std::endl;
308+
exit(EXIT_FAILURE);
309+
}
304310
}
305311
}
306312
}
@@ -550,24 +556,31 @@ int32_t test_vector_ops(aby_ops_t* test_ops, ABYParty* party, uint32_t bitlen, u
550556

551557
party->Reset();
552558
for (uint32_t j = 0; j < nvals; j++) {
553-
if (!quiet)
559+
if (!quiet){
554560
std::cout << "\t" << get_role_name(role) << " " << test_ops[i].opname << ": values[" << j <<
555561
"]: a = " << avec[j] << ", b = " << bvec[j] << ", c = " << cvec[j] << ", verify = " <<
556562
verifyvec[j] << std::endl;
563+
}
557564
if(!ignore_verification){
558-
assert(verifyvec[j] == cvec[j]);
565+
if(verifyvec[j] != cvec[j]){
566+
std::cerr << "ERROR in test verification! " << std::endl;
567+
std::cerr << "\t" << get_role_name(role) << " " << test_ops[i].opname << ": values[" << j <<
568+
"]: a = " << avec[j] << ", b = " << bvec[j] << ", c = " << cvec[j] << ", verify = " <<
569+
verifyvec[j] << std::endl;
570+
exit(EXIT_FAILURE);
571+
}
559572
}
560-
573+
561574
}
562-
free(cvec);
575+
std::free(cvec);
563576
}
564577
}
565578

566-
free(sa);
567-
free(sb);
568-
free(avec);
569-
free(bvec);
570-
free(verifyvec);
579+
std::free(sa);
580+
std::free(sb);
581+
std::free(avec);
582+
std::free(bvec);
583+
std::free(verifyvec);
571584

572585
return EXIT_SUCCESS;
573586

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

615628
return EXIT_SUCCESS;
616629
}
617-
618-
619-

0 commit comments

Comments
 (0)