head	1.4;
access;
symbols
	netbsd-11-0-RC4:1.4
	netbsd-11-0-RC3:1.4
	netbsd-11-0-RC2:1.4
	netbsd-11-0-RC1:1.4
	perseant-exfatfs-base-20250801:1.4
	netbsd-11:1.4.0.42
	netbsd-11-base:1.4
	netbsd-10-1-RELEASE:1.4
	perseant-exfatfs-base-20240630:1.4
	perseant-exfatfs:1.4.0.40
	perseant-exfatfs-base:1.4
	netbsd-8-3-RELEASE:1.4
	netbsd-9-4-RELEASE:1.4
	netbsd-10-0-RELEASE:1.4
	netbsd-10-0-RC6:1.4
	netbsd-10-0-RC5:1.4
	netbsd-10-0-RC4:1.4
	netbsd-10-0-RC3:1.4
	netbsd-10-0-RC2:1.4
	netbsd-10-0-RC1:1.4
	netbsd-10:1.4.0.38
	netbsd-10-base:1.4
	netbsd-9-3-RELEASE:1.4
	cjep_sun2x-base1:1.4
	cjep_sun2x:1.4.0.36
	cjep_sun2x-base:1.4
	cjep_staticlib_x-base1:1.4
	netbsd-9-2-RELEASE:1.4
	cjep_staticlib_x:1.4.0.34
	cjep_staticlib_x-base:1.4
	netbsd-9-1-RELEASE:1.4
	phil-wifi-20200421:1.4
	phil-wifi-20200411:1.4
	is-mlppp:1.4.0.32
	is-mlppp-base:1.4
	phil-wifi-20200406:1.4
	netbsd-8-2-RELEASE:1.4
	netbsd-9-0-RELEASE:1.4
	netbsd-9-0-RC2:1.4
	netbsd-9-0-RC1:1.4
	phil-wifi-20191119:1.4
	netbsd-9:1.4.0.30
	netbsd-9-base:1.4
	phil-wifi-20190609:1.4
	netbsd-8-1-RELEASE:1.4
	netbsd-8-1-RC1:1.4
	pgoyette-compat-merge-20190127:1.4
	pgoyette-compat-20190127:1.4
	pgoyette-compat-20190118:1.4
	pgoyette-compat-1226:1.4
	pgoyette-compat-1126:1.4
	pgoyette-compat-1020:1.4
	pgoyette-compat-0930:1.4
	pgoyette-compat-0906:1.4
	netbsd-7-2-RELEASE:1.4
	pgoyette-compat-0728:1.4
	netbsd-8-0-RELEASE:1.4
	phil-wifi:1.4.0.28
	phil-wifi-base:1.4
	pgoyette-compat-0625:1.4
	netbsd-8-0-RC2:1.4
	pgoyette-compat-0521:1.4
	pgoyette-compat-0502:1.4
	pgoyette-compat-0422:1.4
	netbsd-8-0-RC1:1.4
	pgoyette-compat-0415:1.4
	pgoyette-compat-0407:1.4
	pgoyette-compat-0330:1.4
	pgoyette-compat-0322:1.4
	pgoyette-compat-0315:1.4
	netbsd-7-1-2-RELEASE:1.4
	pgoyette-compat:1.4.0.26
	pgoyette-compat-base:1.4
	netbsd-7-1-1-RELEASE:1.4
	matt-nb8-mediatek:1.4.0.24
	matt-nb8-mediatek-base:1.4
	perseant-stdc-iso10646:1.4.0.22
	perseant-stdc-iso10646-base:1.4
	netbsd-8:1.4.0.20
	netbsd-8-base:1.4
	prg-localcount2-base3:1.4
	prg-localcount2-base2:1.4
	prg-localcount2-base1:1.4
	prg-localcount2:1.4.0.18
	prg-localcount2-base:1.4
	pgoyette-localcount-20170426:1.4
	bouyer-socketcan-base1:1.4
	pgoyette-localcount-20170320:1.4
	netbsd-7-1:1.4.0.16
	netbsd-7-1-RELEASE:1.4
	netbsd-7-1-RC2:1.4
	netbsd-7-nhusb-base-20170116:1.4
	bouyer-socketcan:1.4.0.14
	bouyer-socketcan-base:1.4
	pgoyette-localcount-20170107:1.4
	netbsd-7-1-RC1:1.4
	pgoyette-localcount-20161104:1.4
	netbsd-7-0-2-RELEASE:1.4
	localcount-20160914:1.4
	netbsd-7-nhusb:1.4.0.12
	netbsd-7-nhusb-base:1.4
	pgoyette-localcount-20160806:1.4
	pgoyette-localcount-20160726:1.4
	pgoyette-localcount:1.4.0.10
	pgoyette-localcount-base:1.4
	netbsd-7-0-1-RELEASE:1.4
	netbsd-7-0:1.4.0.8
	netbsd-7-0-RELEASE:1.4
	netbsd-7-0-RC3:1.4
	netbsd-7-0-RC2:1.4
	netbsd-7-0-RC1:1.4
	tls-maxphys:1.4.0.6
	netbsd-7:1.4.0.4
	netbsd-7-base:1.4
	yamt-pagecache-base9:1.4
	yamt-pagecache-tag8:1.2
	tls-earlyentropy:1.4.0.2
	tls-earlyentropy-base:1.4
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.4
	riastradh-drm2-base3:1.4
	atf-0-19:1.1.1.2
	GITHUB_JMMV:1.1.1
	agc-symver:1.2.0.8
	agc-symver-base:1.2
	tls-maxphys-base:1.4
	yamt-pagecache-base8:1.2
	yamt-pagecache-base7:1.2
	yamt-pagecache-base6:1.2
	yamt-pagecache-base5:1.2
	yamt-pagecache-base4:1.2
	yamt-pagecache-base3:1.2
	yamt-pagecache-base2:1.2
	yamt-pagecache:1.2.0.4
	yamt-pagecache-base:1.2
	bouyer-quota2-nbase:1.2
	bouyer-quota2:1.2.0.2
	bouyer-quota2-base:1.2
	atf-0-7:1.1.1.1
	matt-premerge-20091211:1.1.1.1
	jym-xensuspend-nbase:1.1.1.1
	jym-xensuspend:1.1.1.1.0.2
	jym-xensuspend-base:1.1.1.1
	atf-0-6:1.1.1.1
	TNF:1.1.1;
