Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/atf/dist Merge atf 0.8.



details:   https://anonhg.NetBSD.org/src/rev/34d4d95e0b32
branches:  trunk
changeset: 754679:34d4d95e0b32
user:      jmmv <jmmv%NetBSD.org@localhost>
date:      Sat May 08 08:11:03 2010 +0000

description:
Merge atf 0.8.

diffstat:

 external/bsd/atf/dist/atf-c/expand.c                        |  168 ---
 external/bsd/atf/dist/atf-c/expand.h                        |   44 -
 external/bsd/atf/dist/atf-c/signals.c                       |  168 ---
 external/bsd/atf/dist/atf-c/signals.h                       |   85 -
 external/bsd/atf/dist/atf-c/tc.c                            |  663 +-----------
 external/bsd/atf/dist/revision.h                            |    3 -
 external/bsd/atf/dist/tests/atf/atf-c/d_include_expand_h.c  |    1 -
 external/bsd/atf/dist/tests/atf/atf-c/d_include_signals_h.c |    1 -
 external/bsd/atf/dist/tests/atf/atf-c/t_expand.c            |  179 ---
 external/bsd/atf/dist/tests/atf/atf-c/t_signals.c           |  335 ------
 external/bsd/atf/dist/tests/atf/formats/d_tcs_1             |    3 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_1.errin       |    1 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_1.expout      |    2 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_1.outin       |    1 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_2             |    5 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_2.errin       |    2 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_2.expout      |    8 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_2.outin       |    2 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_3             |    9 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_3.errin       |    8 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_3.expout      |   20 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_3.outin       |    8 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_4             |   15 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_4.errin       |    5 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_4.expout      |   20 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_4.outin       |   11 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_5             |   15 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_5.errin       |   11 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_5.expout      |   20 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_5.outin       |    5 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_50            |    3 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_50.experr     |    1 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_51            |    3 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_51.experr     |    1 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_52            |    3 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_52.experr     |    1 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_53            |    4 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_53.experr     |    1 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_53.expout     |    1 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_54            |   18 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_54.experr     |    9 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_54.expout     |    1 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_55            |   15 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_55.experr     |   12 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_55.expout     |    2 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_56            |    7 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_56.errin      |    1 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_56.experr     |    1 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_56.expout     |    3 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_56.outin      |    1 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_57            |    5 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_57.errin      |    1 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_57.experr     |    1 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_57.expout     |    3 -
 external/bsd/atf/dist/tests/atf/formats/d_tcs_57.outin      |    1 -
 external/bsd/atf/dist/tests/atf/test_programs/t_cleanup.sh  |  131 --
 external/bsd/atf/dist/tests/atf/test_programs/t_env.sh      |   81 -
 external/bsd/atf/dist/tests/atf/test_programs/t_workdir.sh  |  155 --
 external/bsd/atf/dist/tests/atf/tools/Atffile               |   11 -
 external/bsd/atf/dist/tests/atf/tools/h_fail.cpp            |   45 -
 external/bsd/atf/dist/tests/atf/tools/h_misc.cpp            |  122 --
 external/bsd/atf/dist/tests/atf/tools/h_mode.cpp            |   53 -
 external/bsd/atf/dist/tests/atf/tools/h_pass.cpp            |   44 -
 external/bsd/atf/dist/tests/atf/tools/t_atf_check.sh        |  296 -----
 external/bsd/atf/dist/tests/atf/tools/t_atf_cleanup.sh      |  215 ---
 external/bsd/atf/dist/tests/atf/tools/t_atf_compile.sh      |  125 --
 external/bsd/atf/dist/tests/atf/tools/t_atf_config.sh       |  220 ---
 external/bsd/atf/dist/tests/atf/tools/t_atf_exec.sh         |  119 --
 external/bsd/atf/dist/tests/atf/tools/t_atf_report.sh       |  339 ------
 external/bsd/atf/dist/tests/atf/tools/t_atf_run.sh          |  468 --------
 external/bsd/atf/dist/tools/atf-check.1                     |  114 --
 external/bsd/atf/dist/tools/atf-check.cpp                   |  517 ---------
 external/bsd/atf/dist/tools/atf-cleanup.1                   |   69 -
 external/bsd/atf/dist/tools/atf-cleanup.cpp                 |   78 -
 external/bsd/atf/dist/tools/atf-compile.1                   |   69 -
 external/bsd/atf/dist/tools/atf-compile.cpp                 |  160 --
 external/bsd/atf/dist/tools/atf-config.1                    |  184 ---
 external/bsd/atf/dist/tools/atf-config.cpp                  |  141 --
 external/bsd/atf/dist/tools/atf-exec.1                      |   80 -
 external/bsd/atf/dist/tools/atf-exec.cpp                    |  236 ----
 external/bsd/atf/dist/tools/atf-format.1                    |   90 -
 external/bsd/atf/dist/tools/atf-format.cpp                  |  144 --
 external/bsd/atf/dist/tools/atf-host-compile.sh             |   88 -
 external/bsd/atf/dist/tools/atf-report.1                    |  166 ---
 external/bsd/atf/dist/tools/atf-report.cpp                  |  655 -----------
 external/bsd/atf/dist/tools/atf-run.1                       |  191 ---
 external/bsd/atf/dist/tools/atf-run.cpp                     |  642 -----------
 external/bsd/atf/dist/tools/atf-run.hooks                   |   94 -
 external/bsd/atf/dist/tools/atf-version.1                   |   56 -
 external/bsd/atf/dist/tools/atf-version.cpp                 |   89 -
 90 files changed, 26 insertions(+), 8178 deletions(-)

