head	1.2;
access;
symbols
	netbsd-11-0-RELEASE:1.2
	netbsd-11-0-RC7:1.2
	netbsd-11-0-RC6:1.2
	netbsd-11-0-RC5:1.2
	netbsd-11-0-RC4:1.2
	netbsd-11-0-RC3:1.2
	netbsd-11-0-RC2:1.2
	netbsd-11-0-RC1:1.2
	perseant-exfatfs-base-20250801:1.2
	netbsd-11:1.2.0.12
	netbsd-11-base:1.2
	netbsd-10-1-RELEASE:1.2
	perseant-exfatfs-base-20240630:1.2
	perseant-exfatfs:1.2.0.10
	perseant-exfatfs-base:1.2
	netbsd-8-3-RELEASE:1.1.1.2
	netbsd-9-4-RELEASE:1.1.1.2
	netbsd-10-0-RELEASE:1.2
	netbsd-10-0-RC6:1.2
	netbsd-10-0-RC5:1.2
	netbsd-10-0-RC4:1.2
	netbsd-10-0-RC3:1.2
	netbsd-10-0-RC2:1.2
	netbsd-10-0-RC1:1.2
	netbsd-10:1.2.0.8
	netbsd-10-base:1.2
	netbsd-9-3-RELEASE:1.1.1.2
	cjep_sun2x-base1:1.2
	cjep_sun2x:1.2.0.6
	cjep_sun2x-base:1.2
	cjep_staticlib_x-base1:1.2
	netbsd-9-2-RELEASE:1.1.1.2
	cjep_staticlib_x:1.2.0.4
	cjep_staticlib_x-base:1.2
	netbsd-9-1-RELEASE:1.1.1.2
	phil-wifi-20200421:1.2
	phil-wifi-20200411:1.2
	is-mlppp:1.2.0.2
	is-mlppp-base:1.2
	phil-wifi-20200406:1.2
	netbsd-8-2-RELEASE:1.1.1.2
	netbsd-9-0-RELEASE:1.1.1.2
	netbsd-9-0-RC2:1.1.1.2
	netbsd-9-0-RC1:1.1.1.2
	phil-wifi-20191119:1.2
	netbsd-9:1.1.1.2.0.50
	netbsd-9-base:1.1.1.2
	phil-wifi-20190609:1.1.1.2
	netbsd-8-1-RELEASE:1.1.1.2
	netbsd-8-1-RC1:1.1.1.2
	pgoyette-compat-merge-20190127:1.1.1.2
	pgoyette-compat-20190127:1.1.1.2
	pgoyette-compat-20190118:1.1.1.2
	pgoyette-compat-1226:1.1.1.2
	pgoyette-compat-1126:1.1.1.2
	pgoyette-compat-1020:1.1.1.2
	pgoyette-compat-0930:1.1.1.2
	pgoyette-compat-0906:1.1.1.2
	netbsd-7-2-RELEASE:1.1.1.2
	pgoyette-compat-0728:1.1.1.2
	netbsd-8-0-RELEASE:1.1.1.2
	phil-wifi:1.1.1.2.0.48
	phil-wifi-base:1.1.1.2
	pgoyette-compat-0625:1.1.1.2
	netbsd-8-0-RC2:1.1.1.2
	pgoyette-compat-0521:1.1.1.2
	pgoyette-compat-0502:1.1.1.2
	pgoyette-compat-0422:1.1.1.2
	netbsd-8-0-RC1:1.1.1.2
	pgoyette-compat-0415:1.1.1.2
	pgoyette-compat-0407:1.1.1.2
	pgoyette-compat-0330:1.1.1.2
	pgoyette-compat-0322:1.1.1.2
	pgoyette-compat-0315:1.1.1.2
	netbsd-7-1-2-RELEASE:1.1.1.2
	pgoyette-compat:1.1.1.2.0.46
	pgoyette-compat-base:1.1.1.2
	netbsd-7-1-1-RELEASE:1.1.1.2
	matt-nb8-mediatek:1.1.1.2.0.44
	matt-nb8-mediatek-base:1.1.1.2
	perseant-stdc-iso10646:1.1.1.2.0.42
	perseant-stdc-iso10646-base:1.1.1.2
	netbsd-8:1.1.1.2.0.40
	netbsd-8-base:1.1.1.2
	prg-localcount2-base3:1.1.1.2
	prg-localcount2-base2:1.1.1.2
	prg-localcount2-base1:1.1.1.2
	prg-localcount2:1.1.1.2.0.38
	prg-localcount2-base:1.1.1.2
	pgoyette-localcount-20170426:1.1.1.2
	bouyer-socketcan-base1:1.1.1.2
	pgoyette-localcount-20170320:1.1.1.2
	netbsd-7-1:1.1.1.2.0.36
	netbsd-7-1-RELEASE:1.1.1.2
	netbsd-7-1-RC2:1.1.1.2
	netbsd-7-nhusb-base-20170116:1.1.1.2
	bouyer-socketcan:1.1.1.2.0.34
	bouyer-socketcan-base:1.1.1.2
	pgoyette-localcount-20170107:1.1.1.2
	netbsd-7-1-RC1:1.1.1.2
	pgoyette-localcount-20161104:1.1.1.2
	netbsd-7-0-2-RELEASE:1.1.1.2
	localcount-20160914:1.1.1.2
	netbsd-7-nhusb:1.1.1.2.0.32
	netbsd-7-nhusb-base:1.1.1.2
	pgoyette-localcount-20160806:1.1.1.2
	pgoyette-localcount-20160726:1.1.1.2
	pgoyette-localcount:1.1.1.2.0.30
	pgoyette-localcount-base:1.1.1.2
	netbsd-7-0-1-RELEASE:1.1.1.2
	netbsd-7-0:1.1.1.2.0.28
	netbsd-7-0-RELEASE:1.1.1.2
	netbsd-7-0-RC3:1.1.1.2
	netbsd-7-0-RC2:1.1.1.2
	netbsd-7-0-RC1:1.1.1.2
	netbsd-6-0-6-RELEASE:1.1.1.2
	netbsd-6-1-5-RELEASE:1.1.1.2
	netbsd-7:1.1.1.2.0.26
	netbsd-7-base:1.1.1.2
	yamt-pagecache-base9:1.1.1.2
	yamt-pagecache-tag8:1.1.1.2
	netbsd-6-1-4-RELEASE:1.1.1.2
	netbsd-6-0-5-RELEASE:1.1.1.2
	tls-earlyentropy:1.1.1.2.0.24
	tls-earlyentropy-base:1.1.1.2
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.1.1.2
	riastradh-drm2-base3:1.1.1.2
	atf-0-20:1.1.1.2
	atf-0-19:1.1.1.2
	GITHUB_JMMV:1.1.1
	netbsd-6-1-3-RELEASE:1.1.1.2
	netbsd-6-0-4-RELEASE:1.1.1.2
	netbsd-6-1-2-RELEASE:1.1.1.2
	netbsd-6-0-3-RELEASE:1.1.1.2
	netbsd-6-1-1-RELEASE:1.1.1.2
	riastradh-drm2-base2:1.1.1.2
	riastradh-drm2-base1:1.1.1.2
	riastradh-drm2:1.1.1.2.0.16
	riastradh-drm2-base:1.1.1.2
	netbsd-6-1:1.1.1.2.0.22
	netbsd-6-0-2-RELEASE:1.1.1.2
	netbsd-6-1-RELEASE:1.1.1.2
	khorben-n900:1.1.1.2.0.20
	netbsd-6-1-RC4:1.1.1.2
	netbsd-6-1-RC3:1.1.1.2
	agc-symver:1.1.1.2.0.18
	agc-symver-base:1.1.1.2
	netbsd-6-1-RC2:1.1.1.2
	netbsd-6-1-RC1:1.1.1.2
	atf-0-17:1.1.1.2
	yamt-pagecache-base8:1.1.1.2
	netbsd-6-0-1-RELEASE:1.1.1.2
	yamt-pagecache-base7:1.1.1.2
	matt-nb6-plus-nbase:1.1.1.2
	yamt-pagecache-base6:1.1.1.2
	netbsd-6-0:1.1.1.2.0.14
	netbsd-6-0-RELEASE:1.1.1.2
	netbsd-6-0-RC2:1.1.1.2
	tls-maxphys:1.1.1.2.0.12
	tls-maxphys-base:1.1.1.2
	matt-nb6-plus:1.1.1.2.0.10
	matt-nb6-plus-base:1.1.1.2
	netbsd-6-0-RC1:1.1.1.2
	atf-0-16:1.1.1.2
	yamt-pagecache-base5:1.1.1.2
	yamt-pagecache-base4:1.1.1.2
	netbsd-6:1.1.1.2.0.8
	netbsd-6-base:1.1.1.2
	atf-0-15:1.1.1.2
	yamt-pagecache-base3:1.1.1.2
	yamt-pagecache-base2:1.1.1.2
	yamt-pagecache:1.1.1.2.0.6
	yamt-pagecache-base:1.1.1.2
	atf-0-14:1.1.1.2
	cherry-xenmp:1.1.1.2.0.4
	cherry-xenmp-base:1.1.1.2
	atf-0-13:1.1.1.2
	bouyer-quota2-nbase:1.1.1.2
	bouyer-quota2:1.1.1.2.0.2
	bouyer-quota2-base:1.1.1.2
	matt-mips64-premerge-20101231:1.1.1.2
	atf-0-12:1.1.1.2
	atf-0-11:1.1.1.2
	atf-0-10:1.1.1.1
	atf-0-9:1.1.1.1
	atf-0-8:1.1.1.1
	atf-0-7:1.1.1.1
	TNF:1.1.1;