locks; strict;
comment	@// @;


1.4
date	2014.02.11.16.31.38;	author jmmv;	state Exp;
branches
	1.4.6.1;
next	1.3;
commitid	svkcL09jxUZ7AHox;

1.3
date	2014.02.08.19.13.44;	author jmmv;	state Exp;
branches;
next	1.2;
commitid	V1QGpoY6GYJZzkox;

1.2
date	2010.05.08.08.11.05;	author jmmv;	state dead;
branches
	1.2.4.1;
next	1.1;

1.1
date	2009.01.19.07.11.52;	author jmmv;	state Exp;
branches
	1.1.1.1;
next	;

1.4.6.1
date	2014.02.11.16.31.38;	author tls;	state dead;
branches;
next	1.4.6.2;
commitid	jTnpym9Qu0o4R1Nx;

1.4.6.2
date	2014.08.19.23.45.54;	author tls;	state Exp;
branches;
next	;
commitid	jTnpym9Qu0o4R1Nx;

1.2.4.1
date	2014.05.22.15.40.12;	author yamt;	state Exp;
branches;
next	;
commitid	TzMwNuE6CLSD5yBx;

1.1.1.1
date	2009.01.19.07.11.52;	author jmmv;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	2014.02.08.19.11.32;	author jmmv;	state Exp;
branches;
next	;
commitid	CKljpjViL2DYykox;


desc
@@


1.4
log
@Remove defs.hpp.

Because we now own the 'tools' subdirectory in the tree, we can yank some
of the upstream autoconf-related complexity.  Start doing so by removing
defs.hpp and using the real compiler attributes where necessary.
@
text
@//
// Automated Testing Framework (atf)
//
// Copyright (c) 2007 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 <cstdlib>
#include <iostream>
#include <map>
#include <string>

#include "application.hpp"
#include "config.hpp"

class atf_config : public tools::application::app {
    static const char* m_description;

    bool m_tflag;

    void process_option(int, const char*);
    std::string specific_args(void) const;
    options_set specific_options(void) const;

    std::string format_var(const std::string&, const std::string&);

public:
    atf_config(void);

    int main(void);
};

const char* atf_config::m_description =
    "atf-config is a tool that queries the value of several "
    "installation-specific configuration values of the atf.  "
    "It can be used by external tools to discover where specific "
    "internal atf files are installed.";

atf_config::atf_config(void) :
    app(m_description, "atf-config(1)", "atf(7)"),
    m_tflag(false)
{
}

void
atf_config::process_option(int ch, const char* arg __attribute__((__unused__)))
{
    switch (ch) {
    case 't':
        m_tflag = true;
        break;

    default:
        std::abort();
    }
}

std::string
atf_config::specific_args(void)
    const
{
    return "[var1 [.. varN]]";
}

atf_config::options_set
atf_config::specific_options(void)
    const
{
    using tools::application::option;
    options_set opts;
    opts.insert(option('t', "", "Terse output: show values only"));
    return opts;
}

std::string
atf_config::format_var(const std::string& name, const std::string& val)
{
    std::string str;

    if (m_tflag)
        str = val;
    else
        str = name + " : " + val;

    return str;
}

