Add a working test suite for distance

Add a working test suite for distance runtime algorithm. The test only
is compile only (the distance correctness is supposed to be covered in
an other test suite).