//
// 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
//
// 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 <signal.h>
#include <unistd.h>
}
#include <algorithm>
#include <cctype>
#include <cerrno>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <map>
#include <memory>
#include <sstream>
#include <stdexcept>
#include <vector>
extern "C" {
}
#include "noncopyable.hpp"
#include "tests.hpp"
#include "detail/application.hpp"
#include "detail/auto_array.hpp"
#include "detail/exceptions.hpp"
#include "detail/parser.hpp"
#include "detail/sanity.hpp"
// ------------------------------------------------------------------------
// The "atf_tp_writer" class.
// ------------------------------------------------------------------------
m_is_first(true)
{
"application/X-atf-tp", ct_attrs);
}
void
{
if (!m_is_first)
m_os << "\n";
}
void
{
if (m_is_first)
m_is_first = false;
}
void
{
}
// ------------------------------------------------------------------------
// Free helper functions.
// ------------------------------------------------------------------------
bool
{
}
// ------------------------------------------------------------------------
// The "tc" class.
// ------------------------------------------------------------------------
bool m_has_cleanup;
m_ident(ident),
{
}
static void
{
}
static void
{
try {
e.what()));
} catch (...) {
}
}
static void
{
}
};
{
}
{
}
void
{
ptr += 2;
}
if (atf_is_error(err))
}
bool
const
{
}
bool
const
{
}
const
{
}
const
{
}
const
{
}
const
{
try {
char **ptr;
} catch (...) {
throw;
}
return vars;
}
void
{
if (atf_is_error(err))
}
void
const
{
if (atf_is_error(err))
}
void
const
{
if (atf_is_error(err))
}
void
{
}
void
const
{
}
void
const
{
}
void
{
atf_tc_pass();
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
// ------------------------------------------------------------------------
// The "tp" class.
// ------------------------------------------------------------------------
public:
private:
static const char* m_description;
bool m_lflag;
options_set specific_options(void) const;
void process_option(int, const char*);
void handle_srcdir(void);
enum tc_part {
BODY,
};
void list_tcs(void);
public:
~tp(void);
int main(void);
};
"This is an independent atf test program.";
m_lflag(false),
m_srcdir("."),
{
}
{
delete tc;
}
}
const
{
return "test_case";
}
const
{
"will write the results of the "
"executed test case"));
"files are located"));
"`var' to `value'"));
return opts;
}
void
{
switch (ch) {
case 'l':
m_lflag = true;
break;
case 'r':
break;
case 's':
m_srcdir_arg = arg;
break;
case 'v':
break;
default:
}
}
void
{
} else {
"var=value");
}
}
void
{
if (m_srcdir_arg.empty()) {
} else
if (!m_srcdir.is_absolute())
}
{
}
return m_tcs;
}
//
// An auxiliary unary predicate that compares the given test case's
// identifier to the identifier stored in it.
//
class tc_equal_to_ident {
public:
m_ident(i)
{
}
{
}
};
void
{
{
}
if (key != "ident")
}
}
}
{
return tc;
}
}
{
} else {
if (partname == "body")
else if (partname == "cleanup")
else {
}
}
}
int
{
"__RUNNING_INSIDE_ATF_RUN") != "internal-yes-value")
{
"atf-run(1) is unsupported\n";
"control is being applied; you may get unexpected failures; see "
"atf-test-case(4)\n";
}
try {
case BODY:
break;
case CLEANUP:
tc->run_cleanup();
break;
default:
}
return EXIT_SUCCESS;
} catch (const std::runtime_error& e) {
return EXIT_FAILURE;
}
}
int
{
int errcode;
if (m_lflag) {
if (m_argc > 0)
throw usage_error("Cannot provide test case names with -l");
list_tcs();
} else {
if (m_argc == 0)
throw usage_error("Must provide a test case name");
else if (m_argc > 1)
throw usage_error("Cannot provide more than one test case name");
}
return errcode;
}
namespace atf {
namespace tests {
}
}
int
{
}