int
atf_config::main(void)
{
    if (m_argc < 1) {
        std::map< std::string, std::string > cv = tools::config::get_all();

        for (std::map< std::string, std::string >::const_iterator iter =
             cv.begin(); iter != cv.end(); iter++)
            std::cout << format_var((*iter).first, (*iter).second) << "\n";
    } else {
        for (int i = 0; i < m_argc; i++) {
            if (!tools::config::has(m_argv[i]))
                throw std::runtime_error(std::string("Unknown variable `") +
                                         m_argv[i] + "'");
        }

        for (int i = 0; i < m_argc; i++) {
            std::cout << format_var(m_argv[i], tools::config::get(m_argv[i]))
                      << "\n";
        }
    }

    return EXIT_SUCCESS;
}

int
main(int argc, char* const* argv)
{
    return atf_config().run(argc, argv);
}
@


1.4.6.1
log
@file atf-config.cpp was added on branch tls-maxphys on 2014-08-19 23:45:54 +0000
@
text
@d1 139
@


1.4.6.2
log
@Rebase to HEAD as of a few days ago.
@
text
@a0 139
//
// Automated Testing Framework (atf)
//
// Copyright (c) 2007 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 <cstdlib>
#include <iostream>
#include <map>
#include <string>

#include "application.hpp"
#include "config.hpp"

class atf_config : public tools::application::app {
    static const char* m_description;

    bool m_tflag;

    void process_option(int, const char*);
    std::string specific_args(void) const;
    options_set specific_options(void) const;

    std::string format_var(const std::string&, const std::string&);

public:
    atf_config(void);

    int main(void);
};

const char* atf_config::m_description =
    "atf-config is a tool that queries the value of several "
    "installation-specific configuration values of the atf.  "
    "It can be used by external tools to discover where specific "
    "internal atf files are installed.";

atf_config::atf_config(void) :
    app(m_description, "atf-config(1)", "atf(7)"),
    m_tflag(false)
{
}

void
atf_config::process_option(int ch, const char* arg __attribute__((__unused__)))
{
    switch (ch) {
    case 't':
        m_tflag = true;
        break;

    default:
        std::abort();
    }
}

std::string
atf_config::specific_args(void)
    const
{
    return "[var1 [.. varN]]";
}

atf_config::options_set
atf_config::specific_options(void)
    const
{
    using tools::application::option;
    options_set opts;
    opts.insert(option('t', "", "Terse output: show values only"));
    return opts;
}

std::string
atf_config::format_var(const std::string& name, const std::string& val)
{
    std::string str;

    if (m_tflag)
        str = val;
    else
        str = name + " : " + val;

    return str;
}

int
atf_config::main(void)
{
    if (m_argc < 1) {
        std::map< std::string, std::string > cv = tools::config::get_all();

        for (std::map< std::string, std::string >::const_iterator iter =
             cv.begin(); iter != cv.end(); iter++)
            std::cout << format_var((*iter).first, (*iter).second) << "\n";
    } else {
        for (int i = 0; i < m_argc; i++) {
            if (!tools::config::has(m_argv[i]))
                throw std::runtime_error(std::string("Unknown variable `") +
                                         m_argv[i] + "'");
        }

        for (int i = 0; i < m_argc; i++) {
            std::cout << format_var(m_argv[i], tools::config::get(m_argv[i]))
                      << "\n";
        }
    }

    return EXIT_SUCCESS;
}

int
main(int argc, char* const* argv)
{
    return atf_config().run(argc, argv);
}
@


1.3
log
@Merge atf-0.19.
@
text
@a36 1
#include "defs.hpp"
d68 1
a68 1
atf_config::process_option(int ch, const char* arg ATF_DEFS_ATTRIBUTE_UNUSED)
@


