According to Bill Frindall, The phrase 'test match' was coined in 1861-62 during the very first cricket tour of Australia. The contests between HH Stephenson's English team and each of the Australian colonies were described as 'test matches'.
Why 'test'? Probably because they provided the first opportunity to test the relative skills of English and Australian cricketers. They could easily have been described as 'trials'.