locks; strict;
comment	@// @;


1.2
date	2019.10.09.01.18.55;	author christos;	state Exp;
branches;
next	1.1;
commitid	Qr6uK0zpMKh588GB;

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

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

1.1.1.2
date	2010.10.20.09.14.20;	author jmmv;	state Exp;
branches
	1.1.1.2.48.1;
next	;

1.1.1.2.48.1
date	2020.04.13.07.45.48;	author martin;	state Exp;
branches;
next	;
commitid	X01YhRUPVUDaec4C;


desc
@@


1.2
log
@the cast police is looking for me.
@
text
@//
// Automated Testing Framework (atf)
//
// Copyright (c) 2009 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.
//

extern "C" {
#include "atf-c/build.h"
#include "atf-c/error.h"
#include "atf-c/utils.h"
}

#include "build.hpp"

#include "detail/exceptions.hpp"
#include "detail/process.hpp"

namespace impl = atf::build;
#define IMPL_NAME "atf::build"

// ------------------------------------------------------------------------
// Auxiliary functions.
// ------------------------------------------------------------------------

inline
atf::process::argv_array
cargv_to_argv(const atf_list_t* l)
{
    std::vector< const char* > aux;

    atf_list_citer_t iter;
    atf_list_for_each_c(iter, l)
        aux.push_back(static_cast< const char* >(atf_list_citer_data(iter)));

    return atf::process::argv_array(aux);
}

