Wang Lin 201090174

Dependencies:   mbed Gamepad N5110 FXOS8700Q

tests.h

Committer:
valavanisalex
Date:
2018-04-16
Revision:
9:6e8964c19459

File content as of revision 9:6e8964c19459:

#ifndef TESTS_H
#define TESTS_H

#include "Ball-test.h"

/**
 * @brief Run all the tests for this program
 *
 * @returns The number of tests that failed
 */
int run_all_tests()
{
    int n_tests_failed = 0;

    // Run the Ball_check_movement test
    printf("Testing Ball_check_movement...\n");
    bool this_test_passed = Ball_test_movement();
    
    if (this_test_passed) {
        printf("...Passed!\n");
    }
    else {
        printf("...FAILED!\n");
        ++n_tests_failed; // Increment number of failures
    }


    // Repeat the above for each testing function...

    if (n_tests_failed > 0) {
        printf("%d tests FAILED!\n", n_tests_failed);
    }
    else {
        printf("All tests passed!\n");
    }

    return n_tests_failed;
}

#endif