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 Resolve conflicts after the import of ...
details: https://anonhg.NetBSD.org/src/rev/6a5128f2216d
branches: trunk
changeset: 772797:6a5128f2216d
user: jmmv <jmmv%NetBSD.org@localhost>
date: Mon Jan 16 22:41:30 2012 +0000
description:
Resolve conflicts after the import of atf 0.15.
diffstat:
external/bsd/atf/dist/atf-c++/detail/process.hpp | 2 +-
external/bsd/atf/dist/atf-c++/detail/text.cpp | 29 ++-
external/bsd/atf/dist/atf-c++/detail/text.hpp | 20 +-
external/bsd/atf/dist/atf-c++/tests.cpp | 2 +-
external/bsd/atf/dist/atf-c++/tests.hpp | 2 +-
external/bsd/atf/dist/atf-c/defs.h.in | 3 +-
external/bsd/atf/dist/atf-c/detail/process.c | 4 +-
external/bsd/atf/dist/atf-c/detail/process.h | 2 +-
external/bsd/atf/dist/atf-c/detail/process_test.c | 17 +-
external/bsd/atf/dist/atf-c/detail/test_helpers.c | 4 +-
external/bsd/atf/dist/atf-c/tc.c | 30 ++-
external/bsd/atf/dist/atf-c/tc.h | 2 +-
external/bsd/atf/dist/atf-config/integration_test.sh | 2 +-
external/bsd/atf/dist/atf-report/atf-report.cpp | 83 +++++++---
external/bsd/atf/dist/atf-report/tests-results.css | 25 +++-
external/bsd/atf/dist/atf-report/tests-results.xsl | 83 ++++++----
external/bsd/atf/dist/atf-run/atf-run.cpp | 2 +-
external/bsd/atf/dist/atf-run/fs.cpp | 2 +-
external/bsd/atf/dist/atf-run/integration_test.sh | 19 +-
external/bsd/atf/dist/atf-run/io_test.cpp | 5 +-
external/bsd/atf/dist/atf-run/requirements.cpp | 107 +++++++++-----
external/bsd/atf/dist/atf-run/test-program.cpp | 60 +++++--
external/bsd/atf/dist/atf-run/test_program_test.cpp | 95 ++++++++----
external/bsd/atf/dist/atf-run/timer.cpp | 141 ++++++++++++------
external/bsd/atf/dist/atf-run/timer.hpp | 15 +-
external/bsd/atf/dist/atf-sh/atf-check.cpp | 2 +-
external/bsd/atf/dist/atf-sh/atf-check_test.sh | 6 +-
external/bsd/atf/dist/atf-version/atf-version.cpp | 2 +-
external/bsd/atf/dist/doc/atf-test-case.4 | 15 +-
29 files changed, 508 insertions(+), 273 deletions(-)
diffs (truncated from 1984 to 300 lines):
diff -r 6a1b4c95b7bf -r 6a5128f2216d external/bsd/atf/dist/atf-c++/detail/process.hpp
--- a/external/bsd/atf/dist/atf-c++/detail/process.hpp Mon Jan 16 22:36:30 2012 +0000
+++ b/external/bsd/atf/dist/atf-c++/detail/process.hpp Mon Jan 16 22:41:30 2012 +0000
@@ -1,7 +1,7 @@
//
// Automated Testing Framework (atf)
//
-// Copyright (c) 2008, 2009, 2010, 2011 The NetBSD Foundation, Inc.
+// Copyright (c) 2008 The NetBSD Foundation, Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
diff -r 6a1b4c95b7bf -r 6a5128f2216d external/bsd/atf/dist/atf-c++/detail/text.cpp
--- a/external/bsd/atf/dist/atf-c++/detail/text.cpp Mon Jan 16 22:36:30 2012 +0000
+++ b/external/bsd/atf/dist/atf-c++/detail/text.cpp Mon Jan 16 22:41:30 2012 +0000
@@ -1,7 +1,7 @@
//
// Automated Testing Framework (atf)
//
-// Copyright (c) 2007, 2008, 2010 The NetBSD Foundation, Inc.
+// Copyright (c) 2007 The NetBSD Foundation, Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -33,7 +33,6 @@
#include <cctype>
#include <cstring>
-#include <cstdlib>
extern "C" {
#include "../../atf-c/error.h"
@@ -136,10 +135,26 @@
}
int64_t
-impl::to_number(const std::string& str)
+impl::to_bytes(std::string str)
{
- int64_t num;
- ::dehumanize_number(str.c_str(), &num);
- return num;
+ if (str.empty())
+ throw std::runtime_error("Empty value");
+
+ const char unit = str[str.length() - 1];
+ int64_t multiplier;
+ switch (unit) {
+ case 'k': case 'K': multiplier = 1 << 10; break;
+ case 'm': case 'M': multiplier = 1 << 20; break;
+ case 'g': case 'G': multiplier = 1 << 30; break;
+ case 't': case 'T': multiplier = int64_t(1) << 40; break;
+ default:
+ if (!std::isdigit(unit))
+ throw std::runtime_error(std::string("Unknown size unit '") + unit
+ + "'");
+ multiplier = 1;
+ }
+ if (multiplier != 1)
+ str.erase(str.length() - 1);
+
+ return to_type< int64_t >(str) * multiplier;
}
-
diff -r 6a1b4c95b7bf -r 6a5128f2216d external/bsd/atf/dist/atf-c++/detail/text.hpp
--- a/external/bsd/atf/dist/atf-c++/detail/text.hpp Mon Jan 16 22:36:30 2012 +0000
+++ b/external/bsd/atf/dist/atf-c++/detail/text.hpp Mon Jan 16 22:41:30 2012 +0000
@@ -1,7 +1,7 @@
//
// Automated Testing Framework (atf)
//
-// Copyright (c) 2007, 2008, 2010 The NetBSD Foundation, Inc.
+// Copyright (c) 2007 The NetBSD Foundation, Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -30,6 +30,10 @@
#if !defined(_ATF_CXX_TEXT_HPP_)
#define _ATF_CXX_TEXT_HPP_
+extern "C" {
+#include <stdint.h>
+}
+
#include <sstream>
#include <stdexcept>
#include <string>
@@ -98,6 +102,11 @@
bool to_bool(const std::string&);
//!
+//! \brief Converts the given string to a bytes size.
+//!
+int64_t to_bytes(std::string);
+
+//!
//! \brief Changes the case of a string to lowercase.
//!
//! Returns a new string that is a lowercased version of the original
@@ -106,13 +115,6 @@
std::string to_lower(const std::string&);
//!
-//! \brief Converts the given string to a number
-//!
-//! The string should be of the form ^[0-9]+[KMGT]$ or ^[0-9]$
-//!
-int64_t to_number(const std::string&);
-
-//!
//! \brief Converts the given object to a string.
//!
//! Returns a string with the representation of the given object. There
@@ -140,7 +142,7 @@
std::istringstream ss(str);
T value;
ss >> value;
- if (!ss.eof() || (!ss.eof() && !ss.good()))
+ if (!ss.eof() || (ss.eof() && (ss.fail() || ss.bad())))
throw std::runtime_error("Cannot convert string to requested type");
return value;
}
diff -r 6a1b4c95b7bf -r 6a5128f2216d external/bsd/atf/dist/atf-c++/tests.cpp
--- a/external/bsd/atf/dist/atf-c++/tests.cpp Mon Jan 16 22:36:30 2012 +0000
+++ b/external/bsd/atf/dist/atf-c++/tests.cpp Mon Jan 16 22:41:30 2012 +0000
@@ -1,7 +1,7 @@
//
// Automated Testing Framework (atf)
//
-// Copyright (c) 2007, 2008, 2009, 2010, 2011 The NetBSD Foundation, Inc.
+// Copyright (c) 2007 The NetBSD Foundation, Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
diff -r 6a1b4c95b7bf -r 6a5128f2216d external/bsd/atf/dist/atf-c++/tests.hpp
--- a/external/bsd/atf/dist/atf-c++/tests.hpp Mon Jan 16 22:36:30 2012 +0000
+++ b/external/bsd/atf/dist/atf-c++/tests.hpp Mon Jan 16 22:41:30 2012 +0000
@@ -1,7 +1,7 @@
//
// Automated Testing Framework (atf)
//
-// Copyright (c) 2007, 2008, 2009, 2010 The NetBSD Foundation, Inc.
+// Copyright (c) 2007 The NetBSD Foundation, Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
diff -r 6a1b4c95b7bf -r 6a5128f2216d external/bsd/atf/dist/atf-c/defs.h.in
--- a/external/bsd/atf/dist/atf-c/defs.h.in Mon Jan 16 22:36:30 2012 +0000
+++ b/external/bsd/atf/dist/atf-c/defs.h.in Mon Jan 16 22:41:30 2012 +0000
@@ -1,7 +1,7 @@
/*
* Automated Testing Framework (atf)
*
- * Copyright (c) 2008, 2011 The NetBSD Foundation, Inc.
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,5 +32,6 @@
#define ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(a, b) @ATTRIBUTE_FORMAT_PRINTF@
#define ATF_DEFS_ATTRIBUTE_NORETURN @ATTRIBUTE_NORETURN@
+#define ATF_DEFS_ATTRIBUTE_UNUSED @ATTRIBUTE_UNUSED@
#endif /* !defined(ATF_C_DEFS_H) */
diff -r 6a1b4c95b7bf -r 6a5128f2216d external/bsd/atf/dist/atf-c/detail/process.c
--- a/external/bsd/atf/dist/atf-c/detail/process.c Mon Jan 16 22:36:30 2012 +0000
+++ b/external/bsd/atf/dist/atf-c/detail/process.c Mon Jan 16 22:41:30 2012 +0000
@@ -1,7 +1,7 @@
/*
* Automated Testing Framework (atf)
*
- * Copyright (c) 2007, 2008, 2009, 2010, 2011 The NetBSD Foundation, Inc.
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -197,7 +197,7 @@
}
void
-atf_process_status_fini(atf_process_status_t *s)
+atf_process_status_fini(atf_process_status_t *s ATF_DEFS_ATTRIBUTE_UNUSED)
{
}
diff -r 6a1b4c95b7bf -r 6a5128f2216d external/bsd/atf/dist/atf-c/detail/process.h
--- a/external/bsd/atf/dist/atf-c/detail/process.h Mon Jan 16 22:36:30 2012 +0000
+++ b/external/bsd/atf/dist/atf-c/detail/process.h Mon Jan 16 22:41:30 2012 +0000
@@ -1,7 +1,7 @@
/*
* Automated Testing Framework (atf)
*
- * Copyright (c) 2008, 2009, 2010, 2011 The NetBSD Foundation, Inc.
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff -r 6a1b4c95b7bf -r 6a5128f2216d external/bsd/atf/dist/atf-c/detail/process_test.c
--- a/external/bsd/atf/dist/atf-c/detail/process_test.c Mon Jan 16 22:36:30 2012 +0000
+++ b/external/bsd/atf/dist/atf-c/detail/process_test.c Mon Jan 16 22:41:30 2012 +0000
@@ -1,7 +1,7 @@
/*
* Automated Testing Framework (atf)
*
- * Copyright (c) 2008, 2009, 2010, 2011 The NetBSD Foundation, Inc.
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -28,8 +28,8 @@
*/
#include <sys/types.h>
+#include <sys/time.h>
#include <sys/resource.h>
-#include <sys/time.h>
#include <sys/wait.h>
#include <errno.h>
@@ -135,13 +135,12 @@
{
struct capture_stream *s = v;
- bool eof;
switch (s->m_base.m_type) {
case stdout_type:
- eof = read_line(atf_process_child_stdout(c), &s->m_msg);
+ (void)read_line(atf_process_child_stdout(c), &s->m_msg);
break;
case stderr_type:
- eof = read_line(atf_process_child_stderr(c), &s->m_msg);
+ (void)read_line(atf_process_child_stderr(c), &s->m_msg);
break;
default:
UNREACHABLE;
@@ -690,7 +689,7 @@
static
void
-child_report_pid(void *v)
+child_report_pid(void *v ATF_DEFS_ATTRIBUTE_UNUSED)
{
const pid_t pid = getpid();
if (write(STDOUT_FILENO, &pid, sizeof(pid)) != sizeof(pid))
@@ -731,7 +730,7 @@
static
void
-child_loop(void *v)
+child_loop(void *v ATF_DEFS_ATTRIBUTE_UNUSED)
{
for (;;)
sleep(1);
@@ -739,13 +738,13 @@
static
void
-nop_signal(int sig)
+nop_signal(int sig ATF_DEFS_ATTRIBUTE_UNUSED)
{
}
static
void
-child_spawn_loop_and_wait_eintr(void *v)
+child_spawn_loop_and_wait_eintr(void *v ATF_DEFS_ATTRIBUTE_UNUSED)
{
atf_process_child_t child;
atf_process_status_t status;
diff -r 6a1b4c95b7bf -r 6a5128f2216d external/bsd/atf/dist/atf-c/detail/test_helpers.c
--- a/external/bsd/atf/dist/atf-c/detail/test_helpers.c Mon Jan 16 22:36:30 2012 +0000
+++ b/external/bsd/atf/dist/atf-c/detail/test_helpers.c Mon Jan 16 22:41:30 2012 +0000
@@ -1,7 +1,7 @@
/*
* Automated Testing Framework (atf)
*
- * Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -77,7 +77,7 @@
}
void
-header_check(const atf_tc_t *tc, const char *hdrname)
+header_check(const char *hdrname)
{
FILE *srcfile;
char failmsg[128];
diff -r 6a1b4c95b7bf -r 6a5128f2216d external/bsd/atf/dist/atf-c/tc.c
--- a/external/bsd/atf/dist/atf-c/tc.c Mon Jan 16 22:36:30 2012 +0000
+++ b/external/bsd/atf/dist/atf-c/tc.c Mon Jan 16 22:41:30 2012 +0000
@@ -1,7 +1,7 @@
/*
* Automated Testing Framework (atf)
*
- * Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
Home |
Main Index |
Thread Index |
Old Index