inline
atf::process::argv_array
cargv_to_argv_and_free(char** l)
{
    try {
        atf::process::argv_array argv(const_cast<const char* const*>(l));
        atf_utils_free_charpp(l);
        return argv;
    } catch (...) {
        atf_utils_free_charpp(l);
        throw;
    }
}

// ------------------------------------------------------------------------
// Free functions.
// ------------------------------------------------------------------------

atf::process::argv_array
impl::c_o(const std::string& sfile, const std::string& ofile,
          const atf::process::argv_array& optargs)
{
    char** l;

    atf_error_t err = atf_build_c_o(sfile.c_str(), ofile.c_str(),
                                    optargs.exec_argv(), &l);
    if (atf_is_error(err))
        throw_atf_error(err);

    return cargv_to_argv_and_free(l);
}

atf::process::argv_array
impl::cpp(const std::string& sfile, const std::string& ofile,
          const atf::process::argv_array& optargs)
{
    char** l;

    atf_error_t err = atf_build_cpp(sfile.c_str(), ofile.c_str(),
                                    optargs.exec_argv(), &l);
    if (atf_is_error(err))
        throw_atf_error(err);

    return cargv_to_argv_and_free(l);
}

atf::process::argv_array
impl::cxx_o(const std::string& sfile, const std::string& ofile,
            const atf::process::argv_array& optargs)
{
    char** l;

    atf_error_t err = atf_build_cxx_o(sfile.c_str(), ofile.c_str(),
                                      optargs.exec_argv(), &l);
    if (atf_is_error(err))
        throw_atf_error(err);

    return cargv_to_argv_and_free(l);
}
@