diffs (truncated from 8676 to 300 lines):

diff -r 0d3535dde052 -r 34d4d95e0b32 external/bsd/atf/dist/atf-c/expand.c
--- a/external/bsd/atf/dist/atf-c/expand.c      Sat May 08 08:05:13 2010 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,168 +0,0 @@
-/*
- * Automated Testing Framework (atf)
- *
- * Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
- * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
- * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <regex.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "atf-c/dynstr.h"
-#include "atf-c/error.h"
-#include "atf-c/expand.h"
-#include "atf-c/sanity.h"
-
-/* REG_BASIC is just a synonym for 0, provided as a counterpart to
- * REG_EXTENDED to improve readability.  It is not provided by all
- * systems. */
-#if !defined(REG_BASIC)
-#define REG_BASIC 0
-#endif /* !defined(REG_BASIC) */
-
-/* ---------------------------------------------------------------------
- * The "pattern" error type.
- * --------------------------------------------------------------------- */
-
-struct pattern_error_data {
-    int m_errcode;
-    regex_t m_preg;
-};
-typedef struct pattern_error_data pattern_error_data_t;
-
-static
-void
-pattern_format(const atf_error_t err, char *buf, size_t buflen)
-{
-    const pattern_error_data_t *data;
-    char tmp[4096];
-
-    PRE(atf_error_is(err, "pattern"));
-
-    data = atf_error_data(err);
-    regerror(data->m_errcode, &data->m_preg, tmp, sizeof(tmp));
-    snprintf(buf, buflen, "Regular expression error: %s", tmp);
-}
-
-static
-atf_error_t
-pattern_error(int errcode, const regex_t* preg)
-{
-    atf_error_t err;
-    pattern_error_data_t data;
-
-    data.m_errcode = errcode;
-    data.m_preg = *preg;
-
-    err = atf_error_new("pattern", &data, sizeof(data), pattern_format);
-
-    return err;
-}
-
-/* ---------------------------------------------------------------------
- * Auxiliary functions.
- * --------------------------------------------------------------------- */
-
-static
-atf_error_t
-glob_to_regex(const char *glob, atf_dynstr_t *regex)
-{
-    atf_error_t err;
-
-    err = atf_dynstr_init_fmt(regex, "^");
-
-    for (; !atf_is_error(err) && *glob != '\0'; glob++) {
-        if (*glob == '*')
-            err = atf_dynstr_append_fmt(regex, ".*");
-        else if (*glob == '?')
-            err = atf_dynstr_append_fmt(regex, ".");
-        else
-            err = atf_dynstr_append_fmt(regex, "%c", *glob);
-    }
-
-    if (!atf_is_error(err))
-        err = atf_dynstr_append_fmt(regex, "$");
-
-    if (atf_is_error(err))
-        atf_dynstr_fini(regex);
-
-    return err;
-}
-
-/* ---------------------------------------------------------------------
- * Free functions.
- * --------------------------------------------------------------------- */
-
-bool
-atf_expand_is_glob(const char *glob)
-{
-    /* NOTE: Keep this in sync with glob_to_regex! */
-    return (strchr(glob, '*') != NULL) || (strchr(glob, '?') != NULL);
-}
-
-atf_error_t
-atf_expand_matches_glob(const char *glob, const char *candidate,
-                        bool *result)
-{
-    atf_dynstr_t regex;
-    atf_error_t err;
-    int res;
-    regex_t preg;
-
-    /* Special case: regcomp does not like empty patterns. */
-    if (glob[0] == '\0') {
-        *result = candidate[0] == '\0';
-        err = atf_no_error();
-        goto out;
-    }
-
-    /* Convert the glob pattern into a regular expression. */
-    err = glob_to_regex(glob, &regex);
-    if (atf_is_error(err))
-        goto out;
-
-    /* Compile the regular expression. */
-    res = regcomp(&preg, atf_dynstr_cstring(&regex), REG_BASIC);
-    if (res != 0) {
-        err = pattern_error(res, &preg);
-        goto out_regex;
-    }
-
-    /* Check match. */
-    res = regexec(&preg, candidate, 0, NULL, 0);
-    if (res != 0 && res != REG_NOMATCH)
-        err = pattern_error(res, &preg);
-    else {
-        *result = (res == 0);
-        INV(!atf_is_error(err));
-    }
-
-    regfree(&preg);
-out_regex:
-    atf_dynstr_fini(&regex);
-out:
-    return err;
-}
diff -r 0d3535dde052 -r 34d4d95e0b32 external/bsd/atf/dist/atf-c/expand.h
--- a/external/bsd/atf/dist/atf-c/expand.h      Sat May 08 08:05:13 2010 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Automated Testing Framework (atf)
- *
- * Copyright (c) 2008 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
- * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
- * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#if !defined(ATF_C_EXPAND_H)
-#define ATF_C_EXPAND_H
-
-#include <stdbool.h>
-
-#include <atf-c/error_fwd.h>
-
-/* ---------------------------------------------------------------------
- * Free functions.
- * --------------------------------------------------------------------- */
-
-bool atf_expand_is_glob(const char *);
-atf_error_t atf_expand_matches_glob(const char *, const char *, bool *);
-
-#endif /* ATF_C_EXPAND_H */
diff -r 0d3535dde052 -r 34d4d95e0b32 external/bsd/atf/dist/atf-c/signals.c
--- a/external/bsd/atf/dist/atf-c/signals.c     Sat May 08 08:05:13 2010 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,168 +0,0 @@
-/*
- * Automated Testing Framework (atf)
- *
- * Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
- * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
- * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#if defined(HAVE_CONFIG_H)
-#include "bconfig.h"
-#endif
-
-#include <sys/types.h>
-
-#include <errno.h>
-#include <stdbool.h>
-#include <unistd.h>
-
-#include "atf-c/error.h"
-#include "atf-c/sanity.h"
-#include "atf-c/signals.h"
-
-const int atf_signals_last_signo = LAST_SIGNO;
-
-/* ---------------------------------------------------------------------
- * The "atf_signal_holder" type.
- * --------------------------------------------------------------------- */
-
-static bool happened[LAST_SIGNO + 1];
-
-static
-void
-holder_handler(int signo)
-{
-    happened[signo] = true;
-}
-
-/*
- * Constructors/destructors.
- */
-
-atf_error_t
-atf_signal_holder_init(atf_signal_holder_t *sh, int signo)
-{
-    atf_error_t err;
-
-    err = atf_signal_programmer_init(&sh->m_sp, signo, holder_handler);
-    if (atf_is_error(err))
-        goto out;
-
-    atf_object_init(&sh->m_object);
-    sh->m_signo = signo;
-    happened[signo] = false;
-
-    INV(!atf_is_error(err));



Home | Main Index | Thread Index | Old Index