1.2
log
@Merge atf 0.8.
@
text
@d4 1
a4 1
// Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
d35 3
a37 3
#include "atf-c++/application.hpp"
#include "atf-c++/config.hpp"
#include "atf-c++/sanity.hpp"
d39 1
a39 1
class atf_config : public atf::application::app {
d69 1
a69 1
atf_config::process_option(int ch, const char* arg)
d77 1
a77 1
        UNREACHABLE;
d92 1
a92 1
    using atf::application::option;
d115 1
a115 1
        std::map< std::string, std::string > cv = atf::config::get_all();
d119 1
a119 2
            std::cout << format_var((*iter).first, (*iter).second)
                      << std::endl;
d122 1
a122 1
            if (!atf::config::has(m_argv[i]))
d128 2
a129 2
            std::cout << format_var(m_argv[i], atf::config::get(m_argv[i]))
                      << std::endl;
@


1.2.4.1
log
@sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")
@
text
@d4 1
a4 1
// Copyright (c) 2007 The NetBSD Foundation, Inc.
d35 3
a37 2
#include "application.hpp"
#include "config.hpp"
d39 1
a39 1
class atf_config : public tools::application::app {
d69 1
a69 1
atf_config::process_option(int ch, const char* arg __attribute__((__unused__)))
d77 1
a77 1
        std::abort();
d92 1
a92 1
    using tools::application::option;
d115 1
a115 1
        std::map< std::string, std::string > cv = tools::config::get_all();
d119 2
a120 1
            std::cout << format_var((*iter).first, (*iter).second) << "\n";
d123 1
a123 1
            if (!tools::config::has(m_argv[i]))
d129 2
a130 2
            std::cout << format_var(m_argv[i], tools::config::get(m_argv[i]))
                      << "\n";
@


1.1
log
@Initial revision
@
text
@@


1.1.1.1
log
@Import ATF 0.6.  Replaces the old ATF 0.5 that was in dist/atf.

Changes in this release:

* Make atf-exec be able to kill its child process after a certain period of
  time; this is controlled through the new -t option.

* Change atf-sh to use atf-exec's -t option to control the test case's
  timeouts, instead of doing it internally.  Same behavior as before, but
  noticeably faster.

* atf-exec's -g option and atf-killpg are gone due to the previous change.

* Added the atf-check(1) tool, a program that executes a given command and
  checks its exit code against a known value and allows the management of
  stdout and stderr in multiple ways.  This replaces the previous atf_check
  function in the atf-sh library and exposes this functionality to both
  atf-c and atf-c++.

* Added the ATF_REQUIRE family of macros to the C interface.  These help
  in checking for fatal test conditions.  The old ATF_CHECK macros now
  perform non-fatal checks only.  I.e. by using ATF_CHECK, the test case
  can now continue its execution and the failures will not be reported
  until the end of the whole run.

* Extended the amount of ATF_CHECK_* C macros with new ones to provide more
  features to the developer.  These also have their corresponding
  counterparts in the ATF_REQUIRE_* family.  The new macros (listing the
  suffixes only) are: _EQ (replaces _EQUAL), _EQ_MSG, _STREQ and
  _STREQ_MSG.
@
text
@@


1.1.1.2
log
@Import atf 0.19:

Changes in version 0.19
***********************

Experimental version released on February 7th, 2014.

This is the last release to bundle the code for the deprecated tools.
The next release will drop their code and will stop worrying about
backwards compatibility between the ATF libraries and what the old tools
may or may not support.

If you still require the old tools for some reason, grab a copy of the
'tools' directory now.  The code in this directory is standalone and
does not depend on any internal details of atf-c++ any longer.

* Various fixes and improvements to support running as part of the FreeBSD
  test suite.

* Project hosting moved from Google Code (as a subproject of Kyua) to
  GitHub (as a first-class project).  The main reason for the change is
  the suppression of binary downloads in Google Code on Jan 15th, 2014.
  See https://github.com/jmmv/atf/

* Removed builtin help from atf-sh(1) and atf-check(1) for simplicity
  reasons.  In other words, their -h option is gone.

* Moved the code of the deprecated tools into a 'tools' directory and
  completely decoupled their code from the internals of atf-c++.  The
  reason for this is to painlessly allow a third-party to maintain a
  copy of these tools after we delete them because upcoming changes to
  atf-c++ would break the stale tools.


Changes in version 0.18
***********************

Experimental version released on November 16th, 2013.

* Issue 45: Added require.memory support in atf-run for FreeBSD.

* Fixed an issue with the handling of cin with libc++.

* Issue 64: Fixed various mandoc formatting warnings.

* NetBSD PR bin/48284: Made atf-check flush its progress message to
  stdout so that an interrupted test case always shows the last message
  being executed.

* NetBSD PR bin/48285: Fixed atf_check examples in atf-sh-api(3).
@
text
@d4 1
a4 1
// Copyright (c) 2007 The NetBSD Foundation, Inc.
d35 3
a37 3
#include "application.hpp"
#include "config.hpp"
#include "defs.hpp"
d39 1
a39 1
class atf_config : public tools::application::app {
d69 1
a69 1
atf_config::process_option(int ch, const char* arg ATF_DEFS_ATTRIBUTE_UNUSED)
d77 1
a77 1
        std::abort();
d92 1
a92 1
    using tools::application::option;
d115 1
a115 1
        std::map< std::string, std::string > cv = tools::config::get_all();
d119 2
a120 1
            std::cout << format_var((*iter).first, (*iter).second) << "\n";
d123 1
a123 1
            if (!tools::config::has(m_argv[i]))
d129 2
a130 2
            std::cout << format_var(m_argv[i], tools::config::get(m_argv[i]))
                      << "\n";
@