1.1
log
@Initial revision
@
text
@d33 1
d36 4
a39 3
#include "atf-c++/build.hpp"
#include "atf-c++/exceptions.hpp"
#include "atf-c++/process.hpp"
d50 1
a50 1
clist_to_argv(const atf_list_t* l)
d63 1
a63 1
clist_to_argv_and_free(atf_list_t* l)
d66 2
a67 2
        atf::process::argv_array argv = clist_to_argv(l);
        atf_list_fini(l);
d70 1
a70 1
        atf_list_fini(l);
d81 1
a81 1
          const process::argv_array& optargs)
d83 1
a83 1
    atf_list_t l;
d90 1
a90 1
    return clist_to_argv_and_free(&l);
d95 1
a95 1
          const process::argv_array& optargs)
d97 1
a97 1
    atf_list_t l;
d104 1
a104 1
    return clist_to_argv_and_free(&l);
d109 1
a109 1
            const process::argv_array& optargs)
d111 1
a111 1
    atf_list_t l;
d118 1
a118 1
    return clist_to_argv_and_free(&l);
@


1.1.1.1
log
@Import atf 0.7.  Changes in this release:

* Added build-time checks to atf-c and atf-c++.  A binding for atf-sh
  will come later.

* Migrated all build-time checks for header files to proper ATF tests.
  This demonstrates the use of the new feature described above.

* Added an internal API for child process management.

* Converted all plain-text distribution documents to a Docbook canonical
  version, and include pre-generated plain text and HTML copies in the
  distribution file.

* Simplified the contents of the Makefile.am by regenerating it from a
  canonical Makefile.am.m4 source.  As a side-effect, some dependency
  specifications were fixed.

* Migrated all checks from the check target to installcheck, as these
  require ATF to be installed.

* Fixed sign comparison mismatches triggered by the now-enabled
  -Wsign-compare.

* Fixed many memory and object leaks.
@
text
@@


1.1.1.2
log
@Import atf-0.11:

Experimental version released on October 20th, 2010.

* The ATF_CHECK* macros in atf-c++ were renamed to ATF_REQUIRE* to match
  their counterparts in atf-c.

* Clearly separated the modules in atf-c that are supposed to be public
  from those that are implementation details.  The header files for the
  internal modules are not installed any more.

* Made the atf-check tool private.  It is only required by atf-sh and being
  public has the danger of causing confusion.  Also, making it private
  simplifies the public API of atf.

* Changed atf-sh to enable per-command error checking (set -e) by default.
  This catches many cases in which a test case is broken but it is not
  reported as such because execution continues.

* Fixed the XSTL and CSS stylesheets to support expected failures.
@
text
@a32 1
#include "atf-c/utils.h"
d35 3
a37 4
#include "build.hpp"

#include "detail/exceptions.hpp"
#include "detail/process.hpp"
d48 1
a48 1
cargv_to_argv(const atf_list_t* l)
d61 1
a61 1
cargv_to_argv_and_free(char** l)
d64 2
a65 2
        atf::process::argv_array argv((const char* const*)l);
        atf_utils_free_charpp(l);
d68 1
a68 1
        atf_utils_free_charpp(l);
d79 1
a79 1
          const atf::process::argv_array& optargs)
d81 1
a81 1
    char** l;
d88 1
a88 1
    return cargv_to_argv_and_free(l);
d93 1
a93 1
          const atf::process::argv_array& optargs)
d95 1
a95 1
    char** l;
d102 1
a102 1
    return cargv_to_argv_and_free(l);
d107 1
a107 1
            const atf::process::argv_array& optargs)
d109 1
a109 1
    char** l;
d116 1
a116 1
    return cargv_to_argv_and_free(l);
@


1.1.1.2.48.1
log
@Mostly merge changes from HEAD upto 20200411
@
text
@d66 1
a66 1
        atf::process::argv_array argv(const_cast<const char* const*>(l));
@


