Changeset 4b54bd9 in mainline for uspace/lib/pcut/src/run.c


Ignore:
Timestamp:
2018-09-12T13:23:03Z (6 years ago)
Author:
Vojtech Horky <vojtech.horky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3da0ee4
Parents:
275530a4
Message:

Update PCUT to latest revision

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/pcut/src/run.c

    r275530a4 r4b54bd9  
    3333
    3434#include "internal.h"
     35
    3536#ifndef PCUT_NO_LONG_JUMP
     37#pragma warning(push, 0)
    3638#include <setjmp.h>
     39#pragma warning(pop)
    3740#endif
    3841
     
    7376static int default_suite_initialized = 0;
    7477
    75 static void init_default_suite_when_needed()
    76 {
     78static void init_default_suite_when_needed() {
    7779        if (default_suite_initialized) {
    7880                return;
     
    9294 * @return Always a valid test suite item.
    9395 */
    94 static pcut_item_t *pcut_find_parent_suite(pcut_item_t *it)
    95 {
     96static pcut_item_t *pcut_find_parent_suite(pcut_item_t *it) {
    9697        while (it != NULL) {
    9798                if (it->kind == PCUT_KIND_TESTSUITE) {
     
    108109 * @param func Function to run (can be NULL).
    109110 */
    110 static void run_setup_teardown(pcut_setup_func_t func)
    111 {
     111static void run_setup_teardown(pcut_setup_func_t func) {
    112112        if (func != NULL) {
    113113                func();
     
    122122 * @param outcome Outcome of the current test.
    123123 */
    124 static void leave_test(int outcome)
    125 {
     124static void leave_test(int outcome) {
    126125        PCUT_DEBUG("leave_test(outcome=%d), will_exit=%s", outcome,
    127             leave_means_exit ? "yes" : "no");
     126                leave_means_exit ? "yes" : "no");
    128127        if (leave_means_exit) {
    129128                exit(outcome);
     
    142141 * @param message Message describing the failure.
    143142 */
    144 void pcut_failed_assertion(const char *message)
    145 {
     143void pcut_failed_assertion(const char *message) {
    146144        static const char *prev_message = NULL;
    147145        /*
     
    162160                if (report_test_result) {
    163161                        pcut_report_test_done(current_test, PCUT_OUTCOME_FAIL,
    164                             message, NULL, NULL);
     162                                message, NULL, NULL);
    165163                }
    166164        } else {
    167165                if (report_test_result) {
    168166                        pcut_report_test_done(current_test, PCUT_OUTCOME_FAIL,
    169                             prev_message, message, NULL);
     167                                prev_message, message, NULL);
    170168                }
    171169        }
     
    181179 * @return Error status (zero means success).
    182180 */
    183 static int run_test(pcut_item_t *test)
    184 {
     181static int run_test(pcut_item_t *test) {
    185182        /*
    186183         * Set here as the returning point in case of test failure.
     
    234231        if (report_test_result) {
    235232                pcut_report_test_done(current_test, PCUT_OUTCOME_PASS,
    236                     NULL, NULL, NULL);
     233                        NULL, NULL, NULL);
    237234        }
    238235
     
    248245 * @return Error status (zero means success).
    249246 */
    250 int pcut_run_test_forked(pcut_item_t *test)
    251 {
     247int pcut_run_test_forked(pcut_item_t *test) {
    252248        int rc;
    253249
     
    272268 * @return Error status (zero means success).
    273269 */
    274 int pcut_run_test_single(pcut_item_t *test)
    275 {
     270int pcut_run_test_single(pcut_item_t *test) {
    276271        int rc;
    277272
     
    293288 * @return Timeout in seconds.
    294289 */
    295 int pcut_get_test_timeout(pcut_item_t *test)
    296 {
     290int pcut_get_test_timeout(pcut_item_t *test) {
    297291        int timeout = PCUT_DEFAULT_TEST_TIMEOUT;
    298292        pcut_extra_t *extras = test->extras;
Note: See TracChangeset for help on using the changeset viewer.