Changeset 9eb1ff5 in mainline for uspace/lib/pcut/src/os/helenos.c


Ignore:
Timestamp:
2017-12-08T14:47:08Z (7 years ago)
Author:
Vojtech Horky <vojtech.horky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c1694b6b
Parents:
6fb8b2c
Message:

Update PCUT

Updated PCUT to commit 7ce059f.

Notable changes include:

  • overall summary is printed when tests finish
  • when tests passed, the status message does not use the word 'failure'
  • program exit code is zero only when all tests passed

These changes fixes tickets 713 and 714.

http://www.helenos.org/ticket/713
http://www.helenos.org/ticket/714

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/pcut/src/os/helenos.c

    r6fb8b2c r9eb1ff5  
    154154 * @param test Test to be run.
    155155 */
    156 void pcut_run_test_forking(const char *self_path, pcut_item_t *test) {
     156int pcut_run_test_forking(const char *self_path, pcut_item_t *test) {
    157157        before_test_start(test);
    158158
     
    161161        int tempfile = vfs_lookup_open(tempfile_name, WALK_REGULAR | WALK_MAY_CREATE, MODE_READ | MODE_WRITE);
    162162        if (tempfile < 0) {
    163                 pcut_report_test_done(test, TEST_OUTCOME_ERROR, "Failed to create temporary file.", NULL, NULL);
    164                 return;
     163                pcut_report_test_done(test, PCUT_OUTCOME_INTERNAL_ERROR, "Failed to create temporary file.", NULL, NULL);
     164                return PCUT_OUTCOME_INTERNAL_ERROR;
    165165        }
    166166
     
    174174        };
    175175
    176         int status = TEST_OUTCOME_PASS;
     176        int status = PCUT_OUTCOME_PASS;
    177177
    178178        task_wait_t test_task_wait;
     
    180180            fileno(stdin), tempfile, tempfile);
    181181        if (rc != EOK) {
    182                 status = TEST_OUTCOME_ERROR;
     182                status = PCUT_OUTCOME_INTERNAL_ERROR;
    183183                goto leave_close_tempfile;
    184184        }
     
    198198        rc = task_wait(&test_task_wait, &task_exit, &task_retval);
    199199        if (rc != EOK) {
    200                 status = TEST_OUTCOME_ERROR;
     200                status = PCUT_OUTCOME_INTERNAL_ERROR;
    201201                goto leave_close_tempfile;
    202202        }
    203203        if (task_exit == TASK_EXIT_UNEXPECTED) {
    204                 status = TEST_OUTCOME_ERROR;
     204                status = PCUT_OUTCOME_INTERNAL_ERROR;
    205205        } else {
    206                 status = task_retval == 0 ? TEST_OUTCOME_PASS : TEST_OUTCOME_FAIL;
     206                status = task_retval == 0 ? PCUT_OUTCOME_PASS : PCUT_OUTCOME_FAIL;
    207207        }
    208208
     
    221221
    222222        pcut_report_test_done_unparsed(test, status, extra_output_buffer, OUTPUT_BUFFER_SIZE);
     223
     224        return status;
    223225}
    224226
Note: See TracChangeset for help on using the changeset viewer.