Changeset 9b20126 in mainline for uspace/lib/pcut/src/os/unix.c


Ignore:
Timestamp:
2014-09-19T08:23:01Z (10 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c85a57f
Parents:
15d0046
Message:

Update PCUT to newest version

File:
1 edited

Legend:

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

    r15d0046 r9b20126  
    3232 */
    3333
    34 /** We need _POSX_SOURCE because of kill(). */
     34/** We need _POSIX_SOURCE because of kill(). */
    3535#define _POSIX_SOURCE
     36/** We need _BSD_SOURCE because of snprintf() when compiling under C89. */
     37#define _BSD_SOURCE
    3638#include <stdlib.h>
    3739#include <unistd.h>
     
    137139 */
    138140void pcut_run_test_forking(const char *self_path, pcut_item_t *test) {
     141        int link_stdout[2], link_stderr[2];
     142        int rc, status;
     143        size_t stderr_size;
     144
    139145        PCUT_UNUSED(self_path);
    140146
    141147        before_test_start(test);
    142148
    143         int link_stdout[2], link_stderr[2];
    144 
    145         int rc = pipe(link_stdout);
     149
     150        rc = pipe(link_stdout);
    146151        if (rc == -1) {
    147152                snprintf(error_message_buffer, OUTPUT_BUFFER_SIZE - 1,
     
    184189        alarm(pcut_get_test_timeout(test));
    185190
    186         size_t stderr_size = read_all(link_stderr[0], extra_output_buffer, OUTPUT_BUFFER_SIZE - 1);
     191        stderr_size = read_all(link_stderr[0], extra_output_buffer, OUTPUT_BUFFER_SIZE - 1);
    187192        read_all(link_stdout[0], extra_output_buffer, OUTPUT_BUFFER_SIZE - 1 - stderr_size);
    188193
    189         int status;
    190194        wait(&status);
    191195        alarm(0);
     
    204208        pcut_report_test_done_unparsed(test, rc, extra_output_buffer, OUTPUT_BUFFER_SIZE);
    205209}
     210
     211void pcut_hook_before_test(pcut_item_t *test) {
     212        PCUT_UNUSED(test);
     213
     214        /* Do nothing. */
     215}
     216
Note: See TracChangeset for help on using the changeset viewer.