CVS commit: src/external/bsd/atf/dist/atf-c

2024-07-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Jul 10 19:37:41 UTC 2024

Modified Files:
src/external/bsd/atf/dist/atf-c: macros.h

Log Message:
atf-c: detect accidental '=' in assertion condition

Seen several times in tests/libc/c063.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.8 -r1.2 src/external/bsd/atf/dist/atf-c/macros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-c/macros.h
diff -u src/external/bsd/atf/dist/atf-c/macros.h:1.1.1.8 src/external/bsd/atf/dist/atf-c/macros.h:1.2
--- src/external/bsd/atf/dist/atf-c/macros.h:1.1.1.8	Fri Feb 15 17:04:15 2013
+++ src/external/bsd/atf/dist/atf-c/macros.h	Wed Jul 10 19:37:41 2024
@@ -133,25 +133,25 @@
 
 #define ATF_REQUIRE_MSG(x, fmt, ...) \
 do { \
-if (!(x)) \
+if (x) {} else \
 atf_tc_fail_requirement(__FILE__, __LINE__, fmt, ##__VA_ARGS__); \
 } while(0)
 
 #define ATF_CHECK_MSG(x, fmt, ...) \
 do { \
-if (!(x)) \
+if (x) {} else \
 atf_tc_fail_check(__FILE__, __LINE__, fmt, ##__VA_ARGS__); \
 } while(0)
 
 #define ATF_REQUIRE(x) \
 do { \
-if (!(x)) \
+if (x) {} else \
 atf_tc_fail_requirement(__FILE__, __LINE__, "%s", #x " not met"); \
 } while(0)
 
 #define ATF_CHECK(x) \
 do { \
-if (!(x)) \
+if (x) {} else \
 atf_tc_fail_check(__FILE__, __LINE__, "%s", #x " not met"); \
 } while(0)
 



CVS commit: src/external/bsd/atf/dist/atf-c

2024-07-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Jul 10 19:37:41 UTC 2024

Modified Files:
src/external/bsd/atf/dist/atf-c: macros.h

Log Message:
atf-c: detect accidental '=' in assertion condition

Seen several times in tests/libc/c063.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.8 -r1.2 src/external/bsd/atf/dist/atf-c/macros.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist/doc

2023-08-27 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Sun Aug 27 19:27:23 UTC 2023

Modified Files:
src/external/bsd/atf/dist/doc: atf-test-case.4

Log Message:
atf-test-case.4: better explain custom metadata properties

Apply upstream change
https://github.com/jmmv/atf/commit/e8021f3b376f72702c612d4ae4eceb1bf70d85c6

(Only differences to upstream are "meta-data" is spelled consistently
with the rest of the project documentation and the date.)


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/atf/dist/doc/atf-test-case.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/doc/atf-test-case.4
diff -u src/external/bsd/atf/dist/doc/atf-test-case.4:1.7 src/external/bsd/atf/dist/doc/atf-test-case.4:1.8
--- src/external/bsd/atf/dist/doc/atf-test-case.4:1.7	Sat Feb  8 19:13:44 2014
+++ src/external/bsd/atf/dist/doc/atf-test-case.4	Sun Aug 27 19:27:23 2023
@@ -26,7 +26,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 13, 2011
+.Dd August 27, 2023
 .Dt ATF-TEST-CASE 4
 .Os
 .Sh NAME
@@ -153,11 +153,7 @@ APIs to implement the test cases.
 The standard input of the test cases is unconditionally connected to
 .Sq /dev/zero .
 .Ss Meta-data
-The following list describes all meta-data properties interpreted
-internally by ATF.
-You are free to define new properties in your test cases and use them as
-you wish, but non-standard properties must be prefixed by
-.Sq X- .
+The following meta-data properties can be exposed via the test case's head:
 .Bl -tag -width requireXmachineXX
 .It descr
 Type: textual.
@@ -271,6 +267,17 @@ test program.
 Can optionally be set to zero, in which case the test case has no run-time
 limit.
 This is discouraged.
+.It X- Ns Sq NAME
+Type: textual.
+Optional.
+.Pp
+A user-defined property named
+.Sq NAME .
+These properties are free form, have no special meaning within ATF, and can
+be specified at will by the test case.
+The runtime engine should propagate these properties from the test case to
+the end user so that the end user can rely on custom properties for test case
+tagging and classification.
 .El
 .Ss Environment
 Every time a test case is executed, several environment variables are



CVS commit: src/external/bsd/atf/dist/doc

2023-08-27 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Sun Aug 27 19:27:23 UTC 2023

Modified Files:
src/external/bsd/atf/dist/doc: atf-test-case.4

Log Message:
atf-test-case.4: better explain custom metadata properties

Apply upstream change
https://github.com/jmmv/atf/commit/e8021f3b376f72702c612d4ae4eceb1bf70d85c6

(Only differences to upstream are "meta-data" is spelled consistently
with the rest of the project documentation and the date.)


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/atf/dist/doc/atf-test-case.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist/atf-sh

2023-05-10 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Wed May 10 22:14:54 UTC 2023

Modified Files:
src/external/bsd/atf/dist/atf-sh: atf-check.1 atf-sh.1

Log Message:
atf-check.1 & atf-sh.1: remove references to -h option

These had their -h option removed in the ATF 0.19 release, but these
references in the man pages weren't (mostly) removed upstream until
a later commit (that hasn't been released).


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/atf/dist/atf-sh/atf-check.1 \
src/external/bsd/atf/dist/atf-sh/atf-sh.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-sh/atf-check.1
diff -u src/external/bsd/atf/dist/atf-sh/atf-check.1:1.1.1.2 src/external/bsd/atf/dist/atf-sh/atf-check.1:1.2
--- src/external/bsd/atf/dist/atf-sh/atf-check.1:1.1.1.2	Mon Jan 16 22:36:52 2012
+++ src/external/bsd/atf/dist/atf-sh/atf-check.1	Wed May 10 22:14:54 2023
@@ -26,7 +26,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd June 27, 2010
+.Dd May 10, 2023
 .Dt ATF-CHECK 1
 .Os
 .Sh NAME
@@ -39,14 +39,11 @@
 .Op Fl e Ar action:arg ...
 .Op Fl x
 .Ar command
-.Nm
-.Fl h
 .Sh DESCRIPTION
 .Nm
 executes a given command and analyzes its results, including
 exit code, stdout and stderr.
 .Pp
-In the first synopsis form,
 .Nm
 will execute the provided command and apply checks specified
 by arguments.
@@ -61,14 +58,8 @@ Multiple checks for the same output chan
 their results will be combined as a logical and (meaning that the output must
 match all the provided checks).
 .Pp
-In the second synopsis form,
-.Nm
-will print information about all supported options and their purpose.
-.Pp
 The following options are available:
 .Bl -tag  -width XqualXvalueXX
-.It Fl h
-Shows a short summary of all available options and their purpose.
 .It Fl s Ar qual:value
 Analyzes termination status.
 Must be one of:
Index: src/external/bsd/atf/dist/atf-sh/atf-sh.1
diff -u src/external/bsd/atf/dist/atf-sh/atf-sh.1:1.1.1.2 src/external/bsd/atf/dist/atf-sh/atf-sh.1:1.2
--- src/external/bsd/atf/dist/atf-sh/atf-sh.1:1.1.1.2	Sat Feb  8 19:11:32 2014
+++ src/external/bsd/atf/dist/atf-sh/atf-sh.1	Wed May 10 22:14:54 2023
@@ -26,7 +26,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 15, 2013
+.Dd May 10, 2023
 .Dt ATF-SH 1
 .Os
 .Sh NAME
@@ -35,8 +35,6 @@
 .Sh SYNOPSIS
 .Nm
 .Ar script
-.Nm
-.Fl h
 .Sh DESCRIPTION
 .Nm
 is an interpreter that runs the test program given in
@@ -62,12 +60,6 @@ should start with:
 .Bd -literal -offset indent
 #! /usr/bin/env atf-sh
 .Ed
-.Pp
-The following options are available:
-.Bl -tag -width XhXX
-.It Fl h
-Shows a short summary of all available options and their purpose.
-.El
 .Sh SEE ALSO
 .Xr atf-config 1 ,
 .Xr atf-sh-api 3 ,



CVS commit: src/external/bsd/atf/dist/atf-sh

2023-05-10 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Wed May 10 22:14:54 UTC 2023

Modified Files:
src/external/bsd/atf/dist/atf-sh: atf-check.1 atf-sh.1

Log Message:
atf-check.1 & atf-sh.1: remove references to -h option

These had their -h option removed in the ATF 0.19 release, but these
references in the man pages weren't (mostly) removed upstream until
a later commit (that hasn't been released).


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/atf/dist/atf-sh/atf-check.1 \
src/external/bsd/atf/dist/atf-sh/atf-sh.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist/tools

2023-04-03 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Mon Apr  3 16:26:50 UTC 2023

Modified Files:
src/external/bsd/atf/dist/tools: atf-run_test.sh

Log Message:
atf-run_test.sh: fix spelling of "through"

Reported by Jim Spath in PR misc/57318.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/atf/dist/tools/atf-run_test.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/tools/atf-run_test.sh
diff -u src/external/bsd/atf/dist/tools/atf-run_test.sh:1.1.1.1 src/external/bsd/atf/dist/tools/atf-run_test.sh:1.2
--- src/external/bsd/atf/dist/tools/atf-run_test.sh:1.1.1.1	Sat Feb  8 19:11:34 2014
+++ src/external/bsd/atf/dist/tools/atf-run_test.sh	Mon Apr  3 16:26:50 2023
@@ -219,11 +219,11 @@ vflag_body()
 atf_check -s eq:1 -o ignore -e ignore -x \
 "ATF_CONFDIR=$(pwd)/etc atf-run helper"
 
-echo "Checking that defining 'testvar' trough '-v' works."
+echo "Checking that defining 'testvar' through '-v' works."
 atf_check -s eq:0 -o match:'testvar: a value' -e ignore -x \
 "ATF_CONFDIR=$(pwd)/etc atf-run -v testvar='a value' helper"
 
-echo "Checking that defining 'testvar' trough the configuration" \
+echo "Checking that defining 'testvar' through the configuration" \
  "file works."
 mkdir etc
 cat >etc/common.conf <>Atffile
 atf_check -s eq:0 -o match:'testvar: a value' -e ignore -x \
   "ATF_CONFDIR=$(pwd)/etc atf-run helper"
 
-echo "Checking that defining 'testvar' trough the configuration" \
+echo "Checking that defining 'testvar' through the configuration" \
  "file overrides the one in the Atffile."
 mkdir etc
 cat >etc/common.conf <

CVS commit: src/external/bsd/atf/dist/tools

2023-04-03 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Mon Apr  3 16:26:50 UTC 2023

Modified Files:
src/external/bsd/atf/dist/tools: atf-run_test.sh

Log Message:
atf-run_test.sh: fix spelling of "through"

Reported by Jim Spath in PR misc/57318.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/atf/dist/tools/atf-run_test.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist/atf-c

2023-03-13 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Tue Mar 14 00:55:31 UTC 2023

Modified Files:
src/external/bsd/atf/dist/atf-c: atf-c-api.3

Log Message:
atf-c-api.3: correct ATF_TP_ADD_TC() examples to use "tp"


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/atf/dist/atf-c/atf-c-api.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-c/atf-c-api.3
diff -u src/external/bsd/atf/dist/atf-c/atf-c-api.3:1.5 src/external/bsd/atf/dist/atf-c/atf-c-api.3:1.6
--- src/external/bsd/atf/dist/atf-c/atf-c-api.3:1.5	Fri Jul  3 19:22:38 2020
+++ src/external/bsd/atf/dist/atf-c/atf-c-api.3	Tue Mar 14 00:55:31 2023
@@ -26,7 +26,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 15, 2013
+.Dd March 14, 2023
 .Dt ATF-C-API 3
 .Os
 .Sh NAME
@@ -243,9 +243,9 @@ ATF_TC_BODY(tc3, tc)
 
 ATF_TP_ADD_TCS(tp)
 {
-ATF_TP_ADD_TC(tcs, tc1);
-ATF_TP_ADD_TC(tcs, tc2);
-ATF_TP_ADD_TC(tcs, tc3);
+ATF_TP_ADD_TC(tp, tc1);
+ATF_TP_ADD_TC(tp, tc2);
+ATF_TP_ADD_TC(tp, tc3);
 ... add additional test cases ...
 
 return atf_no_error();



CVS commit: src/external/bsd/atf/dist/atf-c

2023-03-13 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Tue Mar 14 00:55:31 UTC 2023

Modified Files:
src/external/bsd/atf/dist/atf-c: atf-c-api.3

Log Message:
atf-c-api.3: correct ATF_TP_ADD_TC() examples to use "tp"


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/atf/dist/atf-c/atf-c-api.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist/tools

2021-07-08 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Thu Jul  8 18:10:52 UTC 2021

Modified Files:
src/external/bsd/atf/dist/tools: atf-run.cpp

Log Message:
When running an individual test case under isolation, make the test
case count on the tp-start line of the output match the number of test
cases actually executed (one) so that the atf-run output is valid
input to atf-report.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/atf/dist/tools/atf-run.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/tools/atf-run.cpp
diff -u src/external/bsd/atf/dist/tools/atf-run.cpp:1.6 src/external/bsd/atf/dist/tools/atf-run.cpp:1.7
--- src/external/bsd/atf/dist/tools/atf-run.cpp:1.6	Sat Apr 10 10:32:57 2021
+++ src/external/bsd/atf/dist/tools/atf-run.cpp	Thu Jul  8 18:10:52 2021
@@ -388,7 +388,22 @@ atf_run::run_test_program(const tools::f
 tools::fs::temp_dir resdir(
 tools::fs::path(tools::config::get("atf_workdir")) / "atf-run.XX");
 
-w.start_tp(tp.str(), md.test_cases.size());
+size_t nseltcs;
+if (tc.empty()) {
+nseltcs = md.test_cases.size();
+} else {
+nseltcs = 0;
+for (std::map< std::string, vars_map >::const_iterator iter
+ = md.test_cases.begin(); iter != md.test_cases.end(); iter++) {
+const std::string& tcname = (*iter).first;
+if (tcname == tc)
+nseltcs++;
+}
+if (nseltcs == 0)
+throw std::runtime_error("No such test case");
+}
+
+w.start_tp(tp.str(), nseltcs);
 if (md.test_cases.empty()) {
 w.end_tp("Bogus test program: reported 0 test cases");
 errcode = EXIT_FAILURE;



CVS commit: src/external/bsd/atf/dist/tools

2021-07-08 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Thu Jul  8 18:10:52 UTC 2021

Modified Files:
src/external/bsd/atf/dist/tools: atf-run.cpp

Log Message:
When running an individual test case under isolation, make the test
case count on the tp-start line of the output match the number of test
cases actually executed (one) so that the atf-run output is valid
input to atf-report.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/atf/dist/tools/atf-run.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/external/bsd/atf/dist/tools

2021-04-10 Thread Simon Burge
"Andreas Gustafsson" wrote:

> Module Name:  src
> Committed By: gson
> Date: Sat Apr 10 10:32:57 UTC 2021
>
> Modified Files:
>
>   src/external/bsd/atf/dist/tools: atf-run.1 atf-run.cpp
>
> Log Message:
>
> Add support for running individual test cases under isolation.

Thank you!  This will be useful to debug individual test case failures.

Cheers,
Simon.


CVS commit: src/external/bsd/atf/dist/tools

2021-04-10 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sat Apr 10 10:32:57 UTC 2021

Modified Files:
src/external/bsd/atf/dist/tools: atf-run.1 atf-run.cpp

Log Message:
Add support for running individual test cases under isolation.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/tools/atf-run.1
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/atf/dist/tools/atf-run.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/tools/atf-run.1
diff -u src/external/bsd/atf/dist/tools/atf-run.1:1.4 src/external/bsd/atf/dist/tools/atf-run.1:1.5
--- src/external/bsd/atf/dist/tools/atf-run.1:1.4	Sat Feb  8 19:13:44 2014
+++ src/external/bsd/atf/dist/tools/atf-run.1	Sat Apr 10 10:32:57 2021
@@ -26,23 +26,22 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 1, 2010
+.Dd April 10, 2021
 .Dt ATF-RUN 1
 .Os
 .Sh NAME
 .Nm atf-run
-.Nd executes a collection of test programs
+.Nd executes a collection of tests
 .Sh SYNOPSIS
 .Nm
 .Op Fl v Ar var1=value1 Op .. Fl v Ar varN=valueN
-.Op Ar test_program1 Op Ar .. test_programN
+.Op Ar test1 Op Ar .. testN
 .Nm
 .Fl h
 .Sh DESCRIPTION
 .Nm
-executes a collection of test programs or, in other words, a complete
-test suite.
-The results of each test program are collected by the tool, and are then
+executes a collection of test cases, test programs, or a complete test suite.
+The results of each test are collected by the tool, and are then
 multiplexed into a single machine-parseable report; see
 .Xr atf-formats 5
 for more details.
@@ -70,8 +69,14 @@ In the first synopsis form,
 parses the
 .Pa Atffile
 in the current directory and runs all the test programs specified in it.
-If any test program names are given as part of the command line, those are
-the ones executed instead of the complete list.
+If any
+.Ar test
+arguments are given as part of the command line, those tests are
+executed instead of the complete list.  Each
+.Ar test
+argument can be either the name of a test program, or a string of the form
+.Ar test_program:test_case
+to execute a single test case.
 .Pp
 In the second synopsis form,
 .Nm

Index: src/external/bsd/atf/dist/tools/atf-run.cpp
diff -u src/external/bsd/atf/dist/tools/atf-run.cpp:1.5 src/external/bsd/atf/dist/tools/atf-run.cpp:1.6
--- src/external/bsd/atf/dist/tools/atf-run.cpp:1.5	Tue Feb 11 18:13:45 2014
+++ src/external/bsd/atf/dist/tools/atf-run.cpp	Sat Apr 10 10:32:57 2021
@@ -81,11 +81,13 @@ class atf_run : public tools::applicatio
 
 size_t count_tps(std::vector< std::string >) const;
 
-int run_test(const tools::fs::path&, tools::test_program::atf_tps_writer&,
+int run_test(const tools::fs::path&, const std::string &,
+ tools::test_program::atf_tps_writer&,
  const vars_map&);
 int run_test_directory(const tools::fs::path&,
tools::test_program::atf_tps_writer&);
 int run_test_program(const tools::fs::path&,
+ const std::string tc,
  tools::test_program::atf_tps_writer&,
  const vars_map&);
 
@@ -179,7 +181,7 @@ std::string
 atf_run::specific_args(void)
 const
 {
-return "[test-program1 .. test-programN]";
+return "[test1 .. testN]";
 }
 
 atf_run::options_set
@@ -214,6 +216,7 @@ atf_run::parse_vflag(const std::string& 
 
 int
 atf_run::run_test(const tools::fs::path& tp,
+  const std::string ,
   tools::test_program::atf_tps_writer& w,
   const vars_map& config)
 {
@@ -226,7 +229,7 @@ atf_run::run_test(const tools::fs::path&
 const vars_map effective_config =
 tools::config_file::merge_configs(config, m_cmdline_vars);
 
-errcode = run_test_program(tp, w, effective_config);
+errcode = run_test_program(tp, tc, w, effective_config);
 }
 return errcode;
 }
@@ -247,7 +250,7 @@ atf_run::run_test_directory(const tools:
 bool ok = true;
 for (std::vector< std::string >::const_iterator iter = af.tps().begin();
  iter != af.tps().end(); iter++) {
-const bool result = run_test(tp / *iter, w,
+const bool result = run_test(tp / *iter, "", w,
 tools::config_file::merge_configs(af.conf(), test_suite_vars));
 ok &= (result == EXIT_SUCCESS);
 }
@@ -362,6 +365,7 @@ atf_run::get_test_case_result(const std:
 
 int
 atf_run::run_test_program(const tools::fs::path& tp,
+  const std::string tc,
   tools::test_program::atf_tps_writer& w,
   const vars_map& config)
 {
@@ -394,6 +398,9 @@ atf_run::run_test_program(const tools::f
 const std::string& tcname = (*iter).first;
 const vars_map& tcmd = (*iter).second;
 
+  

CVS commit: src/external/bsd/atf/dist/tools

2021-04-10 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sat Apr 10 10:32:57 UTC 2021

Modified Files:
src/external/bsd/atf/dist/tools: atf-run.1 atf-run.cpp

Log Message:
Add support for running individual test cases under isolation.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/tools/atf-run.1
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/atf/dist/tools/atf-run.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist/tools

2021-03-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 28 16:35:37 UTC 2021

Modified Files:
src/external/bsd/atf/dist/tools: fs.cpp fs.hpp test-program.cpp

Log Message:
If we are running the test as an unprivileged user, hand ownership of the
test directory to that user.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/tools/fs.cpp
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/tools/fs.hpp
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/dist/tools/test-program.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist/tools

2021-03-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 28 16:35:37 UTC 2021

Modified Files:
src/external/bsd/atf/dist/tools: fs.cpp fs.hpp test-program.cpp

Log Message:
If we are running the test as an unprivileged user, hand ownership of the
test directory to that user.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/tools/fs.cpp
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/tools/fs.hpp
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/dist/tools/test-program.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/tools/fs.cpp
diff -u src/external/bsd/atf/dist/tools/fs.cpp:1.4 src/external/bsd/atf/dist/tools/fs.cpp:1.5
--- src/external/bsd/atf/dist/tools/fs.cpp:1.4	Sat Nov 11 09:16:06 2017
+++ src/external/bsd/atf/dist/tools/fs.cpp	Sun Mar 28 12:35:37 2021
@@ -683,6 +683,17 @@ impl::rmdir(const path& p)
 }
 }
 
+void
+impl::change_ownership(const path& p, const std::pair < int, int >& user)
+{
+if (::chown(p.c_str(), user.first, user.second) == -1) {
+std::stringstream ss;
+ss << IMPL_NAME "::chown(" << p.str() << ", " << user.first << ", "
+   << user.second << ")";
+throw tools::system_error(ss.str(), "chown(2) failed", errno);
+}
+}
+
 impl::path
 impl::change_directory(const path& dir)
 {

Index: src/external/bsd/atf/dist/tools/fs.hpp
diff -u src/external/bsd/atf/dist/tools/fs.hpp:1.2 src/external/bsd/atf/dist/tools/fs.hpp:1.3
--- src/external/bsd/atf/dist/tools/fs.hpp:1.2	Mon Mar  9 16:34:52 2020
+++ src/external/bsd/atf/dist/tools/fs.hpp	Sun Mar 28 12:35:37 2021
@@ -368,6 +368,7 @@ void remove(const path&);
 void rmdir(const path&);
 
 tools::fs::path change_directory(const tools::fs::path&);
+void change_ownership(const tools::fs::path&, const std::pair< int, int >&);
 void cleanup(const tools::fs::path&);
 tools::fs::path get_current_dir(void);
 

Index: src/external/bsd/atf/dist/tools/test-program.cpp
diff -u src/external/bsd/atf/dist/tools/test-program.cpp:1.3 src/external/bsd/atf/dist/tools/test-program.cpp:1.4
--- src/external/bsd/atf/dist/tools/test-program.cpp:1.3	Wed Dec 30 17:23:38 2015
+++ src/external/bsd/atf/dist/tools/test-program.cpp	Sun Mar 28 12:35:37 2021
@@ -304,8 +304,10 @@ run_test_case_child(void* raw_params)
 
 const std::pair< int, int > user = tools::get_required_user(
 params->metadata, params->config);
-if (user.first != -1 && user.second != -1)
+if (user.first != -1 && user.second != -1) {
+tools::fs::change_ownership(params->workdir, user);
 tools::user::drop_privileges(user);
+}
 
 // The input 'tp' parameter may be relative and become invalid once
 // we change the current working directory.



CVS commit: src/external/bsd/atf/dist/atf-sh

2020-09-10 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Sep 10 22:51:11 UTC 2020

Modified Files:
src/external/bsd/atf/dist/atf-sh: libatf-sh.subr

Log Message:
Replace a pipe into tr to normalise a var name (convert '.' or '-'
into '_' to meet sh variable name rules) into a shell string processing
loop.

On my test system, this reduces the total elapsed time for the bin/sh ATF
tests from about 109 secs to about 102 (user cpu from 24.5 to 21, sys cpu
from 34 to 30) and the usr.bin/make tests elapsed time from 42.5 to 40
secs (user from a bit over 15 to a bit over 13, and sys from 16+ to 13+).
(Recorded on an AMD64 domU).

These probably exaggerate the effect, as there are a bunch of quite small
tests, which means the ATF overhead (which this change affects) is a greater
proportion of the total test time than for some other tests where most of
the time is spent actually testing.

But I am fairly confident that there will be at least some improvement.

This could be further improved by removing the cmdsub invocation method,
and instead passing the name of a variable containing the string to
normalise (with the result returned in that same var) - but that would
mean altering all the callers as well.   Some other time maybe.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/atf-sh/libatf-sh.subr

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist/atf-sh

2020-09-10 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Sep 10 22:51:11 UTC 2020

Modified Files:
src/external/bsd/atf/dist/atf-sh: libatf-sh.subr

Log Message:
Replace a pipe into tr to normalise a var name (convert '.' or '-'
into '_' to meet sh variable name rules) into a shell string processing
loop.

On my test system, this reduces the total elapsed time for the bin/sh ATF
tests from about 109 secs to about 102 (user cpu from 24.5 to 21, sys cpu
from 34 to 30) and the usr.bin/make tests elapsed time from 42.5 to 40
secs (user from a bit over 15 to a bit over 13, and sys from 16+ to 13+).
(Recorded on an AMD64 domU).

These probably exaggerate the effect, as there are a bunch of quite small
tests, which means the ATF overhead (which this change affects) is a greater
proportion of the total test time than for some other tests where most of
the time is spent actually testing.

But I am fairly confident that there will be at least some improvement.

This could be further improved by removing the cmdsub invocation method,
and instead passing the name of a variable containing the string to
normalise (with the result returned in that same var) - but that would
mean altering all the callers as well.   Some other time maybe.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/atf-sh/libatf-sh.subr

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-sh/libatf-sh.subr
diff -u src/external/bsd/atf/dist/atf-sh/libatf-sh.subr:1.4 src/external/bsd/atf/dist/atf-sh/libatf-sh.subr:1.5
--- src/external/bsd/atf/dist/atf-sh/libatf-sh.subr:1.4	Wed Dec 30 22:23:02 2015
+++ src/external/bsd/atf/dist/atf-sh/libatf-sh.subr	Thu Sep 10 22:51:10 2020
@@ -544,7 +544,15 @@ _atf_list_tcs()
 #
 _atf_normalize()
 {
-echo ${1} | tr .- __
+while :
+do
+	case "${1}" in
+	(*.*)	set -- "${1%.*}_${1##*.}";;
+	(*-*)	set -- "${1%-*}_${1##*-}";;
+	(*)	break;;
+	esac
+done
+printf "%s\n" "$1"
 }
 
 #



CVS commit: src/external/bsd/atf/dist/atf-c

2020-07-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jul  3 19:22:39 UTC 2020

Modified Files:
src/external/bsd/atf/dist/atf-c: atf-c-api.3

Log Message:
Consistent use of comma in lists.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/atf-c/atf-c-api.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-c/atf-c-api.3
diff -u src/external/bsd/atf/dist/atf-c/atf-c-api.3:1.4 src/external/bsd/atf/dist/atf-c/atf-c-api.3:1.5
--- src/external/bsd/atf/dist/atf-c/atf-c-api.3:1.4	Sat Feb  8 19:13:43 2014
+++ src/external/bsd/atf/dist/atf-c/atf-c-api.3	Fri Jul  3 19:22:38 2020
@@ -276,15 +276,15 @@ In order to do so, a later registration 
 macro detailed in
 .Sx Program initialization .
 .Pp
-Later on, one must define the three parts of the body by means of three
+Later on, one must define the three parts of the test by means of three
 functions.
 Their headers are given by the
 .Fn ATF_TC_HEAD ,
-.Fn ATF_TC_BODY
+.Fn ATF_TC_BODY ,
 and
 .Fn ATF_TC_CLEANUP
 macros, all of which take the test case name provided to the
-.Fn ATF_TC
+.Fn ATF_TC ,
 .Fn ATF_TC_WITH_CLEANUP ,
 or
 .Fn ATF_TC_WITHOUT_HEAD



CVS commit: src/external/bsd/atf/dist/atf-c

2020-07-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jul  3 19:22:39 UTC 2020

Modified Files:
src/external/bsd/atf/dist/atf-c: atf-c-api.3

Log Message:
Consistent use of comma in lists.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/atf-c/atf-c-api.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist/tools

2020-04-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr 23 16:05:16 UTC 2020

Modified Files:
src/external/bsd/atf/dist/tools: env.cpp

Log Message:
Add the system binary paths too since tests use them.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/dist/tools/env.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/tools/env.cpp
diff -u src/external/bsd/atf/dist/tools/env.cpp:1.3 src/external/bsd/atf/dist/tools/env.cpp:1.4
--- src/external/bsd/atf/dist/tools/env.cpp:1.3	Mon Mar 30 21:02:18 2020
+++ src/external/bsd/atf/dist/tools/env.cpp	Thu Apr 23 12:05:15 2020
@@ -53,7 +53,7 @@ impl::get(const std::string& name)
 if (val != NULL)
 	return val;
 if (strcmp(n, "PATH") == 0)
-	return "/bin:/usr/bin";
+	return "/bin:/usr/bin:/sbin:/usr/sbin";
 	
 throw tools::system_error(IMPL_NAME "::set",
 			"Cannot get environment variable '" + name +



CVS commit: src/external/bsd/atf/dist/tools

2020-04-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr 23 16:05:16 UTC 2020

Modified Files:
src/external/bsd/atf/dist/tools: env.cpp

Log Message:
Add the system binary paths too since tests use them.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/dist/tools/env.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist/tools

2020-03-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar 31 01:02:18 UTC 2020

Modified Files:
src/external/bsd/atf/dist/tools: env.cpp

Log Message:
Allow env - atf-run to work by setting a default minimal path.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/tools/env.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/tools/env.cpp
diff -u src/external/bsd/atf/dist/tools/env.cpp:1.2 src/external/bsd/atf/dist/tools/env.cpp:1.3
--- src/external/bsd/atf/dist/tools/env.cpp:1.2	Tue Feb 11 12:28:20 2014
+++ src/external/bsd/atf/dist/tools/env.cpp	Mon Mar 30 21:02:18 2020
@@ -48,9 +48,16 @@ namespace impl = tools::env;
 std::string
 impl::get(const std::string& name)
 {
-const char* val = getenv(name.c_str());
-assert(val != NULL);
-return val;
+const char *n =name.c_str();
+const char* val = getenv(n);
+if (val != NULL)
+	return val;
+if (strcmp(n, "PATH") == 0)
+	return "/bin:/usr/bin";
+	
+throw tools::system_error(IMPL_NAME "::set",
+			"Cannot get environment variable '" + name +
+			"'", errno);
 }
 
 bool



CVS commit: src/external/bsd/atf/dist/tools

2020-03-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar 31 01:02:18 UTC 2020

Modified Files:
src/external/bsd/atf/dist/tools: env.cpp

Log Message:
Allow env - atf-run to work by setting a default minimal path.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/tools/env.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist

2019-10-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct  9 01:18:55 UTC 2019

Modified Files:
src/external/bsd/atf/dist/atf-c++: build.cpp
src/external/bsd/atf/dist/atf-sh: atf-check.cpp
src/external/bsd/atf/dist/tools: process.cpp

Log Message:
the cast police is looking for me.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/atf/dist/atf-c++/build.cpp
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/atf/dist/atf-sh/atf-check.cpp
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/atf/dist/tools/process.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-c++/build.cpp
diff -u src/external/bsd/atf/dist/atf-c++/build.cpp:1.1.1.2 src/external/bsd/atf/dist/atf-c++/build.cpp:1.2
--- src/external/bsd/atf/dist/atf-c++/build.cpp:1.1.1.2	Wed Oct 20 05:14:20 2010
+++ src/external/bsd/atf/dist/atf-c++/build.cpp	Tue Oct  8 21:18:55 2019
@@ -63,7 +63,7 @@ atf::process::argv_array
 cargv_to_argv_and_free(char** l)
 {
 try {
-atf::process::argv_array argv((const char* const*)l);
+atf::process::argv_array argv(const_cast(l));
 atf_utils_free_charpp(l);
 return argv;
 } catch (...) {

Index: src/external/bsd/atf/dist/atf-sh/atf-check.cpp
diff -u src/external/bsd/atf/dist/atf-sh/atf-check.cpp:1.11 src/external/bsd/atf/dist/atf-sh/atf-check.cpp:1.12
--- src/external/bsd/atf/dist/atf-sh/atf-check.cpp:1.11	Fri Oct  4 05:19:18 2019
+++ src/external/bsd/atf/dist/atf-sh/atf-check.cpp	Tue Oct  8 21:18:55 2019
@@ -498,7 +498,7 @@ decode(const std::string& s)
 {
 int count = 3;
 c = 0;
-while (--count >= 0 && (unsigned)(s[i] - '0') < 8)
+while (--count >= 0 && static_cast(s[i] - '0') < 8)
 c = (c << 3) + (s[i++] - '0');
 break;
 }

Index: src/external/bsd/atf/dist/tools/process.cpp
diff -u src/external/bsd/atf/dist/tools/process.cpp:1.5 src/external/bsd/atf/dist/tools/process.cpp:1.6
--- src/external/bsd/atf/dist/tools/process.cpp:1.5	Sat Feb  3 20:41:05 2018
+++ src/external/bsd/atf/dist/tools/process.cpp	Tue Oct  8 21:18:55 2019
@@ -102,8 +102,7 @@ static
 int
 const_execvp(const char *file, const char *const *argv)
 {
-#define UNCONST(a) ((void *)(unsigned long)(const void *)(a))
-return ::execvp(file, (char* const*)(UNCONST(argv)));
+return ::execvp(file, const_cast(argv));
 #undef UNCONST
 }
 



CVS commit: src/external/bsd/atf/dist

2019-10-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct  9 01:18:55 UTC 2019

Modified Files:
src/external/bsd/atf/dist/atf-c++: build.cpp
src/external/bsd/atf/dist/atf-sh: atf-check.cpp
src/external/bsd/atf/dist/tools: process.cpp

Log Message:
the cast police is looking for me.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/atf/dist/atf-c++/build.cpp
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/atf/dist/atf-sh/atf-check.cpp
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/atf/dist/tools/process.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist/atf-sh

2019-10-04 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Oct  4 09:19:19 UTC 2019

Modified Files:
src/external/bsd/atf/dist/atf-sh: atf-check.cpp

Log Message:
give a catch() a variable.  gcc 8 is picky:

atf-check.cpp:221:23: error: catching polymorphic type 'class 
std::runtime_error' by value [-Werror=catch-value=]


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/atf/dist/atf-sh/atf-check.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-sh/atf-check.cpp
diff -u src/external/bsd/atf/dist/atf-sh/atf-check.cpp:1.10 src/external/bsd/atf/dist/atf-sh/atf-check.cpp:1.11
--- src/external/bsd/atf/dist/atf-sh/atf-check.cpp:1.10	Fri Dec  4 01:43:58 2015
+++ src/external/bsd/atf/dist/atf-sh/atf-check.cpp	Fri Oct  4 09:19:18 2019
@@ -218,7 +218,7 @@ parse_signal(const std::string& str)
 if (signo == INT_MIN) {
 try {
 return atf::text::to_type< int >(str);
-} catch (std::runtime_error) {
+} catch (std::runtime_error ) {
 throw atf::application::usage_error("Invalid signal name or number "
 "in -s option");
 }



CVS commit: src/external/bsd/atf/dist/atf-sh

2019-10-04 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Oct  4 09:19:19 UTC 2019

Modified Files:
src/external/bsd/atf/dist/atf-sh: atf-check.cpp

Log Message:
give a catch() a variable.  gcc 8 is picky:

atf-check.cpp:221:23: error: catching polymorphic type 'class 
std::runtime_error' by value [-Werror=catch-value=]


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/atf/dist/atf-sh/atf-check.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist/tools

2017-11-11 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Nov 11 14:16:06 UTC 2017

Modified Files:
src/external/bsd/atf/dist/tools: fs.cpp

Log Message:
don't use auto_ptr with memory allocated by C code
silences alloc-dealloc-mismatch warnings from asan

from joerg


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/dist/tools/fs.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist/tools

2017-11-11 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Nov 11 14:16:06 UTC 2017

Modified Files:
src/external/bsd/atf/dist/tools: fs.cpp

Log Message:
don't use auto_ptr with memory allocated by C code
silences alloc-dealloc-mismatch warnings from asan

from joerg


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/dist/tools/fs.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/tools/fs.cpp
diff -u src/external/bsd/atf/dist/tools/fs.cpp:1.3 src/external/bsd/atf/dist/tools/fs.cpp:1.4
--- src/external/bsd/atf/dist/tools/fs.cpp:1.3	Tue Feb 11 18:13:45 2014
+++ src/external/bsd/atf/dist/tools/fs.cpp	Sat Nov 11 14:16:06 2017
@@ -707,11 +707,17 @@ impl::cleanup(const path& p)
 impl::path
 impl::get_current_dir(void)
 {
-std::auto_ptr< char > cwd;
-cwd.reset(getcwd(NULL, 0));
-if (cwd.get() == NULL)
+char *cwd = getcwd(NULL, 0);
+if (cwd == NULL)
 throw tools::system_error(IMPL_NAME "::get_current_dir()",
 "getcwd() failed", errno);
 
-return path(cwd.get());
+try {
+impl::path p(cwd);
+free(cwd);
+return p;
+} catch(...) {
+free(cwd);
+throw;
+}
 }



CVS commit: src/external/bsd/atf/dist/atf-sh

2017-05-14 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon May 15 04:54:09 UTC 2017

Modified Files:
src/external/bsd/atf/dist/atf-sh: atf-sh-api.3

Log Message:
Add some information learned from experience with using (and abusing)
this API...

While here do some markup improvements (it is amazing what one can
learn from observing a wizard at work!) (which still probably need more work.)
In particular, sh functions are not functions in the mdoc .Fn sense!
(Many places where explicit double quotes were not doing what was intended.)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.7 -r1.2 src/external/bsd/atf/dist/atf-sh/atf-sh-api.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-sh/atf-sh-api.3
diff -u src/external/bsd/atf/dist/atf-sh/atf-sh-api.3:1.1.1.7 src/external/bsd/atf/dist/atf-sh/atf-sh-api.3:1.2
--- src/external/bsd/atf/dist/atf-sh/atf-sh-api.3:1.1.1.7	Sat Feb  8 19:11:32 2014
+++ src/external/bsd/atf/dist/atf-sh/atf-sh-api.3	Mon May 15 04:54:09 2017
@@ -26,7 +26,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 13, 2013
+.Dd May 15, 2017
 .Dt ATF-SH-API 3
 .Os
 .Sh NAME
@@ -51,25 +51,44 @@
 .Nm atf_test_case
 .Nd POSIX shell API to write ATF-based test programs
 .Sh SYNOPSIS
-.Fn atf_add_test_case "name"
-.Fn atf_check "command"
-.Fn atf_check_equal "expr1" "expr2"
-.Fn atf_config_get "var_name"
-.Fn atf_config_has "var_name"
-.Fn atf_expect_death "reason" "..."
-.Fn atf_expect_exit "exitcode" "reason" "..."
-.Fn atf_expect_fail "reason" "..."
-.Fn atf_expect_pass
-.Fn atf_expect_signal "signo" "reason" "..."
-.Fn atf_expect_timeout "reason" "..."
-.Fn atf_fail "reason"
-.Fn atf_get "var_name"
-.Fn atf_get_srcdir
-.Fn atf_pass
-.Fn atf_require_prog "prog_name"
-.Fn atf_set "var_name" "value"
-.Fn atf_skip "reason"
-.Fn atf_test_case "name" "cleanup"
+.Ic atf_add_test_case Dq name
+.br
+.Ic atf_check Dq command
+.br
+.Ic atf_check_equal Do expr1 Dc Dq expr2
+.br
+.Ic atf_config_get Dq var_name
+.br
+.Ic atf_config_has Dq var_name
+.br
+.Ic atf_expect_death Do reason Dc Dq \&...
+.br
+.Ic atf_expect_exit Do exitcode Dc Do reason Dc Dq \&...
+.br
+.Ic atf_expect_fail Do reason Dc Dq \&...
+.br
+.Ic atf_expect_pass
+.br
+.Ic atf_expect_signal Do signo Dc Do reason Dc Dq \&...
+.br
+.Ic atf_expect_timeout Do reason Dc Dq \&...
+.br
+.Ic atf_fail Dq reason
+.br
+.Ic atf_get Dq var_name
+.br
+.Ic atf_get_srcdir
+.br
+.Ic atf_pass
+.br
+.Ic atf_require_prog Dq prog_name
+.br
+.Ic atf_set Do var_name Dc Dq value
+.br
+.Ic atf_skip Dq reason
+.br
+.Ic atf_test_case Do name Dc Dq cleanup
+.br
 .Sh DESCRIPTION
 ATF
 provides a simple but powerful interface to easily write test programs in
@@ -114,13 +133,43 @@ atf_init_test_cases() {
 ... add additional test cases ...
 }
 .Ed
+.Pp
+All of these functions are required to return with an exit-status of
+zero, or ATF will determine that the test is faulty.
+In particular, this means that none may end with a conditional like:
+.Bd -literal -offset indent
+atf_sh_function() {
+... appropriate code here ...
+condition-test && {
+	... more code here ...
+}
+}
+.Ed
+.Pp
+as if condition-test fails
+the return code from atf_sh_function will not be 0.
+This can be corrected by adding
+.Bd -literal -offset indent
+return 0
+.Ed
+.Pp
+before the end of the function, or by writing it as
+.Bd -literal -offset indent
+atf_sh_function() {
+... appropriate code here ...
+if condition-test
+then
+	... more code here ...
+fi
+}
+.Ed
 .Ss Definition of test cases
 Test cases have an identifier and are composed of three different parts:
 the header, the body and an optional cleanup routine, all of which are
 described in
 .Xr atf-test-case 4 .
 To define test cases, one can use the
-.Fn atf_test_case
+.Ic atf_test_case
 function, which takes a first parameter specifiying the test case's
 name and instructs the library to set things up to accept it as a valid
 test case.
@@ -132,33 +181,34 @@ It is important to note that this functi
 .Em does not
 set the test case up for execution when the program is run.
 In order to do so, a later registration is needed through the
-.Fn atf_add_test_case
+.Ic atf_add_test_case
 function detailed in
 .Sx Program initialization .
 .Pp
 Later on, one must define the three parts of the body by providing two
 or three functions (remember that the cleanup routine is optional).
 These functions are named after the test case's identifier, and are
-.Fn _head ,
-.Fn _body
+.Ic _head ,
+.Ic _body
 and
-.Fn _cleanup.
+.Ic _cleanup.
 None of these take parameters when executed.
 .Ss Program initialization
 The test program must define an
-.Fn atf_init_test_cases
+.Ic atf_init_test_cases
 function, which is in charge of registering the test cases that will be
 executed at run time by using 

CVS commit: src/external/bsd/atf/dist/atf-sh

2017-05-14 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon May 15 04:54:09 UTC 2017

Modified Files:
src/external/bsd/atf/dist/atf-sh: atf-sh-api.3

Log Message:
Add some information learned from experience with using (and abusing)
this API...

While here do some markup improvements (it is amazing what one can
learn from observing a wizard at work!) (which still probably need more work.)
In particular, sh functions are not functions in the mdoc .Fn sense!
(Many places where explicit double quotes were not doing what was intended.)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.7 -r1.2 src/external/bsd/atf/dist/atf-sh/atf-sh-api.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist/atf-sh

2015-12-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 30 22:23:02 UTC 2015

Modified Files:
src/external/bsd/atf/dist/atf-sh: libatf-sh.subr

Log Message:
Work around ksh bug


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/dist/atf-sh/libatf-sh.subr

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-sh/libatf-sh.subr
diff -u src/external/bsd/atf/dist/atf-sh/libatf-sh.subr:1.3 src/external/bsd/atf/dist/atf-sh/libatf-sh.subr:1.4
--- src/external/bsd/atf/dist/atf-sh/libatf-sh.subr:1.3	Thu Jan  9 20:39:32 2014
+++ src/external/bsd/atf/dist/atf-sh/libatf-sh.subr	Wed Dec 30 17:23:02 2015
@@ -526,7 +526,10 @@ _atf_list_tcs()
 
 echo "ident: $(atf_get ident)"
 for _var in ${Test_Case_Vars}; do
+	# Elide ksh bug!
+	set +e
 [ "${_var}" != "ident" ] && echo "${_var}: $(atf_get ${_var})"
+	set -e
 done
 
 [ ${#} -gt 1 ] && echo



CVS commit: src/external/bsd/atf/dist/tools

2015-12-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 30 22:23:38 UTC 2015

Modified Files:
src/external/bsd/atf/dist/tools: process.cpp process.hpp
test-program.cpp

Log Message:
Print symbolically why the process exited.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/dist/tools/process.cpp
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/atf/dist/tools/process.hpp
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/tools/test-program.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/tools/process.cpp
diff -u src/external/bsd/atf/dist/tools/process.cpp:1.3 src/external/bsd/atf/dist/tools/process.cpp:1.4
--- src/external/bsd/atf/dist/tools/process.cpp:1.3	Tue Feb 11 13:13:45 2014
+++ src/external/bsd/atf/dist/tools/process.cpp	Wed Dec 30 17:23:38 2015
@@ -360,6 +360,25 @@ impl::status::~status(void)
 {
 }
 
+std::string
+impl::status::str(void)
+ const
+{
+int mutable_status = m_status;
+std::stringstream rv;
+if (WIFEXITED(mutable_status))
+	rv << "exit("  << WEXITSTATUS(mutable_status);
+else if (WIFSTOPPED(mutable_status))
+	rv << "stopped("  << WSTOPSIG(mutable_status);
+else if (WIFSIGNALED(mutable_status))
+	rv << "terminated("  << WTERMSIG(mutable_status);
+if (WCOREDUMP(mutable_status))
+	rv << "/core)";
+else
+	rv << ")";
+return rv.str();
+}
+
 bool
 impl::status::exited(void)
 const

Index: src/external/bsd/atf/dist/tools/process.hpp
diff -u src/external/bsd/atf/dist/tools/process.hpp:1.1.1.1 src/external/bsd/atf/dist/tools/process.hpp:1.2
--- src/external/bsd/atf/dist/tools/process.hpp:1.1.1.1	Sat Feb  8 14:11:33 2014
+++ src/external/bsd/atf/dist/tools/process.hpp	Wed Dec 30 17:23:38 2015
@@ -207,6 +207,8 @@ class status {
 public:
 ~status(void);
 
+std::string str(void) const;
+
 bool exited(void) const;
 int exitstatus(void) const;
 

Index: src/external/bsd/atf/dist/tools/test-program.cpp
diff -u src/external/bsd/atf/dist/tools/test-program.cpp:1.2 src/external/bsd/atf/dist/tools/test-program.cpp:1.3
--- src/external/bsd/atf/dist/tools/test-program.cpp:1.2	Tue Feb 11 11:31:38 2014
+++ src/external/bsd/atf/dist/tools/test-program.cpp	Wed Dec 30 17:23:38 2015
@@ -664,7 +664,7 @@ impl::get_metadata(const tools::fs::path
 const tools::process::status status = child.wait();
 if (!status.exited() || status.exitstatus() != EXIT_SUCCESS)
 throw tools::parser::format_error("Test program returned failure "
-"exit status for test case list");
+	"exit status " + status.str() + " for test case list");
 
 return metadata(parser.get_tcs());
 }



CVS commit: src/external/bsd/atf/dist/tools

2015-12-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 30 22:23:38 UTC 2015

Modified Files:
src/external/bsd/atf/dist/tools: process.cpp process.hpp
test-program.cpp

Log Message:
Print symbolically why the process exited.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/dist/tools/process.cpp
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/atf/dist/tools/process.hpp
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/tools/test-program.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist/atf-sh

2015-12-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec  4 01:43:58 UTC 2015

Modified Files:
src/external/bsd/atf/dist/atf-sh: atf-check.cpp

Log Message:
fix the open error messages to include the right file and strerror


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/atf/dist/atf-sh/atf-check.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-sh/atf-check.cpp
diff -u src/external/bsd/atf/dist/atf-sh/atf-check.cpp:1.9 src/external/bsd/atf/dist/atf-sh/atf-check.cpp:1.10
--- src/external/bsd/atf/dist/atf-sh/atf-check.cpp:1.9	Sat Feb  8 14:13:44 2014
+++ src/external/bsd/atf/dist/atf-sh/atf-check.cpp	Thu Dec  3 20:43:58 2015
@@ -359,11 +359,20 @@ execute_with_shell(char* const* argv)
 
 static
 void
+open_error(const atf::fs::path& path)
+{
+throw std::runtime_error("Failed to open " + path.str() + " "
+	+ ::strerror(errno));
+}
+	
+
+static
+void
 cat_file(const atf::fs::path& path)
 {
 std::ifstream stream(path.c_str());
 if (!stream)
-throw std::runtime_error("Failed to open " + path.str());
+	open_error(path);
 
 stream >> std::noskipws;
 std::istream_iterator< char > begin(stream), end;
@@ -379,7 +388,7 @@ grep_file(const atf::fs::path& path, con
 {
 std::ifstream stream(path.c_str());
 if (!stream)
-throw std::runtime_error("Failed to open " + path.str());
+	open_error(path);
 
 bool found = false;
 
@@ -410,11 +419,11 @@ compare_files(const atf::fs::path& p1, c
 
 std::ifstream f1(p1.c_str());
 if (!f1)
-throw std::runtime_error("Failed to open " + p1.str());
+	open_error(p1);
 
 std::ifstream f2(p2.c_str());
 if (!f2)
-throw std::runtime_error("Failed to open " + p1.str());
+	open_error(p2);
 
 for (;;) {
 char buf1[512], buf2[512];



CVS commit: src/external/bsd/atf/dist/atf-sh

2015-12-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec  4 01:43:58 UTC 2015

Modified Files:
src/external/bsd/atf/dist/atf-sh: atf-check.cpp

Log Message:
fix the open error messages to include the right file and strerror


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/atf/dist/atf-sh/atf-check.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist/atf-sh

2015-02-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 23 08:48:18 UTC 2015

Modified Files:
src/external/bsd/atf/dist/atf-sh: atf_check_test.sh

Log Message:
Wait 10 seconds instead of 1 before killing the helper - otherwise on slow
machines it might not have gotten around to execute the first command at
all (and since it next waits for 42 seconds, 10 seconds is safe).


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.5 -r1.2 \
src/external/bsd/atf/dist/atf-sh/atf_check_test.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-sh/atf_check_test.sh
diff -u src/external/bsd/atf/dist/atf-sh/atf_check_test.sh:1.1.1.5 src/external/bsd/atf/dist/atf-sh/atf_check_test.sh:1.2
--- src/external/bsd/atf/dist/atf-sh/atf_check_test.sh:1.1.1.5	Sat Feb  8 19:11:32 2014
+++ src/external/bsd/atf/dist/atf-sh/atf_check_test.sh	Mon Feb 23 08:48:18 2015
@@ -174,7 +174,7 @@ flush_stdout_on_timeout_body()
 $(atf_get_srcdir)/misc_helpers -s $(atf_get_srcdir) atf_check_timeout \
 out 2err 
 pid=${!}
-sleep 1
+sleep 10
 kill ${pid}
 
 grep 'Executing command.*true' out \



CVS commit: src/external/bsd/atf/dist/atf-sh

2015-02-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 23 08:48:18 UTC 2015

Modified Files:
src/external/bsd/atf/dist/atf-sh: atf_check_test.sh

Log Message:
Wait 10 seconds instead of 1 before killing the helper - otherwise on slow
machines it might not have gotten around to execute the first command at
all (and since it next waits for 42 seconds, 10 seconds is safe).


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.5 -r1.2 \
src/external/bsd/atf/dist/atf-sh/atf_check_test.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist

2015-01-22 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Thu Jan 22 12:33:36 UTC 2015

Modified Files:
src/external/bsd/atf/dist/atf-c: macros_test.c
src/external/bsd/atf/dist/atf-c++: macros_test.cpp

Log Message:
Mark atf/atf-c/macros_test/detect_unused_tests and
atf/atf-c++/macros_test/detect_unused_tests as expected failures
when using versions of GCC where they are known to fail, with a
reference to PR toolchain/49187.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/atf-c/macros_test.c
cvs rdiff -u -r1.1.1.8 -r1.2 \
src/external/bsd/atf/dist/atf-c++/macros_test.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-c/macros_test.c
diff -u src/external/bsd/atf/dist/atf-c/macros_test.c:1.4 src/external/bsd/atf/dist/atf-c/macros_test.c:1.5
--- src/external/bsd/atf/dist/atf-c/macros_test.c:1.4	Sat Feb  8 19:13:43 2014
+++ src/external/bsd/atf/dist/atf-c/macros_test.c	Thu Jan 22 12:33:35 2015
@@ -863,6 +863,10 @@ ATF_TC_BODY(detect_unused_tests, tc)
 atf_tc_expect_fail(Compiler does not raise a warning on an unused 
static global variable declared by a macro);
 
+#if __GNUC__  4 || (__GNUC__ == 4  __GNUC_MINOR__ = 8)
+atf_tc_expect_fail(PR 49187);
+#endif
+
 if (build_check_c_o_srcdir(tc, unused_test.c))
 atf_tc_fail(Build of unused_test.c passed; unused test cases are 
 not properly detected);

Index: src/external/bsd/atf/dist/atf-c++/macros_test.cpp
diff -u src/external/bsd/atf/dist/atf-c++/macros_test.cpp:1.1.1.8 src/external/bsd/atf/dist/atf-c++/macros_test.cpp:1.2
--- src/external/bsd/atf/dist/atf-c++/macros_test.cpp:1.1.1.8	Sat Feb  8 19:11:31 2014
+++ src/external/bsd/atf/dist/atf-c++/macros_test.cpp	Thu Jan 22 12:33:36 2015
@@ -783,6 +783,10 @@ ATF_TEST_CASE_BODY(detect_unused_tests)
 expect_fail(Compiler does not raise a warning on an unused 
 static global variable declared by a macro);
 
+#if __GNUC__  4 || (__GNUC__ == 4  __GNUC_MINOR__ = 8)
+expect_fail(PR 49187);
+#endif
+
 if (build_check_cxx_o_srcdir(*this, unused_test.cpp))
 ATF_FAIL(Build of unused_test.cpp passed; unused test cases are 
  not properly detected);



CVS commit: src/external/bsd/atf/dist

2015-01-22 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Thu Jan 22 12:33:36 UTC 2015

Modified Files:
src/external/bsd/atf/dist/atf-c: macros_test.c
src/external/bsd/atf/dist/atf-c++: macros_test.cpp

Log Message:
Mark atf/atf-c/macros_test/detect_unused_tests and
atf/atf-c++/macros_test/detect_unused_tests as expected failures
when using versions of GCC where they are known to fail, with a
reference to PR toolchain/49187.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/atf-c/macros_test.c
cvs rdiff -u -r1.1.1.8 -r1.2 \
src/external/bsd/atf/dist/atf-c++/macros_test.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist

2014-02-11 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Tue Feb 11 16:10:41 UTC 2014

Removed Files:
src/external/bsd/atf/dist: Atffile
src/external/bsd/atf/dist/atf-c: Atffile
src/external/bsd/atf/dist/atf-c++: Atffile
src/external/bsd/atf/dist/atf-c++/detail: Atffile
src/external/bsd/atf/dist/atf-c/detail: Atffile
src/external/bsd/atf/dist/atf-sh: Atffile
src/external/bsd/atf/dist/test-programs: Atffile
src/external/bsd/atf/dist/tools: Atffile

Log Message:
Merge atf-0.20.

The upstream Atffiles are gone so we will just rely on our automatic
generation of such files from bsd.test.mk.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r0 src/external/bsd/atf/dist/Atffile
cvs rdiff -u -r1.2 -r0 src/external/bsd/atf/dist/atf-c/Atffile
cvs rdiff -u -r1.1.1.2 -r0 src/external/bsd/atf/dist/atf-c++/Atffile
cvs rdiff -u -r1.1.1.3 -r0 src/external/bsd/atf/dist/atf-c++/detail/Atffile
cvs rdiff -u -r1.1.1.2 -r0 src/external/bsd/atf/dist/atf-c/detail/Atffile
cvs rdiff -u -r1.1.1.2 -r0 src/external/bsd/atf/dist/atf-sh/Atffile
cvs rdiff -u -r1.1.1.2 -r0 src/external/bsd/atf/dist/test-programs/Atffile
cvs rdiff -u -r1.1.1.1 -r0 src/external/bsd/atf/dist/tools/Atffile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist/tools

2014-02-11 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Tue Feb 11 18:13:45 UTC 2014

Modified Files:
src/external/bsd/atf/dist/tools: atf-run.cpp fs.cpp process.cpp
requirements.cpp requirements_test.cpp

Log Message:
Remove portability-related guards from the atf tools.

Just assume we are building for NetBSD given that the tools code is now
owned by the NetBSD tree.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/tools/atf-run.cpp
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/tools/fs.cpp \
src/external/bsd/atf/dist/tools/process.cpp \
src/external/bsd/atf/dist/tools/requirements.cpp
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/atf/dist/tools/requirements_test.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/tools/atf-run.cpp
diff -u src/external/bsd/atf/dist/tools/atf-run.cpp:1.4 src/external/bsd/atf/dist/tools/atf-run.cpp:1.5
--- src/external/bsd/atf/dist/tools/atf-run.cpp:1.4	Tue Feb 11 17:28:20 2014
+++ src/external/bsd/atf/dist/tools/atf-run.cpp	Tue Feb 11 18:13:45 2014
@@ -64,12 +64,6 @@ typedef std::map std::string, std::stri
 
 } // anonymous namespace
 
-#if defined(MAXCOMLEN)
-static const std::string::size_type max_core_name_length = MAXCOMLEN;
-#else
-static const std::string::size_type max_core_name_length = std::string::npos;
-#endif
-
 class atf_run : public tools::application::app {
 static const char* m_description;
 
@@ -127,7 +121,7 @@ dump_stacktrace(const tools::fs::path t
 w.stderr_tc(Test program crashed; attempting to get stack trace);
 
 const tools::fs::path corename = workdir /
-(tp.leaf_name().substr(0, max_core_name_length) + .core);
+(tp.leaf_name().substr(0, MAXCOMLEN) + .core);
 if (!tools::fs::exists(corename)) {
 w.stderr_tc(Expected file  + corename.str() +  not found);
 return;

Index: src/external/bsd/atf/dist/tools/fs.cpp
diff -u src/external/bsd/atf/dist/tools/fs.cpp:1.2 src/external/bsd/atf/dist/tools/fs.cpp:1.3
--- src/external/bsd/atf/dist/tools/fs.cpp:1.2	Tue Feb 11 17:28:20 2014
+++ src/external/bsd/atf/dist/tools/fs.cpp	Tue Feb 11 18:13:45 2014
@@ -434,9 +434,7 @@ impl::file_info::file_info(const path p
 case S_IFLNK:  m_type = lnk_type;  break;
 case S_IFREG:  m_type = reg_type;  break;
 case S_IFSOCK: m_type = sock_type; break;
-#if defined(S_IFWHT)
 case S_IFWHT:  m_type = wht_type;  break;
-#endif
 default:
 throw system_error(IMPL_NAME ::file_info, Unknown file type 
error, EINVAL);
Index: src/external/bsd/atf/dist/tools/process.cpp
diff -u src/external/bsd/atf/dist/tools/process.cpp:1.2 src/external/bsd/atf/dist/tools/process.cpp:1.3
--- src/external/bsd/atf/dist/tools/process.cpp:1.2	Tue Feb 11 16:31:38 2014
+++ src/external/bsd/atf/dist/tools/process.cpp	Tue Feb 11 18:13:45 2014
@@ -399,12 +399,8 @@ impl::status::coredump(void)
 const
 {
 assert(signaled());
-#if defined(WCOREDUMP)
 int mutable_status = m_status;
 return WCOREDUMP(mutable_status);
-#else
-return false;
-#endif
 }
 
 // 
Index: src/external/bsd/atf/dist/tools/requirements.cpp
diff -u src/external/bsd/atf/dist/tools/requirements.cpp:1.2 src/external/bsd/atf/dist/tools/requirements.cpp:1.3
--- src/external/bsd/atf/dist/tools/requirements.cpp:1.2	Tue Feb 11 16:31:38 2014
+++ src/external/bsd/atf/dist/tools/requirements.cpp	Tue Feb 11 18:13:45 2014
@@ -145,14 +145,15 @@ check_machine(const std::string machine
 return Requires one of the ' + machines + ' machine types;
 }
 
-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
 static
 std::string
-check_memory_sysctl(const int64_t needed, const char* sysctl_variable)
+check_memory(const std::string raw_memory)
 {
+const int64_t needed = tools::text::to_bytes(raw_memory);
+
 int64_t available;
 std::size_t available_length = sizeof(available);
-if (::sysctlbyname(sysctl_variable, available, available_length,
+if (::sysctlbyname(hw.usermem64, available, available_length,
NULL, 0) == -1) {
 const char* e = std::strerror(errno);
 return Failed to get sysctl(hw.usermem64) value:  + std::string(e);
@@ -164,55 +165,6 @@ check_memory_sysctl(const int64_t needed
 } else
 return ;
 }
-#   if defined(__APPLE__)
-static
-std::string
-check_memory_darwin(const int64_t needed)
-{
-return check_memory_sysctl(needed, hw.usermem);
-}
-#   elif defined(__FreeBSD__)
-static
-std::string
-check_memory_freebsd(const int64_t needed)
-{
-return check_memory_sysctl(needed, hw.usermem);
-}
-#   elif defined(__NetBSD__)
-static
-std::string
-check_memory_netbsd(const int64_t needed)
-{
-return check_memory_sysctl(needed, hw.usermem64);
-}
-#   else
-#  error 

CVS commit: src/external/bsd/atf/dist

2014-02-11 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Tue Feb 11 16:10:41 UTC 2014

Removed Files:
src/external/bsd/atf/dist: Atffile
src/external/bsd/atf/dist/atf-c: Atffile
src/external/bsd/atf/dist/atf-c++: Atffile
src/external/bsd/atf/dist/atf-c++/detail: Atffile
src/external/bsd/atf/dist/atf-c/detail: Atffile
src/external/bsd/atf/dist/atf-sh: Atffile
src/external/bsd/atf/dist/test-programs: Atffile
src/external/bsd/atf/dist/tools: Atffile

Log Message:
Merge atf-0.20.

The upstream Atffiles are gone so we will just rely on our automatic
generation of such files from bsd.test.mk.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r0 src/external/bsd/atf/dist/Atffile
cvs rdiff -u -r1.2 -r0 src/external/bsd/atf/dist/atf-c/Atffile
cvs rdiff -u -r1.1.1.2 -r0 src/external/bsd/atf/dist/atf-c++/Atffile
cvs rdiff -u -r1.1.1.3 -r0 src/external/bsd/atf/dist/atf-c++/detail/Atffile
cvs rdiff -u -r1.1.1.2 -r0 src/external/bsd/atf/dist/atf-c/detail/Atffile
cvs rdiff -u -r1.1.1.2 -r0 src/external/bsd/atf/dist/atf-sh/Atffile
cvs rdiff -u -r1.1.1.2 -r0 src/external/bsd/atf/dist/test-programs/Atffile
cvs rdiff -u -r1.1.1.1 -r0 src/external/bsd/atf/dist/tools/Atffile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist/tools

2014-02-11 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Tue Feb 11 18:13:45 UTC 2014

Modified Files:
src/external/bsd/atf/dist/tools: atf-run.cpp fs.cpp process.cpp
requirements.cpp requirements_test.cpp

Log Message:
Remove portability-related guards from the atf tools.

Just assume we are building for NetBSD given that the tools code is now
owned by the NetBSD tree.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/tools/atf-run.cpp
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/tools/fs.cpp \
src/external/bsd/atf/dist/tools/process.cpp \
src/external/bsd/atf/dist/tools/requirements.cpp
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/atf/dist/tools/requirements_test.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist

2014-02-08 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Sat Feb  8 19:13:44 UTC 2014

Modified Files:
src/external/bsd/atf/dist/atf-c: atf-c-api.3 macros_test.c
pkg_config_test.sh
src/external/bsd/atf/dist/atf-c++: pkg_config_test.sh tests.cpp
tests.hpp
src/external/bsd/atf/dist/atf-c/detail: test_helpers.c
src/external/bsd/atf/dist/atf-sh: atf-check.cpp
src/external/bsd/atf/dist/doc: atf-test-case.4
Added Files:
src/external/bsd/atf/dist/tools: atf-config.1 atf-config.cpp
atf-report.1 atf-report.cpp atf-run.1 atf-run.cpp atf-version.1
atf-version.cpp
Removed Files:
src/external/bsd/atf/dist/atf-c++: noncopyable.hpp
src/external/bsd/atf/dist/atf-c++/detail: expand.cpp expand.hpp
expand_test.cpp parser.cpp parser.hpp parser_test.cpp ui.cpp ui.hpp
ui_test.cpp
src/external/bsd/atf/dist/atf-config: Atffile Kyuafile atf-config.1
atf-config.cpp integration_test.sh
src/external/bsd/atf/dist/atf-report: Atffile Kyuafile atf-report.1
atf-report.cpp fail_helper.cpp integration_test.sh misc_helpers.cpp
pass_helper.cpp reader.cpp reader.hpp reader_test.cpp
tests-results.css tests-results.dtd tests-results.xsl
src/external/bsd/atf/dist/atf-run: Atffile Kyuafile atf-run.1
atf-run.cpp atffile.cpp atffile.hpp atffile_test.cpp
bad_metadata_helper.c config.cpp config.hpp config_test.cpp
expect_helpers.c fs.cpp fs.hpp fs_test.cpp integration_test.sh
io.cpp io.hpp io_test.cpp misc_helpers.cpp pass_helper.cpp
requirements.cpp requirements.hpp requirements_test.cpp
several_tcs_helper.c signals.cpp signals.hpp signals_test.cpp
test-program.cpp test-program.hpp test_program_test.cpp timer.cpp
timer.hpp user.cpp user.hpp user_test.cpp zero_tcs_helper.c
src/external/bsd/atf/dist/atf-run/sample: atf-run.hooks common.conf
src/external/bsd/atf/dist/atf-run/share: atf-run.hooks
src/external/bsd/atf/dist/atf-version: atf-version.1 atf-version.cpp
generate-revision.sh
src/external/bsd/atf/dist/doc: atf-formats.5 atf.7.in

Log Message:
Merge atf-0.19.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/dist/atf-c/atf-c-api.3 \
src/external/bsd/atf/dist/atf-c/macros_test.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/atf-c/pkg_config_test.sh
cvs rdiff -u -r1.1.1.1 -r0 src/external/bsd/atf/dist/atf-c++/noncopyable.hpp
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/atf-c++/pkg_config_test.sh
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/atf/dist/atf-c++/tests.cpp
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/atf/dist/atf-c++/tests.hpp
cvs rdiff -u -r1.1.1.2 -r0 \
src/external/bsd/atf/dist/atf-c++/detail/expand.cpp \
src/external/bsd/atf/dist/atf-c++/detail/expand.hpp \
src/external/bsd/atf/dist/atf-c++/detail/expand_test.cpp \
src/external/bsd/atf/dist/atf-c++/detail/parser.cpp \
src/external/bsd/atf/dist/atf-c++/detail/parser_test.cpp \
src/external/bsd/atf/dist/atf-c++/detail/ui.hpp
cvs rdiff -u -r1.2 -r0 src/external/bsd/atf/dist/atf-c++/detail/parser.hpp
cvs rdiff -u -r1.1.1.3 -r0 src/external/bsd/atf/dist/atf-c++/detail/ui.cpp
cvs rdiff -u -r1.1.1.1 -r0 \
src/external/bsd/atf/dist/atf-c++/detail/ui_test.cpp
cvs rdiff -u -r1.6 -r1.7 \
src/external/bsd/atf/dist/atf-c/detail/test_helpers.c
cvs rdiff -u -r1.1.1.1 -r0 src/external/bsd/atf/dist/atf-config/Atffile \
src/external/bsd/atf/dist/atf-config/Kyuafile
cvs rdiff -u -r1.1.1.4 -r0 src/external/bsd/atf/dist/atf-config/atf-config.1
cvs rdiff -u -r1.1.1.3 -r0 \
src/external/bsd/atf/dist/atf-config/atf-config.cpp
cvs rdiff -u -r1.3 -r0 \
src/external/bsd/atf/dist/atf-config/integration_test.sh
cvs rdiff -u -r1.1.1.1 -r0 src/external/bsd/atf/dist/atf-report/Atffile \
src/external/bsd/atf/dist/atf-report/Kyuafile
cvs rdiff -u -r1.1.1.2 -r0 src/external/bsd/atf/dist/atf-report/atf-report.1 \
src/external/bsd/atf/dist/atf-report/pass_helper.cpp \
src/external/bsd/atf/dist/atf-report/reader.hpp
cvs rdiff -u -r1.7 -r0 src/external/bsd/atf/dist/atf-report/atf-report.cpp \
src/external/bsd/atf/dist/atf-report/tests-results.xsl
cvs rdiff -u -r1.1.1.3 -r0 \
src/external/bsd/atf/dist/atf-report/fail_helper.cpp \
src/external/bsd/atf/dist/atf-report/misc_helpers.cpp \
src/external/bsd/atf/dist/atf-report/reader.cpp \
src/external/bsd/atf/dist/atf-report/reader_test.cpp \
src/external/bsd/atf/dist/atf-report/tests-results.dtd
cvs rdiff -u -r1.1.1.4 -r0 \
src/external/bsd/atf/dist/atf-report/integration_test.sh
cvs rdiff -u -r1.5 -r0 src/external/bsd/atf/dist/atf-report/tests-results.css
cvs rdiff -u -r1.1.1.1 -r0 src/external/bsd/atf/dist/atf-run/Atffile \
src/external/bsd/atf/dist/atf-run/Kyuafile \

Re: CVS commit: src/external/bsd/atf/dist/atf-sh

2014-01-10 Thread Christos Zoulas
In article CADyfeQVHtEkhfydkA_XwgPhvqKirnUMRYjRV29c=6goznir...@mail.gmail.com,
Julio Merino  ju...@meroh.net wrote:
On Fri, Jan 10, 2014 at 1:39 AM, Christos Zoulas chris...@netbsd.org wrote:
 Module Name:src
 Committed By:   christos
 Date:   Fri Jan 10 01:39:32 UTC 2014

 Modified Files:
 src/external/bsd/atf/dist/atf-sh: libatf-sh.subr

 Log Message:
 Undo previous; unfortunately the cleanup routine gets called in a different
 shell so it can't cleanup stuff set in the environment of the first shell.

What are you trying to fix?

In the test case for t_hostent in lib/libc/net/, the tests initially
contained the cleanup code after the test. If the test failed, then
the cleanup did not get called. So I decided to use the _cleanup()
feature of ATF. I ran the test with atf-run and the cleanup did
not work. I wanted to examine the single test case that failed and
I did not know how to run a single test case with atf-run.  So I
ran the test directly. The cleanup code did not get called which
was unexpected. So I made that change and it worked for the most
part but not in the error case. Then I realized that all the tests
do set -e, so that makes the shell exit on error. That made me
realize that the reason the cleanup does not work when it gets
called from atf-run is because the cleanup is invoked in a separate
shell, so the state of the test is lost (like shell variables set
by the setup code). So I decided to set all the variables again
during the cleanup.

I would have preferred that the cleanup functionality was implemented
differently, running in the context of the shell that ran the test.
This could have been done by issuing a 'trap test_cleanup 0' before
invoking the test, instead of all the complex stuff that is currently
been done (unless I am missing something).

I don't see how this prevents running tests in parallel. You just need
to maintain one work directory for every test body/cleanup pair and
delete the directory only after cleanup... and you cannot share work
directories among tests anyway so you have to do that one way or
another.

If I need to pass state between the body of the test function and
the cleanup function, where do I put that state?

christos



CVS commit: src/external/bsd/atf/dist/atf-sh

2014-01-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 10 01:16:07 UTC 2014

Modified Files:
src/external/bsd/atf/dist/atf-sh: libatf-sh.subr

Log Message:
Make cleanup work as documented; note there are no tests testing that cleanup
works.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.5 -r1.2 src/external/bsd/atf/dist/atf-sh/libatf-sh.subr

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-sh/libatf-sh.subr
diff -u src/external/bsd/atf/dist/atf-sh/libatf-sh.subr:1.1.1.5 src/external/bsd/atf/dist/atf-sh/libatf-sh.subr:1.2
--- src/external/bsd/atf/dist/atf-sh/libatf-sh.subr:1.1.1.5	Mon Jan 16 17:36:53 2012
+++ src/external/bsd/atf/dist/atf-sh/libatf-sh.subr	Thu Jan  9 20:16:07 2014
@@ -772,6 +772,7 @@ main()
 _atf_syntax_error Cannot provide more than one test case name
 else
 _atf_run_tc ${1}
+_atf_run_tc ${1}:cleanup
 fi
 fi
 }



CVS commit: src/external/bsd/atf/dist/atf-sh

2014-01-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 10 01:16:07 UTC 2014

Modified Files:
src/external/bsd/atf/dist/atf-sh: libatf-sh.subr

Log Message:
Make cleanup work as documented; note there are no tests testing that cleanup
works.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.5 -r1.2 src/external/bsd/atf/dist/atf-sh/libatf-sh.subr

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist/atf-sh

2014-01-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 10 01:39:32 UTC 2014

Modified Files:
src/external/bsd/atf/dist/atf-sh: libatf-sh.subr

Log Message:
Undo previous; unfortunately the cleanup routine gets called in a different
shell so it can't cleanup stuff set in the environment of the first shell.
There are 2 problems:
- calling the test routine directly does not cleanup (not using
  atf-run)
- when using atf-run, the cleanup routine needs state from the
  running code which can only be stored in files. This will never
  allow us to run tests in parallel since we need to keep a known
  place to pass state.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/atf-sh/libatf-sh.subr

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist

2014-01-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jan  7 02:06:42 UTC 2014

Modified Files:
src/external/bsd/atf/dist/atf-c: error.h tc.c tc.h
src/external/bsd/atf/dist/atf-c++: tests.cpp
src/external/bsd/atf/dist/atf-c/detail: dynstr.c dynstr.h fs.c fs.h
sanity.c test_helpers.c text.h tp_main.c

Log Message:
Format string annotations and fixes for resulting fallout.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.2 src/external/bsd/atf/dist/atf-c/error.h
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/atf/dist/atf-c/tc.c
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/atf-c/tc.h
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/atf/dist/atf-c++/tests.cpp
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/atf/dist/atf-c/detail/dynstr.c \
src/external/bsd/atf/dist/atf-c/detail/dynstr.h \
src/external/bsd/atf/dist/atf-c/detail/fs.c \
src/external/bsd/atf/dist/atf-c/detail/fs.h \
src/external/bsd/atf/dist/atf-c/detail/text.h
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/atf/dist/atf-c/detail/sanity.c
cvs rdiff -u -r1.5 -r1.6 \
src/external/bsd/atf/dist/atf-c/detail/test_helpers.c
cvs rdiff -u -r1.1.1.4 -r1.2 src/external/bsd/atf/dist/atf-c/detail/tp_main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-c/error.h
diff -u src/external/bsd/atf/dist/atf-c/error.h:1.1.1.4 src/external/bsd/atf/dist/atf-c/error.h:1.2
--- src/external/bsd/atf/dist/atf-c/error.h:1.1.1.4	Mon Jan 16 22:36:30 2012
+++ src/external/bsd/atf/dist/atf-c/error.h	Tue Jan  7 02:06:42 2014
@@ -33,6 +33,7 @@
 #include stdbool.h
 #include stddef.h
 
+#include atf-c/defs.h
 #include atf-c/error_fwd.h
 
 /* -
@@ -62,7 +63,8 @@ void atf_error_format(const atf_error_t,
  * Common error types.
  * - */
 
-atf_error_t atf_libc_error(int, const char *, ...);
+atf_error_t atf_libc_error(int, const char *, ...)
+ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(2, 3);
 int atf_libc_error_code(const atf_error_t);
 const char *atf_libc_error_msg(const atf_error_t);
 

Index: src/external/bsd/atf/dist/atf-c/tc.c
diff -u src/external/bsd/atf/dist/atf-c/tc.c:1.12 src/external/bsd/atf/dist/atf-c/tc.c:1.13
--- src/external/bsd/atf/dist/atf-c/tc.c:1.12	Mon Jan 16 22:41:30 2012
+++ src/external/bsd/atf/dist/atf-c/tc.c	Tue Jan  7 02:06:42 2014
@@ -79,12 +79,14 @@ struct context {
 static void context_init(struct context *, const atf_tc_t *, const char *);
 static void check_fatal_error(atf_error_t);
 static void report_fatal_error(const char *, ...)
+ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(1, 2)
 ATF_DEFS_ATTRIBUTE_NORETURN;
 static atf_error_t write_resfile(const int, const char *, const int,
  const atf_dynstr_t *);
 static void create_resfile(const char *, const char *, const int,
atf_dynstr_t *);
 static void error_in_expect(struct context *, const char *, ...)
+ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(2, 3)
 ATF_DEFS_ATTRIBUTE_NORETURN;
 static void validate_expect(struct context *);
 static void expected_failure(struct context *, atf_dynstr_t *)
@@ -97,9 +99,11 @@ static void pass(struct context *)
 static void skip(struct context *, atf_dynstr_t *)
 ATF_DEFS_ATTRIBUTE_NORETURN;
 static void format_reason_ap(atf_dynstr_t *, const char *, const size_t,
- const char *, va_list);
+ const char *, va_list)
+ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(4, 0);
 static void format_reason_fmt(atf_dynstr_t *, const char *, const size_t,
-  const char *, ...);
+  const char *, ...)
+ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(4, 5);
 static void errno_test(struct context *, const char *, const size_t,
const int, const char *, const bool,
void (*)(struct context *, atf_dynstr_t *));
@@ -571,7 +575,7 @@ atf_tc_init(atf_tc_t *tc, const char *id
 if (atf_is_error(err))
 goto err_vars;
 
-err = atf_tc_set_md_var(tc, ident, ident);
+err = atf_tc_set_md_var(tc, ident, %s, ident);
 if (atf_is_error(err))
 goto err_map;
 
@@ -787,28 +791,35 @@ atf_tc_set_md_var(atf_tc_t *tc, const ch
  * - */
 
 static void _atf_tc_fail(struct context *, const char *, va_list)
+ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(2, 0)
 ATF_DEFS_ATTRIBUTE_NORETURN;
-static void _atf_tc_fail_nonfatal(struct context *, const char *, va_list);
+static void _atf_tc_fail_nonfatal(struct context *, const char *, va_list)
+ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(2, 0);
 static void _atf_tc_fail_check(struct context *, const char *, const size_t,
-const char *, va_list);
+const char *, va_list)
+   

CVS commit: src/external/bsd/atf/dist

2014-01-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jan  7 02:06:42 UTC 2014

Modified Files:
src/external/bsd/atf/dist/atf-c: error.h tc.c tc.h
src/external/bsd/atf/dist/atf-c++: tests.cpp
src/external/bsd/atf/dist/atf-c/detail: dynstr.c dynstr.h fs.c fs.h
sanity.c test_helpers.c text.h tp_main.c

Log Message:
Format string annotations and fixes for resulting fallout.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.2 src/external/bsd/atf/dist/atf-c/error.h
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/atf/dist/atf-c/tc.c
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/atf-c/tc.h
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/atf/dist/atf-c++/tests.cpp
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/atf/dist/atf-c/detail/dynstr.c \
src/external/bsd/atf/dist/atf-c/detail/dynstr.h \
src/external/bsd/atf/dist/atf-c/detail/fs.c \
src/external/bsd/atf/dist/atf-c/detail/fs.h \
src/external/bsd/atf/dist/atf-c/detail/text.h
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/atf/dist/atf-c/detail/sanity.c
cvs rdiff -u -r1.5 -r1.6 \
src/external/bsd/atf/dist/atf-c/detail/test_helpers.c
cvs rdiff -u -r1.1.1.4 -r1.2 src/external/bsd/atf/dist/atf-c/detail/tp_main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist/atf-c++/detail

2013-04-29 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Apr 30 00:31:56 UTC 2013

Modified Files:
src/external/bsd/atf/dist/atf-c++/detail: parser.hpp

Log Message:
It is unclear whether cin is guaranteed to buffer the last input
character of a get() for ungetch() to work. Prefer putback() to make it
work with current implementations of cin in libc++. Tracked as
http://llvm.org/bugs/show_bug.cgi?id=15867 with test case.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/external/bsd/atf/dist/atf-c++/detail/parser.hpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-c++/detail/parser.hpp
diff -u src/external/bsd/atf/dist/atf-c++/detail/parser.hpp:1.1.1.2 src/external/bsd/atf/dist/atf-c++/detail/parser.hpp:1.2
--- src/external/bsd/atf/dist/atf-c++/detail/parser.hpp:1.1.1.2	Mon Jan 16 22:36:46 2012
+++ src/external/bsd/atf/dist/atf-c++/detail/parser.hpp	Tue Apr 30 00:31:56 2013
@@ -259,7 +259,7 @@ tokenizer IS ::next(void)
 t = token(m_lineno, m_text_type, text);
 quoted = true;
 } else {
-m_is.unget();
+m_is.putback(ch);
 done = true;
 }
 } else {
@@ -271,13 +271,13 @@ tokenizer IS ::next(void)
 t = token(m_lineno, (*idelim).second,
std::string() + ch);
 else
-m_is.unget();
+m_is.putback(ch);
 } else if (ch == '\n') {
 done = true;
 if (text.empty())
 t = token(m_lineno, m_nl_type, NEWLINE);
 else
-m_is.unget();
+m_is.putback(ch);
 } else if (m_skipws  (ch == ' ' || ch == '\t')) {
 if (!text.empty())
 done = true;



CVS commit: src/external/bsd/atf/dist/atf-c++/detail

2013-04-29 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Apr 30 00:31:56 UTC 2013

Modified Files:
src/external/bsd/atf/dist/atf-c++/detail: parser.hpp

Log Message:
It is unclear whether cin is guaranteed to buffer the last input
character of a get() for ungetch() to work. Prefer putback() to make it
work with current implementations of cin in libc++. Tracked as
http://llvm.org/bugs/show_bug.cgi?id=15867 with test case.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/external/bsd/atf/dist/atf-c++/detail/parser.hpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist

2013-03-15 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Sat Mar 16 04:21:19 UTC 2013

Modified Files:
src/external/bsd/atf/dist/atf-c: pkg_config_test.sh
src/external/bsd/atf/dist/atf-c++: pkg_config_test.sh

Log Message:
Mark the atf/atf-{c,c++}/pkg_config_test:version tests as needing atf-version.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 \
src/external/bsd/atf/dist/atf-c/pkg_config_test.sh
cvs rdiff -u -r1.1.1.4 -r1.2 \
src/external/bsd/atf/dist/atf-c++/pkg_config_test.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-c/pkg_config_test.sh
diff -u src/external/bsd/atf/dist/atf-c/pkg_config_test.sh:1.1.1.3 src/external/bsd/atf/dist/atf-c/pkg_config_test.sh:1.2
--- src/external/bsd/atf/dist/atf-c/pkg_config_test.sh:1.1.1.3	Mon Jan 16 22:36:32 2012
+++ src/external/bsd/atf/dist/atf-c/pkg_config_test.sh	Sat Mar 16 04:21:19 2013
@@ -59,7 +59,7 @@ atf_test_case version
 version_head()
 {
 atf_set descr Checks that the version in atf-c is correct
-atf_set require.progs pkg-config
+atf_set require.progs atf-version pkg-config
 }
 version_body()
 {

Index: src/external/bsd/atf/dist/atf-c++/pkg_config_test.sh
diff -u src/external/bsd/atf/dist/atf-c++/pkg_config_test.sh:1.1.1.4 src/external/bsd/atf/dist/atf-c++/pkg_config_test.sh:1.2
--- src/external/bsd/atf/dist/atf-c++/pkg_config_test.sh:1.1.1.4	Mon Jan 16 22:36:45 2012
+++ src/external/bsd/atf/dist/atf-c++/pkg_config_test.sh	Sat Mar 16 04:21:19 2013
@@ -59,7 +59,7 @@ atf_test_case version
 version_head()
 {
 atf_set descr Checks that the version in atf-c++ is correct
-atf_set require.progs pkg-config
+atf_set require.progs atf-version pkg-config
 }
 version_body()
 {



CVS commit: src/external/bsd/atf/dist

2013-03-15 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Sat Mar 16 04:21:19 UTC 2013

Modified Files:
src/external/bsd/atf/dist/atf-c: pkg_config_test.sh
src/external/bsd/atf/dist/atf-c++: pkg_config_test.sh

Log Message:
Mark the atf/atf-{c,c++}/pkg_config_test:version tests as needing atf-version.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 \
src/external/bsd/atf/dist/atf-c/pkg_config_test.sh
cvs rdiff -u -r1.1.1.4 -r1.2 \
src/external/bsd/atf/dist/atf-c++/pkg_config_test.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist

2013-02-15 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Fri Feb 15 17:04:22 UTC 2013

Update of /cvsroot/src/external/bsd/atf/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv9795

Log Message:
Import atf 0.17:

Experimental version released on February 14th, 2013.

* Added the atf_utils_cat_file, atf_utils_compare_file,
  atf_utils_copy_file, atf_utils_create_file, atf_utils_file_exists,
  atf_utils_fork, atf_utils_grep_file, atf_utils_grep_string,
  atf_utils_readline, atf_utils_redirect and atf_utils_wait utility
  functions to atf-c-api.  Documented the already-public
  atf_utils_free_charpp function.

* Added the cat_file, compare_file, copy_file, create_file, file_exists,
  fork, grep_collection, grep_file, grep_string, redirect and wait
  functions to the atf::utils namespace of atf-c++-api.  These are
  wrappers around the same functions added to the atf-c-api library.

* Added the ATF_CHECK_MATCH, ATF_CHECK_MATCH_MSG, ATF_REQUIRE_MATCH and
  ATF_REQUIRE_MATCH_MSG macros to atf-c to simplify the validation of a
  string against a regular expression.

* Miscellaneous fixes for manpage typos and compilation problems with
  clang.

* Added caching of the results of those configure tests that rely on
  executing a test program.  This should help crossbuild systems by
  providing a mechanism to pre-specify what the results should be.

* PR bin/45690: Make atf-report convert any non-printable characters to
  a plain-text representation (matching their corresponding hexadecimal
  entities) in XML output files.  This is to prevent the output of test
  cases from breaking xsltproc later.

Status:

Vendor Tag: TNF
Release Tags:   atf-0-17

U src/external/bsd/atf/dist/README
U src/external/bsd/atf/dist/Kyuafile
U src/external/bsd/atf/dist/atf-c.h
U src/external/bsd/atf/dist/atf-c++.hpp
U src/external/bsd/atf/dist/AUTHORS
U src/external/bsd/atf/dist/COPYING
U src/external/bsd/atf/dist/NEWS
U src/external/bsd/atf/dist/Atffile
U src/external/bsd/atf/dist/atf-c/error_fwd.h
U src/external/bsd/atf/dist/atf-c/build.h
U src/external/bsd/atf/dist/atf-c/check.h
U src/external/bsd/atf/dist/atf-c/config.h
U src/external/bsd/atf/dist/atf-c/error.h
C src/external/bsd/atf/dist/atf-c/atf-c-api.3
U src/external/bsd/atf/dist/atf-c/macros.h
U src/external/bsd/atf/dist/atf-c/tc.h
U src/external/bsd/atf/dist/atf-c/tp.h
U src/external/bsd/atf/dist/atf-c/utils.h
U src/external/bsd/atf/dist/atf-c/pkg_config_test.sh
U src/external/bsd/atf/dist/atf-c/defs.h.in
U src/external/bsd/atf/dist/atf-c/build.c
U src/external/bsd/atf/dist/atf-c/check.c
U src/external/bsd/atf/dist/atf-c/config.c
U src/external/bsd/atf/dist/atf-c/error.c
U src/external/bsd/atf/dist/atf-c/tc.c
U src/external/bsd/atf/dist/atf-c/tp.c
U src/external/bsd/atf/dist/atf-c/utils.c
U src/external/bsd/atf/dist/atf-c/h_build.h
U src/external/bsd/atf/dist/atf-c/atf_c_test.c
U src/external/bsd/atf/dist/atf-c/build_test.c
U src/external/bsd/atf/dist/atf-c/check_test.c
U src/external/bsd/atf/dist/atf-c/config_test.c
U src/external/bsd/atf/dist/atf-c/tc_test.c
U src/external/bsd/atf/dist/atf-c/error_test.c
C src/external/bsd/atf/dist/atf-c/macros_test.c
U src/external/bsd/atf/dist/atf-c/tp_test.c
U src/external/bsd/atf/dist/atf-c/utils_test.c
U src/external/bsd/atf/dist/atf-c/atf-c.pc.in
U src/external/bsd/atf/dist/atf-c/Atffile
U src/external/bsd/atf/dist/atf-c/Kyuafile
U src/external/bsd/atf/dist/atf-c/macros_h_test.c
U src/external/bsd/atf/dist/atf-c/unused_test.c
U src/external/bsd/atf/dist/atf-c/detail/process_helpers.c
C src/external/bsd/atf/dist/atf-c/detail/test_helpers.c
U src/external/bsd/atf/dist/atf-c/detail/test_helpers.h
U src/external/bsd/atf/dist/atf-c/detail/dynstr.c
U src/external/bsd/atf/dist/atf-c/detail/dynstr.h
U src/external/bsd/atf/dist/atf-c/detail/env.c
U src/external/bsd/atf/dist/atf-c/detail/env.h
U src/external/bsd/atf/dist/atf-c/detail/fs.c
U src/external/bsd/atf/dist/atf-c/detail/fs.h
U src/external/bsd/atf/dist/atf-c/detail/list.c
U src/external/bsd/atf/dist/atf-c/detail/list.h
U src/external/bsd/atf/dist/atf-c/detail/map.c
U src/external/bsd/atf/dist/atf-c/detail/map.h
U src/external/bsd/atf/dist/atf-c/detail/process.c
U src/external/bsd/atf/dist/atf-c/detail/process.h
U src/external/bsd/atf/dist/atf-c/detail/sanity.c
U src/external/bsd/atf/dist/atf-c/detail/sanity.h
U src/external/bsd/atf/dist/atf-c/detail/text.c
U src/external/bsd/atf/dist/atf-c/detail/text.h
U src/external/bsd/atf/dist/atf-c/detail/tp_main.c
U src/external/bsd/atf/dist/atf-c/detail/user.c
U src/external/bsd/atf/dist/atf-c/detail/user.h
U src/external/bsd/atf/dist/atf-c/detail/dynstr_test.c
U src/external/bsd/atf/dist/atf-c/detail/env_test.c
U src/external/bsd/atf/dist/atf-c/detail/fs_test.c
U src/external/bsd/atf/dist/atf-c/detail/list_test.c
U src/external/bsd/atf/dist/atf-c/detail/map_test.c
C src/external/bsd/atf/dist/atf-c/detail/process_test.c
U src/external/bsd/atf/dist/atf-c/detail/sanity_test.c
U src/external/bsd/atf/dist/atf-c/detail/text_test.c

CVS commit: src/external/bsd/atf/dist

2013-02-15 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Fri Feb 15 17:08:01 UTC 2013

Modified Files:
src/external/bsd/atf/dist/atf-c: atf-c-api.3 macros_test.c
src/external/bsd/atf/dist/atf-c++: tests.cpp tests.hpp
src/external/bsd/atf/dist/atf-c++/detail: process.hpp
src/external/bsd/atf/dist/atf-c/detail: process_test.c test_helpers.c
src/external/bsd/atf/dist/atf-report: atf-report.cpp
src/external/bsd/atf/dist/atf-run: fs.cpp timer.hpp
src/external/bsd/atf/dist/atf-sh: atf-check.cpp atf-check_test.sh
src/external/bsd/atf/dist/doc: atf-test-case.4
Removed Files:
src/external/bsd/atf/dist/atf-c/detail: test_helpers_test.c
src/external/bsd/atf/dist/test-programs: fork_test.sh

Log Message:
Fix merge conflicts after import of atf 0.17.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/atf-c/atf-c-api.3 \
src/external/bsd/atf/dist/atf-c/macros_test.c
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/atf/dist/atf-c++/tests.cpp
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/atf/dist/atf-c++/tests.hpp
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/dist/atf-c++/detail/process.hpp
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/atf/dist/atf-c/detail/process_test.c
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/atf/dist/atf-c/detail/test_helpers.c
cvs rdiff -u -r1.1.1.3 -r0 \
src/external/bsd/atf/dist/atf-c/detail/test_helpers_test.c
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/atf/dist/atf-report/atf-report.cpp
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/atf-run/fs.cpp
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/dist/atf-run/timer.hpp
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/atf/dist/atf-sh/atf-check.cpp
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/atf/dist/atf-sh/atf-check_test.sh
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/atf/dist/doc/atf-test-case.4
cvs rdiff -u -r1.1.1.3 -r0 \
src/external/bsd/atf/dist/test-programs/fork_test.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-c/atf-c-api.3
diff -u src/external/bsd/atf/dist/atf-c/atf-c-api.3:1.2 src/external/bsd/atf/dist/atf-c/atf-c-api.3:1.3
--- src/external/bsd/atf/dist/atf-c/atf-c-api.3:1.2	Wed Sep 26 23:27:34 2012
+++ src/external/bsd/atf/dist/atf-c/atf-c-api.3	Fri Feb 15 17:07:59 2013
@@ -26,14 +26,17 @@
 .\ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd December 26, 2010
+.Dd November 30, 2012
 .Dt ATF-C-API 3
 .Os
 .Sh NAME
+.Nm atf-c-api ,
 .Nm ATF_CHECK ,
 .Nm ATF_CHECK_MSG ,
 .Nm ATF_CHECK_EQ ,
 .Nm ATF_CHECK_EQ_MSG ,
+.Nm ATF_CHECK_MATCH ,
+.Nm ATF_CHECK_MATCH_MSG ,
 .Nm ATF_CHECK_STREQ ,
 .Nm ATF_CHECK_STREQ_MSG ,
 .Nm ATF_CHECK_ERRNO ,
@@ -41,6 +44,8 @@
 .Nm ATF_REQUIRE_MSG ,
 .Nm ATF_REQUIRE_EQ ,
 .Nm ATF_REQUIRE_EQ_MSG ,
+.Nm ATF_REQUIRE_MATCH ,
+.Nm ATF_REQUIRE_MATCH_MSG ,
 .Nm ATF_REQUIRE_STREQ ,
 .Nm ATF_REQUIRE_STREQ_MSG ,
 .Nm ATF_REQUIRE_ERRNO ,
@@ -72,7 +77,19 @@
 .Nm atf_tc_fail ,
 .Nm atf_tc_fail_nonfatal ,
 .Nm atf_tc_pass ,
-.Nm atf_tc_skip
+.Nm atf_tc_skip ,
+.Nm atf_utils_cat_file ,
+.Nm atf_utils_compare_file ,
+.Nm atf_utils_copy_file ,
+.Nm atf_utils_create_file ,
+.Nm atf_utils_file_exists ,
+.Nm atf_utils_fork ,
+.Nm atf_utils_free_charpp ,
+.Nm atf_utils_grep_file ,
+.Nm atf_utils_grep_string ,
+.Nm atf_utils_readline ,
+.Nm atf_utils_redirect ,
+.Nm atf_utils_wait
 .Nd C API to write ATF-based test programs
 .Sh SYNOPSIS
 .In atf-c.h
@@ -80,6 +97,8 @@
 .Fn ATF_CHECK_MSG expression fail_msg_fmt ...
 .Fn ATF_CHECK_EQ expression_1 expression_2
 .Fn ATF_CHECK_EQ_MSG expression_1 expression_2 fail_msg_fmt ...
+.Fn ATF_CHECK_MATCH regexp string
+.Fn ATF_CHECK_MATCH_MSG regexp string fail_msg_fmt ...
 .Fn ATF_CHECK_STREQ string_1 string_2
 .Fn ATF_CHECK_STREQ_MSG string_1 string_2 fail_msg_fmt ...
 .Fn ATF_CHECK_ERRNO exp_errno bool_expression
@@ -87,6 +106,8 @@
 .Fn ATF_REQUIRE_MSG expression fail_msg_fmt ...
 .Fn ATF_REQUIRE_EQ expression_1 expression_2
 .Fn ATF_REQUIRE_EQ_MSG expression_1 expression_2 fail_msg_fmt ...
+.Fn ATF_REQUIRE_MATCH regexp string
+.Fn ATF_REQUIRE_MATCH_MSG regexp string fail_msg_fmt ...
 .Fn ATF_REQUIRE_STREQ string_1 string_2
 .Fn ATF_REQUIRE_STREQ_MSG string_1 string_2 fail_msg_fmt ...
 .Fn ATF_REQUIRE_ERRNO exp_errno bool_expression
@@ -119,6 +140,67 @@
 .Fn atf_tc_fail_nonfatal reason
 .Fn atf_tc_pass
 .Fn atf_tc_skip reason
+.Ft void
+.Fo atf_utils_cat_file
+.Fa const char *file
+.Fa const char *prefix
+.Fc
+.Ft bool
+.Fo atf_utils_compare_file
+.Fa const char *file
+.Fa const char *contents
+.Fc
+.Ft void
+.Fo atf_utils_copy_file
+.Fa const char *source
+.Fa const char *destination
+.Fc
+.Ft void
+.Fo atf_utils_create_file
+.Fa const char *file
+.Fa const char *contents
+.Fa ...
+.Fc
+.Ft void
+.Fo atf_utils_file_exists
+.Fa const char *file
+.Fc
+.Ft pid_t
+.Fo atf_utils_fork
+.Fa 

CVS commit: src/external/bsd/atf/dist

2013-02-15 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Fri Feb 15 17:08:01 UTC 2013

Modified Files:
src/external/bsd/atf/dist/atf-c: atf-c-api.3 macros_test.c
src/external/bsd/atf/dist/atf-c++: tests.cpp tests.hpp
src/external/bsd/atf/dist/atf-c++/detail: process.hpp
src/external/bsd/atf/dist/atf-c/detail: process_test.c test_helpers.c
src/external/bsd/atf/dist/atf-report: atf-report.cpp
src/external/bsd/atf/dist/atf-run: fs.cpp timer.hpp
src/external/bsd/atf/dist/atf-sh: atf-check.cpp atf-check_test.sh
src/external/bsd/atf/dist/doc: atf-test-case.4
Removed Files:
src/external/bsd/atf/dist/atf-c/detail: test_helpers_test.c
src/external/bsd/atf/dist/test-programs: fork_test.sh

Log Message:
Fix merge conflicts after import of atf 0.17.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/atf-c/atf-c-api.3 \
src/external/bsd/atf/dist/atf-c/macros_test.c
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/atf/dist/atf-c++/tests.cpp
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/atf/dist/atf-c++/tests.hpp
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/dist/atf-c++/detail/process.hpp
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/atf/dist/atf-c/detail/process_test.c
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/atf/dist/atf-c/detail/test_helpers.c
cvs rdiff -u -r1.1.1.3 -r0 \
src/external/bsd/atf/dist/atf-c/detail/test_helpers_test.c
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/atf/dist/atf-report/atf-report.cpp
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/atf-run/fs.cpp
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/dist/atf-run/timer.hpp
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/atf/dist/atf-sh/atf-check.cpp
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/atf/dist/atf-sh/atf-check_test.sh
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/atf/dist/doc/atf-test-case.4
cvs rdiff -u -r1.1.1.3 -r0 \
src/external/bsd/atf/dist/test-programs/fork_test.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist/atf-c

2012-09-26 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Sep 26 23:27:34 UTC 2012

Modified Files:
src/external/bsd/atf/dist/atf-c: atf-c-api.3

Log Message:
now sense - no sense


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.7 -r1.2 src/external/bsd/atf/dist/atf-c/atf-c-api.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-c/atf-c-api.3
diff -u src/external/bsd/atf/dist/atf-c/atf-c-api.3:1.1.1.7 src/external/bsd/atf/dist/atf-c/atf-c-api.3:1.2
--- src/external/bsd/atf/dist/atf-c/atf-c-api.3:1.1.1.7	Mon Jan 16 22:36:31 2012
+++ src/external/bsd/atf/dist/atf-c/atf-c-api.3	Wed Sep 26 23:27:34 2012
@@ -382,7 +382,7 @@ variant of the macros immediately abort 
 condition is detected by calling the
 .Fn atf_tc_fail
 function.
-Use this variant whenever it makes now sense to continue the execution of a
+Use this variant whenever it makes no sense to continue the execution of a
 test case when the checked condition is not met.
 The
 .Sq CHECK



CVS commit: src/external/bsd/atf/dist/atf-c

2012-09-26 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Sep 26 23:27:34 UTC 2012

Modified Files:
src/external/bsd/atf/dist/atf-c: atf-c-api.3

Log Message:
now sense - no sense


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.7 -r1.2 src/external/bsd/atf/dist/atf-c/atf-c-api.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist

2012-07-11 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Wed Jul 11 22:37:16 UTC 2012

Update of /cvsroot/src/external/bsd/atf/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv29292

Log Message:
Import atf 0.16:

Experimental version released on July 10th, 2012.

* Added a --enable-tools flag to configure to request the build of the
  deprecated ATF tools, whose build is now disabled by default.  In order
  to continue running tests, you should migrate to Kyua instead of enabling
  the build of the deprecated tools.  The kyua-atf-compat package provides
  transitional compatibility versions of atf-run and atf-report built on
  top of Kyua.

* Tweaked the ATF_TEST_CASE macro of atf-c++ so that the compiler can
  detect defined but unused test cases.

* PR bin/45859: Fixed some XSLT bugs that resulted in the tc-time and
  tp-time XML tags leaking into the generated HTML file.  Also improved
  the CSS file slightly to correct alignment and color issues with the
  timestamps column.

* Optimized atf-c++/macros.hpp so that GNU G++ consumes less memory during
  compilation with GNU G++.

* Flipped the default to building shared libraries for atf-c and atf-c++,
  and started versioning them.  As a side-effect, this removes the
  --enable-unstable-shared flag from configure that appears to not work any
  more (under NetBSD).  Additionally, some distributions require the use of
  shared libraries for proper dependency tracking (e.g. Fedora), so it is
  better if we do the right versioning upstream.

* Project hosting moved from an adhoc solution (custom web site and
  Monotone repository) to Google Code (standard wiki and Git).  ATF now
  lives in a subcomponent of the Kyua project.

Status:

Vendor Tag: TNF
Release Tags:   atf-0-16

U src/external/bsd/atf/dist/atf-c++.hpp
U src/external/bsd/atf/dist/Atffile
U src/external/bsd/atf/dist/README
U src/external/bsd/atf/dist/Kyuafile
U src/external/bsd/atf/dist/atf-c.h
U src/external/bsd/atf/dist/AUTHORS
U src/external/bsd/atf/dist/NEWS
U src/external/bsd/atf/dist/COPYING
U src/external/bsd/atf/dist/test-programs/meta_data_test.sh
U src/external/bsd/atf/dist/test-programs/Atffile
U src/external/bsd/atf/dist/test-programs/Kyuafile
U src/external/bsd/atf/dist/test-programs/c_helpers.c
U src/external/bsd/atf/dist/test-programs/srcdir_test.sh
U src/external/bsd/atf/dist/test-programs/fork_test.sh
U src/external/bsd/atf/dist/test-programs/config_test.sh
U src/external/bsd/atf/dist/test-programs/common.sh
U src/external/bsd/atf/dist/test-programs/cpp_helpers.cpp
U src/external/bsd/atf/dist/test-programs/sh_helpers.sh
U src/external/bsd/atf/dist/test-programs/result_test.sh
U src/external/bsd/atf/dist/test-programs/expect_test.sh
U src/external/bsd/atf/dist/atf-version/generate-revision.sh
C src/external/bsd/atf/dist/atf-version/atf-version.cpp
U src/external/bsd/atf/dist/atf-version/atf-version.1
U src/external/bsd/atf/dist/atf-run/atf-run.1
U src/external/bsd/atf/dist/atf-run/timer.hpp
U src/external/bsd/atf/dist/atf-run/io.hpp
U src/external/bsd/atf/dist/atf-run/atffile.hpp
U src/external/bsd/atf/dist/atf-run/Atffile
U src/external/bsd/atf/dist/atf-run/config_test.cpp
U src/external/bsd/atf/dist/atf-run/Kyuafile
U src/external/bsd/atf/dist/atf-run/signals.hpp
U src/external/bsd/atf/dist/atf-run/user.hpp
U src/external/bsd/atf/dist/atf-run/requirements_test.cpp
U src/external/bsd/atf/dist/atf-run/test-program.hpp
U src/external/bsd/atf/dist/atf-run/atffile_test.cpp
U src/external/bsd/atf/dist/atf-run/config.cpp
U src/external/bsd/atf/dist/atf-run/zero_tcs_helper.c
U src/external/bsd/atf/dist/atf-run/signals_test.cpp
U src/external/bsd/atf/dist/atf-run/pass_helper.cpp
U src/external/bsd/atf/dist/atf-run/io.cpp
U src/external/bsd/atf/dist/atf-run/io_test.cpp
C src/external/bsd/atf/dist/atf-run/fs.cpp
U src/external/bsd/atf/dist/atf-run/test-program.cpp
U src/external/bsd/atf/dist/atf-run/bad_metadata_helper.c
U src/external/bsd/atf/dist/atf-run/user_test.cpp
U src/external/bsd/atf/dist/atf-run/signals.cpp
U src/external/bsd/atf/dist/atf-run/integration_test.sh
U src/external/bsd/atf/dist/atf-run/atffile.cpp
U src/external/bsd/atf/dist/atf-run/atf-run.cpp
U src/external/bsd/atf/dist/atf-run/fs.hpp
C src/external/bsd/atf/dist/atf-run/test_program_test.cpp
U src/external/bsd/atf/dist/atf-run/fs_test.cpp
U src/external/bsd/atf/dist/atf-run/expect_helpers.c
U src/external/bsd/atf/dist/atf-run/user.cpp
U src/external/bsd/atf/dist/atf-run/timer.cpp
U src/external/bsd/atf/dist/atf-run/requirements.hpp
U src/external/bsd/atf/dist/atf-run/requirements.cpp
U src/external/bsd/atf/dist/atf-run/misc_helpers.cpp
U src/external/bsd/atf/dist/atf-run/several_tcs_helper.c
U src/external/bsd/atf/dist/atf-run/config.hpp
U src/external/bsd/atf/dist/atf-run/share/atf-run.hooks
U src/external/bsd/atf/dist/atf-run/sample/atf-run.hooks
U src/external/bsd/atf/dist/atf-run/sample/common.conf
U src/external/bsd/atf/dist/atf-c++/pkg_config_test.sh
U 

CVS commit: src/external/bsd/atf/dist

2012-07-11 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Wed Jul 11 22:38:40 UTC 2012

Modified Files:
src/external/bsd/atf/dist/atf-c/detail: test_helpers.c
src/external/bsd/atf/dist/atf-run: test_program_test.cpp
src/external/bsd/atf/dist/atf-sh: atf-check.cpp
src/external/bsd/atf/dist/atf-version: atf-version.cpp

Log Message:
Post-import merge of atf 0.16.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/atf/dist/atf-c/detail/test_helpers.c
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/atf/dist/atf-run/test_program_test.cpp
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/atf/dist/atf-sh/atf-check.cpp
cvs rdiff -u -r1.6 -r1.7 \
src/external/bsd/atf/dist/atf-version/atf-version.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-c/detail/test_helpers.c
diff -u src/external/bsd/atf/dist/atf-c/detail/test_helpers.c:1.3 src/external/bsd/atf/dist/atf-c/detail/test_helpers.c:1.4
--- src/external/bsd/atf/dist/atf-c/detail/test_helpers.c:1.3	Mon Jan 16 22:41:30 2012
+++ src/external/bsd/atf/dist/atf-c/detail/test_helpers.c	Wed Jul 11 22:38:40 2012
@@ -46,33 +46,37 @@
 
 static
 void
-build_check_c_o_aux(const char *path, const char *failmsg)
+build_check_c_o_aux(const char *path, const char *failmsg,
+const bool expect_pass)
 {
 bool success;
 atf_dynstr_t iflag;
-const char *optargs[2];
+const char *optargs[4];
 
 RE(atf_dynstr_init_fmt(iflag, -I%s, atf_config_get(atf_includedir)));
 
 optargs[0] = atf_dynstr_cstring(iflag);
-optargs[1] = NULL;
+optargs[1] = -Wall;
+optargs[2] = -Werror;
+optargs[3] = NULL;
 
 RE(atf_check_build_c_o(path, test.o, optargs, success));
 
 atf_dynstr_fini(iflag);
 
-if (!success)
+if ((expect_pass  !success) || (!expect_pass  success))
 atf_tc_fail(%s, failmsg);
 }
 
 void
-build_check_c_o(const atf_tc_t *tc, const char *sfile, const char *failmsg)
+build_check_c_o(const atf_tc_t *tc, const char *sfile, const char *failmsg,
+const bool expect_pass)
 {
 atf_fs_path_t path;
 
 RE(atf_fs_path_init_fmt(path, %s/%s,
 atf_tc_get_config_var(tc, srcdir), sfile));
-build_check_c_o_aux(atf_fs_path_cstring(path), failmsg);
+build_check_c_o_aux(atf_fs_path_cstring(path), failmsg, expect_pass);
 atf_fs_path_fini(path);
 }
 
@@ -90,7 +94,7 @@ header_check(const char *hdrname)
 snprintf(failmsg, sizeof(failmsg),
  Header check failed; %s is not self-contained, hdrname);
 
-build_check_c_o_aux(test.c, failmsg);
+build_check_c_o_aux(test.c, failmsg, true);
 }
 
 void

Index: src/external/bsd/atf/dist/atf-run/test_program_test.cpp
diff -u src/external/bsd/atf/dist/atf-run/test_program_test.cpp:1.4 src/external/bsd/atf/dist/atf-run/test_program_test.cpp:1.5
--- src/external/bsd/atf/dist/atf-run/test_program_test.cpp:1.4	Mon Jan 16 22:41:30 2012
+++ src/external/bsd/atf/dist/atf-run/test_program_test.cpp	Wed Jul 11 22:38:40 2012
@@ -1008,6 +1008,8 @@ ATF_INIT_TEST_CASES(tcs)
 ATF_ADD_TEST_CASE(tcs, parse_test_case_result_skipped);
 ATF_ADD_TEST_CASE(tcs, parse_test_case_result_unknown);
 
+ATF_ADD_TEST_CASE(tcs, read_test_case_result_failed);
+ATF_ADD_TEST_CASE(tcs, read_test_case_result_skipped);
 ATF_ADD_TEST_CASE(tcs, read_test_case_result_no_file);
 ATF_ADD_TEST_CASE(tcs, read_test_case_result_empty_file);
 ATF_ADD_TEST_CASE(tcs, read_test_case_result_multiline);

Index: src/external/bsd/atf/dist/atf-sh/atf-check.cpp
diff -u src/external/bsd/atf/dist/atf-sh/atf-check.cpp:1.6 src/external/bsd/atf/dist/atf-sh/atf-check.cpp:1.7
--- src/external/bsd/atf/dist/atf-sh/atf-check.cpp:1.6	Mon Jan 16 22:41:31 2012
+++ src/external/bsd/atf/dist/atf-sh/atf-check.cpp	Wed Jul 11 22:38:40 2012
@@ -271,7 +271,7 @@ parse_status_check_arg(const std::string
 else
 value = parse_signal(value_str);
 } else
-throw atf::application::usage_error(Invalid output checker);
+throw atf::application::usage_error(Invalid status checker);
 
 return status_check(type, negated, value);
 }

Index: src/external/bsd/atf/dist/atf-version/atf-version.cpp
diff -u src/external/bsd/atf/dist/atf-version/atf-version.cpp:1.6 src/external/bsd/atf/dist/atf-version/atf-version.cpp:1.7
--- src/external/bsd/atf/dist/atf-version/atf-version.cpp:1.6	Mon Jan 16 22:41:31 2012
+++ src/external/bsd/atf/dist/atf-version/atf-version.cpp	Wed Jul 11 22:38:40 2012
@@ -69,7 +69,7 @@ atf_version::main(void)
 #if defined(PACKAGE_REVISION_TYPE_DIST)
 std::cout  format_text(Built from a distribution file; no revision 
 information available.)  \n;
-#elif defined(PACKAGE_REVISION_TYPE_MTN)
+#elif defined(PACKAGE_REVISION_TYPE_GIT)
 std::cout  format_text_with_tag(PACKAGE_REVISION_BRANCH, Branch: ,
   

CVS commit: src/external/bsd/atf/dist

2012-07-11 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Wed Jul 11 22:37:16 UTC 2012

Update of /cvsroot/src/external/bsd/atf/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv29292

Log Message:
Import atf 0.16:

Experimental version released on July 10th, 2012.

* Added a --enable-tools flag to configure to request the build of the
  deprecated ATF tools, whose build is now disabled by default.  In order
  to continue running tests, you should migrate to Kyua instead of enabling
  the build of the deprecated tools.  The kyua-atf-compat package provides
  transitional compatibility versions of atf-run and atf-report built on
  top of Kyua.

* Tweaked the ATF_TEST_CASE macro of atf-c++ so that the compiler can
  detect defined but unused test cases.

* PR bin/45859: Fixed some XSLT bugs that resulted in the tc-time and
  tp-time XML tags leaking into the generated HTML file.  Also improved
  the CSS file slightly to correct alignment and color issues with the
  timestamps column.

* Optimized atf-c++/macros.hpp so that GNU G++ consumes less memory during
  compilation with GNU G++.

* Flipped the default to building shared libraries for atf-c and atf-c++,
  and started versioning them.  As a side-effect, this removes the
  --enable-unstable-shared flag from configure that appears to not work any
  more (under NetBSD).  Additionally, some distributions require the use of
  shared libraries for proper dependency tracking (e.g. Fedora), so it is
  better if we do the right versioning upstream.

* Project hosting moved from an adhoc solution (custom web site and
  Monotone repository) to Google Code (standard wiki and Git).  ATF now
  lives in a subcomponent of the Kyua project.

Status:

Vendor Tag: TNF
Release Tags:   atf-0-16

U src/external/bsd/atf/dist/atf-c++.hpp
U src/external/bsd/atf/dist/Atffile
U src/external/bsd/atf/dist/README
U src/external/bsd/atf/dist/Kyuafile
U src/external/bsd/atf/dist/atf-c.h
U src/external/bsd/atf/dist/AUTHORS
U src/external/bsd/atf/dist/NEWS
U src/external/bsd/atf/dist/COPYING
U src/external/bsd/atf/dist/test-programs/meta_data_test.sh
U src/external/bsd/atf/dist/test-programs/Atffile
U src/external/bsd/atf/dist/test-programs/Kyuafile
U src/external/bsd/atf/dist/test-programs/c_helpers.c
U src/external/bsd/atf/dist/test-programs/srcdir_test.sh
U src/external/bsd/atf/dist/test-programs/fork_test.sh
U src/external/bsd/atf/dist/test-programs/config_test.sh
U src/external/bsd/atf/dist/test-programs/common.sh
U src/external/bsd/atf/dist/test-programs/cpp_helpers.cpp
U src/external/bsd/atf/dist/test-programs/sh_helpers.sh
U src/external/bsd/atf/dist/test-programs/result_test.sh
U src/external/bsd/atf/dist/test-programs/expect_test.sh
U src/external/bsd/atf/dist/atf-version/generate-revision.sh
C src/external/bsd/atf/dist/atf-version/atf-version.cpp
U src/external/bsd/atf/dist/atf-version/atf-version.1
U src/external/bsd/atf/dist/atf-run/atf-run.1
U src/external/bsd/atf/dist/atf-run/timer.hpp
U src/external/bsd/atf/dist/atf-run/io.hpp
U src/external/bsd/atf/dist/atf-run/atffile.hpp
U src/external/bsd/atf/dist/atf-run/Atffile
U src/external/bsd/atf/dist/atf-run/config_test.cpp
U src/external/bsd/atf/dist/atf-run/Kyuafile
U src/external/bsd/atf/dist/atf-run/signals.hpp
U src/external/bsd/atf/dist/atf-run/user.hpp
U src/external/bsd/atf/dist/atf-run/requirements_test.cpp
U src/external/bsd/atf/dist/atf-run/test-program.hpp
U src/external/bsd/atf/dist/atf-run/atffile_test.cpp
U src/external/bsd/atf/dist/atf-run/config.cpp
U src/external/bsd/atf/dist/atf-run/zero_tcs_helper.c
U src/external/bsd/atf/dist/atf-run/signals_test.cpp
U src/external/bsd/atf/dist/atf-run/pass_helper.cpp
U src/external/bsd/atf/dist/atf-run/io.cpp
U src/external/bsd/atf/dist/atf-run/io_test.cpp
C src/external/bsd/atf/dist/atf-run/fs.cpp
U src/external/bsd/atf/dist/atf-run/test-program.cpp
U src/external/bsd/atf/dist/atf-run/bad_metadata_helper.c
U src/external/bsd/atf/dist/atf-run/user_test.cpp
U src/external/bsd/atf/dist/atf-run/signals.cpp
U src/external/bsd/atf/dist/atf-run/integration_test.sh
U src/external/bsd/atf/dist/atf-run/atffile.cpp
U src/external/bsd/atf/dist/atf-run/atf-run.cpp
U src/external/bsd/atf/dist/atf-run/fs.hpp
C src/external/bsd/atf/dist/atf-run/test_program_test.cpp
U src/external/bsd/atf/dist/atf-run/fs_test.cpp
U src/external/bsd/atf/dist/atf-run/expect_helpers.c
U src/external/bsd/atf/dist/atf-run/user.cpp
U src/external/bsd/atf/dist/atf-run/timer.cpp
U src/external/bsd/atf/dist/atf-run/requirements.hpp
U src/external/bsd/atf/dist/atf-run/requirements.cpp
U src/external/bsd/atf/dist/atf-run/misc_helpers.cpp
U src/external/bsd/atf/dist/atf-run/several_tcs_helper.c
U src/external/bsd/atf/dist/atf-run/config.hpp
U src/external/bsd/atf/dist/atf-run/share/atf-run.hooks
U src/external/bsd/atf/dist/atf-run/sample/atf-run.hooks
U src/external/bsd/atf/dist/atf-run/sample/common.conf
U src/external/bsd/atf/dist/atf-c++/pkg_config_test.sh
U 

CVS commit: src/external/bsd/atf/dist

2012-07-11 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Wed Jul 11 22:38:40 UTC 2012

Modified Files:
src/external/bsd/atf/dist/atf-c/detail: test_helpers.c
src/external/bsd/atf/dist/atf-run: test_program_test.cpp
src/external/bsd/atf/dist/atf-sh: atf-check.cpp
src/external/bsd/atf/dist/atf-version: atf-version.cpp

Log Message:
Post-import merge of atf 0.16.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/atf/dist/atf-c/detail/test_helpers.c
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/atf/dist/atf-run/test_program_test.cpp
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/atf/dist/atf-sh/atf-check.cpp
cvs rdiff -u -r1.6 -r1.7 \
src/external/bsd/atf/dist/atf-version/atf-version.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist/atf-run

2012-04-04 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Thu Apr  5 01:04:18 UTC 2012

Modified Files:
src/external/bsd/atf/dist/atf-run: fs.cpp

Log Message:
Fix retry logic to avoid triggering an assertion.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/dist/atf-run/fs.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-run/fs.cpp
diff -u src/external/bsd/atf/dist/atf-run/fs.cpp:1.3 src/external/bsd/atf/dist/atf-run/fs.cpp:1.4
--- src/external/bsd/atf/dist/atf-run/fs.cpp:1.3	Mon Jan 16 22:41:30 2012
+++ src/external/bsd/atf/dist/atf-run/fs.cpp	Thu Apr  5 01:04:18 2012
@@ -137,9 +137,9 @@ retry_chmod:
 subdirs = d.names();
 ok = true;
 } catch (const atf::system_error e) {
+retries--;
 if (retries == 0)
 throw e;
-retries--;
 ::sleep(retry_delay_in_seconds);
 }
 }



CVS commit: src/external/bsd/atf/dist/atf-run

2012-04-04 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Thu Apr  5 01:04:18 UTC 2012

Modified Files:
src/external/bsd/atf/dist/atf-run: fs.cpp

Log Message:
Fix retry logic to avoid triggering an assertion.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/dist/atf-run/fs.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist/atf-report

2012-01-23 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Mon Jan 23 23:03:39 UTC 2012

Modified Files:
src/external/bsd/atf/dist/atf-report: tests-results.css
tests-results.xsl

Log Message:
Pull up upstream revision db8568696ad5a100ab3f118ac1cde53ee61ccbc3:

Fix some XSLT/CSS bugs that leaked some internal tags into the HTML file.
This, together with some CSS inconsistency, supposedly prevented the
timestamp column from being right-aligned... although I have not been able
to reproduce it with neither Chrome nor Firefox.  That said, the changes
in here should fix this.

While doing this, also change the background color of the timestamp column
for test programs to improve the divider bar between test programs.

Based on patches and ideas from pgoyette@.  Should fix PR bin/45859.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/atf/dist/atf-report/tests-results.css
cvs rdiff -u -r1.6 -r1.7 \
src/external/bsd/atf/dist/atf-report/tests-results.xsl

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-report/tests-results.css
diff -u src/external/bsd/atf/dist/atf-report/tests-results.css:1.4 src/external/bsd/atf/dist/atf-report/tests-results.css:1.5
--- src/external/bsd/atf/dist/atf-report/tests-results.css:1.4	Mon Jan 16 22:41:30 2012
+++ src/external/bsd/atf/dist/atf-report/tests-results.css	Mon Jan 23 23:03:39 2012
@@ -148,10 +148,22 @@ table.tcs-summary th {
 }
 
 table.tcs-summary td.numeric {
+width: 1pt;
+}
+
+table.tcs-summary td.numeric p {
 text-align: right;
+}
+
+table.tcs-summary td.tp-numeric {
+background: #dd;
 width: 1pt;
 }
 
+table.tcs-summary td.tp-numeric p {
+text-align: right;
+}
+
 table.tcs-summary td.tp-id {
 background: #dd;
 font-weight: bold;

Index: src/external/bsd/atf/dist/atf-report/tests-results.xsl
diff -u src/external/bsd/atf/dist/atf-report/tests-results.xsl:1.6 src/external/bsd/atf/dist/atf-report/tests-results.xsl:1.7
--- src/external/bsd/atf/dist/atf-report/tests-results.xsl:1.6	Mon Jan 16 22:41:30 2012
+++ src/external/bsd/atf/dist/atf-report/tests-results.xsl	Mon Jan 23 23:03:39 2012
@@ -382,8 +382,8 @@
 td class=tp-id colspan=3
   pxsl:value-of select=@id //p
 /td
-td class=numeric
-  xsl:apply-templates select=tp-time /s
+td class=tp-numeric
+  pxsl:value-of select=tp-time /s/p
 /td
   /tr
   xsl:if test=$which != 'bogus'
@@ -437,9 +437,9 @@
  expected_failure|expected_timeout|
  expected_signal|failed|passed|
  skipped mode=tc /
-	td class=numeric
-	  xsl:apply-templates select=tc-time /s
-	/td
+td class=numeric
+  pxsl:value-of select=tc-time /s/p
+/td
   /tr
 /xsl:if
   /xsl:template



CVS commit: src/external/bsd/atf/dist/atf-report

2012-01-23 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Mon Jan 23 23:03:39 UTC 2012

Modified Files:
src/external/bsd/atf/dist/atf-report: tests-results.css
tests-results.xsl

Log Message:
Pull up upstream revision db8568696ad5a100ab3f118ac1cde53ee61ccbc3:

Fix some XSLT/CSS bugs that leaked some internal tags into the HTML file.
This, together with some CSS inconsistency, supposedly prevented the
timestamp column from being right-aligned... although I have not been able
to reproduce it with neither Chrome nor Firefox.  That said, the changes
in here should fix this.

While doing this, also change the background color of the timestamp column
for test programs to improve the divider bar between test programs.

Based on patches and ideas from pgoyette@.  Should fix PR bin/45859.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/atf/dist/atf-report/tests-results.css
cvs rdiff -u -r1.6 -r1.7 \
src/external/bsd/atf/dist/atf-report/tests-results.xsl

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist

2012-01-16 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Mon Jan 16 22:37:01 UTC 2012

Update of /cvsroot/src/external/bsd/atf/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv22655

Log Message:
Import atf 0.15: the major goal of this import is to reconcile any local
changes to the atf codebase with upstream code.  All local changes should
have been backported, with appropriate portability workarounds where
necessary.

This new release also includes other changes though, such as performance
improvements and bug fixes, and also a major new feature partially
implemented by pgoyette@: the time to execute each test cases and test
program is now recorded and included in the output reports.

The import into NetBSD has been tested natively on amd64 and macppc, and
the full test suite has also been run through anita on amd64 and i386.
No regressions observed... but you never know.

From the NEWS file, the changes in this version are as follows:

Experimental version released on January 16th, 2012.

* Respect stdin in atf-check.  The previous release silenced stdin for any
  processes spawned by atf, not only test programs, which caused breakage
  in tests that pipe data through atf-check.

* Performance improvements to atf-sh.

* Enabled detection of unused parameters and variables in the code and
  fixed all warnings.

* Changed the behavior of developer mode.  Compiler warnings are now
  enabled unconditionally regardless of whether we are in developer mode or
  not; developer mode is now only used to perform strict warning checks and
  to enable assertions.  Additionally, developer mode is now only
  automatically enabled when building from the repository, not for formal
  releases.

* Added new Autoconf M4 macros (ATF_ARG_WITH, ATF_CHECK_C and
  ATF_CHECK_CXX) to provide a consistent way of defining a --with-arg flag
  in configure scripts and detecting the presence of any of the ATF
  bindings.  Note that ATF_CHECK_SH was already introduced in 0.14, but it
  has now been modified to also honor --with-atf if instantiated.

* Added timing support to atf-run / atf-report.

* Added support for a 'require.memory' property, to specify the minimum
  amount of physical memory needed by the test case to yield valid results.

* PR bin/45690: Force an ISO-8859-1 encoding in the XML files generated by
  atf-report so that invalid data in the output of test cases does not
  mangle our report.

Status:

Vendor Tag: TNF
Release Tags:   atf-0-15

U src/external/bsd/atf/dist/README
U src/external/bsd/atf/dist/Atffile
U src/external/bsd/atf/dist/atf-c.h
U src/external/bsd/atf/dist/atf-c++.hpp
U src/external/bsd/atf/dist/AUTHORS
U src/external/bsd/atf/dist/COPYING
U src/external/bsd/atf/dist/NEWS
U src/external/bsd/atf/dist/Kyuafile
U src/external/bsd/atf/dist/atf-c/error_fwd.h
U src/external/bsd/atf/dist/atf-c/build.h
U src/external/bsd/atf/dist/atf-c/check.h
U src/external/bsd/atf/dist/atf-c/config.h
U src/external/bsd/atf/dist/atf-c/error.h
U src/external/bsd/atf/dist/atf-c/atf-c-api.3
U src/external/bsd/atf/dist/atf-c/macros.h
C src/external/bsd/atf/dist/atf-c/tc.h
U src/external/bsd/atf/dist/atf-c/tp.h
U src/external/bsd/atf/dist/atf-c/utils.h
U src/external/bsd/atf/dist/atf-c/pkg_config_test.sh
C src/external/bsd/atf/dist/atf-c/defs.h.in
U src/external/bsd/atf/dist/atf-c/build.c
U src/external/bsd/atf/dist/atf-c/check.c
U src/external/bsd/atf/dist/atf-c/config.c
U src/external/bsd/atf/dist/atf-c/error.c
C src/external/bsd/atf/dist/atf-c/tc.c
U src/external/bsd/atf/dist/atf-c/tp.c
U src/external/bsd/atf/dist/atf-c/utils.c
U src/external/bsd/atf/dist/atf-c/h_build.h
U src/external/bsd/atf/dist/atf-c/atf_c_test.c
U src/external/bsd/atf/dist/atf-c/build_test.c
U src/external/bsd/atf/dist/atf-c/check_test.c
U src/external/bsd/atf/dist/atf-c/config_test.c
U src/external/bsd/atf/dist/atf-c/tc_test.c
U src/external/bsd/atf/dist/atf-c/error_test.c
U src/external/bsd/atf/dist/atf-c/macros_test.c
U src/external/bsd/atf/dist/atf-c/tp_test.c
U src/external/bsd/atf/dist/atf-c/utils_test.c
U src/external/bsd/atf/dist/atf-c/atf-c.pc.in
U src/external/bsd/atf/dist/atf-c/Atffile
U src/external/bsd/atf/dist/atf-c/Kyuafile
U src/external/bsd/atf/dist/atf-c/macros_h_test.c
U src/external/bsd/atf/dist/atf-c/detail/process_helpers.c
C src/external/bsd/atf/dist/atf-c/detail/test_helpers.c
U src/external/bsd/atf/dist/atf-c/detail/test_helpers.h
U src/external/bsd/atf/dist/atf-c/detail/dynstr.c
U src/external/bsd/atf/dist/atf-c/detail/dynstr.h
U src/external/bsd/atf/dist/atf-c/detail/env.c
U src/external/bsd/atf/dist/atf-c/detail/env.h
U src/external/bsd/atf/dist/atf-c/detail/fs.c
U src/external/bsd/atf/dist/atf-c/detail/fs.h
U src/external/bsd/atf/dist/atf-c/detail/list.c
U src/external/bsd/atf/dist/atf-c/detail/list.h
U src/external/bsd/atf/dist/atf-c/detail/map.c
U src/external/bsd/atf/dist/atf-c/detail/map.h
C src/external/bsd/atf/dist/atf-c/detail/process.c
C src/external/bsd/atf/dist/atf-c/detail/process.h
U 

CVS commit: src/external/bsd/atf/dist

2012-01-16 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Mon Jan 16 22:37:01 UTC 2012

Update of /cvsroot/src/external/bsd/atf/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv22655

Log Message:
Import atf 0.15: the major goal of this import is to reconcile any local
changes to the atf codebase with upstream code.  All local changes should
have been backported, with appropriate portability workarounds where
necessary.

This new release also includes other changes though, such as performance
improvements and bug fixes, and also a major new feature partially
implemented by pgoyette@: the time to execute each test cases and test
program is now recorded and included in the output reports.

The import into NetBSD has been tested natively on amd64 and macppc, and
the full test suite has also been run through anita on amd64 and i386.
No regressions observed... but you never know.

From the NEWS file, the changes in this version are as follows:

Experimental version released on January 16th, 2012.

* Respect stdin in atf-check.  The previous release silenced stdin for any
  processes spawned by atf, not only test programs, which caused breakage
  in tests that pipe data through atf-check.

* Performance improvements to atf-sh.

* Enabled detection of unused parameters and variables in the code and
  fixed all warnings.

* Changed the behavior of developer mode.  Compiler warnings are now
  enabled unconditionally regardless of whether we are in developer mode or
  not; developer mode is now only used to perform strict warning checks and
  to enable assertions.  Additionally, developer mode is now only
  automatically enabled when building from the repository, not for formal
  releases.

* Added new Autoconf M4 macros (ATF_ARG_WITH, ATF_CHECK_C and
  ATF_CHECK_CXX) to provide a consistent way of defining a --with-arg flag
  in configure scripts and detecting the presence of any of the ATF
  bindings.  Note that ATF_CHECK_SH was already introduced in 0.14, but it
  has now been modified to also honor --with-atf if instantiated.

* Added timing support to atf-run / atf-report.

* Added support for a 'require.memory' property, to specify the minimum
  amount of physical memory needed by the test case to yield valid results.

* PR bin/45690: Force an ISO-8859-1 encoding in the XML files generated by
  atf-report so that invalid data in the output of test cases does not
  mangle our report.

Status:

Vendor Tag: TNF
Release Tags:   atf-0-15

U src/external/bsd/atf/dist/README
U src/external/bsd/atf/dist/Atffile
U src/external/bsd/atf/dist/atf-c.h
U src/external/bsd/atf/dist/atf-c++.hpp
U src/external/bsd/atf/dist/AUTHORS
U src/external/bsd/atf/dist/COPYING
U src/external/bsd/atf/dist/NEWS
U src/external/bsd/atf/dist/Kyuafile
U src/external/bsd/atf/dist/atf-c/error_fwd.h
U src/external/bsd/atf/dist/atf-c/build.h
U src/external/bsd/atf/dist/atf-c/check.h
U src/external/bsd/atf/dist/atf-c/config.h
U src/external/bsd/atf/dist/atf-c/error.h
U src/external/bsd/atf/dist/atf-c/atf-c-api.3
U src/external/bsd/atf/dist/atf-c/macros.h
C src/external/bsd/atf/dist/atf-c/tc.h
U src/external/bsd/atf/dist/atf-c/tp.h
U src/external/bsd/atf/dist/atf-c/utils.h
U src/external/bsd/atf/dist/atf-c/pkg_config_test.sh
C src/external/bsd/atf/dist/atf-c/defs.h.in
U src/external/bsd/atf/dist/atf-c/build.c
U src/external/bsd/atf/dist/atf-c/check.c
U src/external/bsd/atf/dist/atf-c/config.c
U src/external/bsd/atf/dist/atf-c/error.c
C src/external/bsd/atf/dist/atf-c/tc.c
U src/external/bsd/atf/dist/atf-c/tp.c
U src/external/bsd/atf/dist/atf-c/utils.c
U src/external/bsd/atf/dist/atf-c/h_build.h
U src/external/bsd/atf/dist/atf-c/atf_c_test.c
U src/external/bsd/atf/dist/atf-c/build_test.c
U src/external/bsd/atf/dist/atf-c/check_test.c
U src/external/bsd/atf/dist/atf-c/config_test.c
U src/external/bsd/atf/dist/atf-c/tc_test.c
U src/external/bsd/atf/dist/atf-c/error_test.c
U src/external/bsd/atf/dist/atf-c/macros_test.c
U src/external/bsd/atf/dist/atf-c/tp_test.c
U src/external/bsd/atf/dist/atf-c/utils_test.c
U src/external/bsd/atf/dist/atf-c/atf-c.pc.in
U src/external/bsd/atf/dist/atf-c/Atffile
U src/external/bsd/atf/dist/atf-c/Kyuafile
U src/external/bsd/atf/dist/atf-c/macros_h_test.c
U src/external/bsd/atf/dist/atf-c/detail/process_helpers.c
C src/external/bsd/atf/dist/atf-c/detail/test_helpers.c
U src/external/bsd/atf/dist/atf-c/detail/test_helpers.h
U src/external/bsd/atf/dist/atf-c/detail/dynstr.c
U src/external/bsd/atf/dist/atf-c/detail/dynstr.h
U src/external/bsd/atf/dist/atf-c/detail/env.c
U src/external/bsd/atf/dist/atf-c/detail/env.h
U src/external/bsd/atf/dist/atf-c/detail/fs.c
U src/external/bsd/atf/dist/atf-c/detail/fs.h
U src/external/bsd/atf/dist/atf-c/detail/list.c
U src/external/bsd/atf/dist/atf-c/detail/list.h
U src/external/bsd/atf/dist/atf-c/detail/map.c
U src/external/bsd/atf/dist/atf-c/detail/map.h
C src/external/bsd/atf/dist/atf-c/detail/process.c
C src/external/bsd/atf/dist/atf-c/detail/process.h
U 

CVS commit: src/external/bsd/atf/dist

2012-01-16 Thread Julio Merino
Module Name:src
Committed By:   jmmv
Date:   Mon Jan 16 22:41:31 UTC 2012

Modified Files:
src/external/bsd/atf/dist/atf-c: defs.h.in tc.c tc.h
src/external/bsd/atf/dist/atf-c++: tests.cpp tests.hpp
src/external/bsd/atf/dist/atf-c++/detail: process.hpp text.cpp text.hpp
src/external/bsd/atf/dist/atf-c/detail: process.c process.h
process_test.c test_helpers.c
src/external/bsd/atf/dist/atf-config: integration_test.sh
src/external/bsd/atf/dist/atf-report: atf-report.cpp tests-results.css
tests-results.xsl
src/external/bsd/atf/dist/atf-run: atf-run.cpp fs.cpp
integration_test.sh io_test.cpp requirements.cpp test-program.cpp
test_program_test.cpp timer.cpp timer.hpp
src/external/bsd/atf/dist/atf-sh: atf-check.cpp atf-check_test.sh
src/external/bsd/atf/dist/atf-version: atf-version.cpp
src/external/bsd/atf/dist/doc: atf-test-case.4

Log Message:
Resolve conflicts after the import of atf 0.15.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/atf-c/defs.h.in
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/atf/dist/atf-c/tc.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/dist/atf-c/tc.h
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/atf/dist/atf-c++/tests.cpp
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/atf/dist/atf-c++/tests.hpp
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/atf-c++/detail/process.hpp \
src/external/bsd/atf/dist/atf-c++/detail/text.cpp \
src/external/bsd/atf/dist/atf-c++/detail/text.hpp
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/atf-c/detail/process.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/atf-c/detail/process.h \
src/external/bsd/atf/dist/atf-c/detail/process_test.c \
src/external/bsd/atf/dist/atf-c/detail/test_helpers.c
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/atf/dist/atf-config/integration_test.sh
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/atf/dist/atf-report/atf-report.cpp \
src/external/bsd/atf/dist/atf-report/tests-results.xsl
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/atf/dist/atf-report/tests-results.css
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/atf/dist/atf-run/atf-run.cpp
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/atf-run/fs.cpp \
src/external/bsd/atf/dist/atf-run/requirements.cpp \
src/external/bsd/atf/dist/atf-run/timer.hpp
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/atf/dist/atf-run/integration_test.sh \
src/external/bsd/atf/dist/atf-run/io_test.cpp \
src/external/bsd/atf/dist/atf-run/test_program_test.cpp
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/atf/dist/atf-run/test-program.cpp
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/atf/dist/atf-run/timer.cpp
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/atf/dist/atf-sh/atf-check.cpp
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/atf-sh/atf-check_test.sh
cvs rdiff -u -r1.5 -r1.6 \
src/external/bsd/atf/dist/atf-version/atf-version.cpp
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/doc/atf-test-case.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-23 Thread Julio Merino
On 12/19/11 10:25 PM, Christos Zoulas wrote:
 Module Name:  src
 Committed By: christos
 Date: Mon Dec 19 22:25:46 UTC 2011
 
 Modified Files:
   src/external/bsd/atf/dist/atf-run: timer.cpp
 
 Log Message:
 - make all the ifdefs match
 - make it compile, and test

This was still broken.

timer_t and itimerspec do not exist, so the timer.hpp file is unusable.
 The definition of HAVE_POSIX_TIMER does not work because SIGEV_NONE is
defined in OS X.  The change of sys/time.h and signal.h to ctime and
csignal seems to cause issues too.

I have had to fix this by adding a configure test for timer_t, using the
pimpl idiom for the timer class definition to prevent further ifdef mess
in timer.hpp, and had to sprinkle some more ifdef stuff in the code.

The result is incredibly ugly, and I doubt there is any real benefit
other than using modern interfaces.  Was it really worth it?  (I have
not committed these fixes to the NetBSD tree because I cannot test
them at the moment.)

-- 
Julio Merino / @jmmv


Re: CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-23 Thread Christos Zoulas
On Dec 23, 10:47am, j...@netbsd.org (Julio Merino) wrote:
-- Subject: Re: CVS commit: src/external/bsd/atf/dist/atf-run

| On 12/19/11 10:25 PM, Christos Zoulas wrote:
|  Module Name:src
|  Committed By:   christos
|  Date:   Mon Dec 19 22:25:46 UTC 2011
|  
|  Modified Files:
|  src/external/bsd/atf/dist/atf-run: timer.cpp
|  
|  Log Message:
|  - make all the ifdefs match
|  - make it compile, and test
| 
| This was still broken.
| 
| timer_t and itimerspec do not exist, so the timer.hpp file is unusable.
|  The definition of HAVE_POSIX_TIMER does not work because SIGEV_NONE is
| defined in OS X.  The change of sys/time.h and signal.h to ctime and
| csignal seems to cause issues too.
| 
| I have had to fix this by adding a configure test for timer_t, using the
| pimpl idiom for the timer class definition to prevent further ifdef mess
| in timer.hpp, and had to sprinkle some more ifdef stuff in the code.
| 
| The result is incredibly ugly, and I doubt there is any real benefit
| other than using modern interfaces.  Was it really worth it?  (I have
| not committed these fixes to the NetBSD tree because I cannot test
| them at the moment.)

I don't know. I would not have guessed that OS/X is lacking them, since
they've been around for more than a decade.

christos


Re: CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-21 Thread Julio Merino
On Sun, Dec 18, 2011 at 10:34 PM, Christos Zoulas chris...@netbsd.orgwrote:

 Module Name:src
 Committed By:   christos
 Date:   Sun Dec 18 22:34:06 UTC 2011

 Modified Files:
src/external/bsd/atf/dist/atf-run: timer.cpp timer.hpp

 Log Message:
 Don't use antiquated BSD API's that require global variable, use posix
 timers
 instead.


Interesting; didn't know about these.

But what's the point of this change?  It breaks OS X at least and does not
fix anything AFAICT.

-- 
Julio Merino / @jmmv


Re: CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-21 Thread Julio Merino
On Mon, Dec 19, 2011 at 5:58 PM, Christos Zoulas chris...@zoulas.comwrote:

 On Dec 19,  5:00pm, j...@netbsd.org (Julio Merino) wrote:
 -- Subject: Re: CVS commit: src/external/bsd/atf/dist/atf-run

 | Interesting; didn't know about these.
 |
 | But what's the point of this change?  It breaks OS X at least and does
 not
 | fix anything AFAICT.

 I am just trying to use modern POSIX API's to improve portability


Well... modern has come to mean less portable in my book.  (I like using
modern APIs, but they tend to break grgrgr.)


 (and functionality in this case). For example, by using sigevent,
 one doesn't need to have global variables and he can pass the struct
 he wants to modify in the signal. In addition, one can use the
 monotonic clock, which is immune against time changes, and also
 use timespec which is more precise. Finally one is not limited to
 sigalrm for timers, but can send any signal.


Thanks.


 I am really suprised
 that OS/X does not have them; I would have expected it to work on
 more systems than it does currently...


I could only check with Snow Leopard and there is no timer_t there.  I
don't have access to Lion at the moment; when I do, I'll check again.  If
there is no support in it, I'll have to implement some conditional logic to
use the new timers only if available (unless you have a better
alternative?).  If there is support, then I won't care about backwards
compatibility.

-- 
Julio Merino / @jmmv


Re: CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-21 Thread Julio Merino
On Mon, Dec 19, 2011 at 8:32 PM, Christos Zoulas chris...@zoulas.comwrote:

 On Dec 19,  6:06pm, j...@netbsd.org (Julio Merino) wrote:
 -- Subject: Re: CVS commit: src/external/bsd/atf/dist/atf-run

 | I could only check with Snow Leopard and there is no timer_t there.  I
 | don't have access to Lion at the moment; when I do, I'll check again.  If
 | there is no support in it, I'll have to implement some conditional logic
 to
 | use the new timers only if available (unless you have a better
 | alternative?).  If there is support, then I won't care about backwards
 | compatibility.

 Since it is my fault that I broke it, I will add a shim for OS/X that
 does not do anything fancy and implements the previous basic functionality
 that setitimer had.


Could you check if this support exists in Lion first?  If that's the case,
I personally don't think it is a big deal.  But thanks if you do that!

-- 
Julio Merino / @jmmv


Re: CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-19 Thread Christos Zoulas
On Dec 19,  5:00pm, j...@netbsd.org (Julio Merino) wrote:
-- Subject: Re: CVS commit: src/external/bsd/atf/dist/atf-run

| Interesting; didn't know about these.
| 
| But what's the point of this change?  It breaks OS X at least and does not
| fix anything AFAICT.

I am just trying to use modern POSIX API's to improve portability
(and functionality in this case). For example, by using sigevent,
one doesn't need to have global variables and he can pass the struct
he wants to modify in the signal. In addition, one can use the
monotonic clock, which is immune against time changes, and also
use timespec which is more precise. Finally one is not limited to
sigalrm for timers, but can send any signal. I am really suprised
that OS/X does not have them; I would have expected it to work on
more systems than it does currently...

christos


Re: CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-19 Thread Christos Zoulas
On Dec 19,  6:06pm, j...@netbsd.org (Julio Merino) wrote:
-- Subject: Re: CVS commit: src/external/bsd/atf/dist/atf-run

| I could only check with Snow Leopard and there is no timer_t there.  I
| don't have access to Lion at the moment; when I do, I'll check again.  If
| there is no support in it, I'll have to implement some conditional logic to
| use the new timers only if available (unless you have a better
| alternative?).  If there is support, then I won't care about backwards
| compatibility.

Since it is my fault that I broke it, I will add a shim for OS/X that
does not do anything fancy and implements the previous basic functionality
that setitimer had.

christos


Re: CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-19 Thread Christos Zoulas
On Dec 19,  8:37pm, j...@netbsd.org (Julio Merino) wrote:
-- Subject: Re: CVS commit: src/external/bsd/atf/dist/atf-run

| Could you check if this support exists in Lion first?  If that's the case,
| I personally don't think it is a big deal.  But thanks if you do that!

It does not, and I've put compatibility code back.

christos


CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 19 21:59:46 UTC 2011

Modified Files:
src/external/bsd/atf/dist/atf-run: timer.cpp

Log Message:
Put back setitimer based code for the have-nots: (OS/X Lion)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/dist/atf-run/timer.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-run/timer.cpp
diff -u src/external/bsd/atf/dist/atf-run/timer.cpp:1.3 src/external/bsd/atf/dist/atf-run/timer.cpp:1.4
--- src/external/bsd/atf/dist/atf-run/timer.cpp:1.3	Sun Dec 18 22:16:05 2011
+++ src/external/bsd/atf/dist/atf-run/timer.cpp	Mon Dec 19 16:59:46 2011
@@ -44,11 +44,25 @@ namespace impl = atf::atf_run;
 // Auxiliary functions.
 // 
 
+#ifdef SIGEV_NONE
+#define HAVE_POSIX_TIMER
+#endif
+
+#ifndef HAVE_POSIX_TIMER
+static void *handle;
+#endif
+
 static
 void
 handler(int signo, siginfo_t *si, void *uc)
 {
-impl::timer *timer = static_castimpl::timer *(si-si_value.sival_ptr);
+impl::timer *timer = static_castimpl::timer *(
+#ifndef HAVE_POSIX_TIMER
+	handle
+#else
+	si-si_value.sival_ptr
+#endif
+);
 
 timer-setfired();
 timer-timeout_callback();
@@ -68,7 +82,7 @@ impl::timer::timer(const unsigned int se
 throw system_error(IMPL_NAME ::timer::timer,
Failed to set signal handler, errno);
 	
-
+#ifndef HAVE_POSIX_TIMER
 ::sigevent se;
 se.sigev_notify = SIGEV_SIGNAL;
 se.sigev_signo = SIGALRM;
@@ -92,11 +106,32 @@ impl::timer::timer(const unsigned int se
 throw system_error(IMPL_NAME ::timer::timer,
Failed to program timer, errno);
 }
+#else
+::itimerval it, oit;
+it.it_interval.tv_sec = 0;
+it.it_interval.tv_usec = 0;
+it.it_value.tv_sec = seconds;
+it.it_value.tv_usec = 0;
+if (::setitimer(ITIMER_REAL, it, oit) == -1)
+	::sigaction(SIGALRM, m_old_sa, NULL);
+throw system_error(IMPL_NAME ::timer::timer,
+   Failed to program timer, errno);
+}
+TIMEVAL_TO_TIMESPEC(m_old_it, oit);
+handle = static_castvoid *(this);
+#endif
 }
 
 impl::timer::~timer(void)
 {
-int ret = ::timer_delete(m_timer);
+int ret;
+#ifdef HAVE_POSIX_TIMER
+::itimerval oit;
+TIMESPEC_TO_TIMEVAL(oit, m_old_it);
+ret = ::setitimer(ITIMER_REAL, oit, NULL);
+#else
+ret = ::timer_delete(m_timer);
+#endif
 INV(ret != -1);
 ret = ::sigaction(SIGALRM, m_old_sa, NULL);
 INV(ret != -1);



CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 19 22:25:46 UTC 2011

Modified Files:
src/external/bsd/atf/dist/atf-run: timer.cpp

Log Message:
- make all the ifdefs match
- make it compile, and test


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/atf-run/timer.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-run/timer.cpp
diff -u src/external/bsd/atf/dist/atf-run/timer.cpp:1.4 src/external/bsd/atf/dist/atf-run/timer.cpp:1.5
--- src/external/bsd/atf/dist/atf-run/timer.cpp:1.4	Mon Dec 19 16:59:46 2011
+++ src/external/bsd/atf/dist/atf-run/timer.cpp	Mon Dec 19 17:25:45 2011
@@ -57,10 +57,10 @@ void
 handler(int signo, siginfo_t *si, void *uc)
 {
 impl::timer *timer = static_castimpl::timer *(
-#ifndef HAVE_POSIX_TIMER
-	handle
-#else
+#ifdef HAVE_POSIX_TIMER
 	si-si_value.sival_ptr
+#else
+	handle
 #endif
 );
 
@@ -82,7 +82,7 @@ impl::timer::timer(const unsigned int se
 throw system_error(IMPL_NAME ::timer::timer,
Failed to set signal handler, errno);
 	
-#ifndef HAVE_POSIX_TIMER
+#ifdef HAVE_POSIX_TIMER
 ::sigevent se;
 se.sigev_notify = SIGEV_SIGNAL;
 se.sigev_signo = SIGALRM;
@@ -112,12 +112,13 @@ impl::timer::timer(const unsigned int se
 it.it_interval.tv_usec = 0;
 it.it_value.tv_sec = seconds;
 it.it_value.tv_usec = 0;
-if (::setitimer(ITIMER_REAL, it, oit) == -1)
+if (::setitimer(ITIMER_REAL, it, oit) == -1) {
 	::sigaction(SIGALRM, m_old_sa, NULL);
 throw system_error(IMPL_NAME ::timer::timer,
Failed to program timer, errno);
 }
-TIMEVAL_TO_TIMESPEC(m_old_it, oit);
+TIMEVAL_TO_TIMESPEC(oit.it_interval, m_old_it.it_interval);
+TIMEVAL_TO_TIMESPEC(oit.it_value, m_old_it.it_value);
 handle = static_castvoid *(this);
 #endif
 }
@@ -126,11 +127,12 @@ impl::timer::~timer(void)
 {
 int ret;
 #ifdef HAVE_POSIX_TIMER
+ret = ::timer_delete(m_timer);
+#else
 ::itimerval oit;
-TIMESPEC_TO_TIMEVAL(oit, m_old_it);
+TIMESPEC_TO_TIMEVAL(oit.it_interval, m_old_it.it_interval);
+TIMESPEC_TO_TIMEVAL(oit.it_value, m_old_it.it_value);
 ret = ::setitimer(ITIMER_REAL, oit, NULL);
-#else
-ret = ::timer_delete(m_timer);
 #endif
 INV(ret != -1);
 ret = ::sigaction(SIGALRM, m_old_sa, NULL);



CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 19 21:59:46 UTC 2011

Modified Files:
src/external/bsd/atf/dist/atf-run: timer.cpp

Log Message:
Put back setitimer based code for the have-nots: (OS/X Lion)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/atf/dist/atf-run/timer.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 19 22:25:46 UTC 2011

Modified Files:
src/external/bsd/atf/dist/atf-run: timer.cpp

Log Message:
- make all the ifdefs match
- make it compile, and test


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/atf/dist/atf-run/timer.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 18 22:34:06 UTC 2011

Modified Files:
src/external/bsd/atf/dist/atf-run: timer.cpp timer.hpp

Log Message:
Don't use antiquated BSD API's that require global variable, use posix timers
instead.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/atf/dist/atf-run/timer.cpp \
src/external/bsd/atf/dist/atf-run/timer.hpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-run/timer.cpp
diff -u src/external/bsd/atf/dist/atf-run/timer.cpp:1.1.1.2 src/external/bsd/atf/dist/atf-run/timer.cpp:1.2
--- src/external/bsd/atf/dist/atf-run/timer.cpp:1.1.1.2	Wed Oct 20 05:14:23 2010
+++ src/external/bsd/atf/dist/atf-run/timer.cpp	Sun Dec 18 17:34:06 2011
@@ -27,9 +27,7 @@
 // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 //
 
-extern C {
-#include signal.h
-}
+#include csignal
 
 #include cerrno
 
@@ -46,56 +44,69 @@ namespace impl = atf::atf_run;
 // Auxiliary functions.
 // 
 
-namespace sigalrm {
-
-bool m_fired = false;
-impl::timer* m_timer = NULL;
-
+static
 void
-handler(const int signo)
+handler(int signo, siginfo_t *si, void *uc)
 {
-PRE(signo == SIGALRM);
+impl::timer *timer = static_castimpl::timer *(si-si_value.sival_ptr);
 
-m_fired = true;
-m_timer-timeout_callback();
+timer-setfired();
+timer-timeout_callback();
 }
 
-} // anonymous namespace
-
 // 
 // The timer class.
 // 
 
-impl::timer::timer(const unsigned int seconds)
+impl::timer::timer(const unsigned int seconds) : m_fired(false)
 {
-sigalrm::m_fired = false;
-sigalrm::m_timer = this;
-m_sigalrm.reset(new signal_programmer(SIGALRM, sigalrm::handler));
-
-::itimerval timeval;
-timeval.it_interval.tv_sec = 0;
-timeval.it_interval.tv_usec = 0;
-timeval.it_value.tv_sec = seconds;
-timeval.it_value.tv_usec = 0;
+struct sigaction sa;
+::sigemptyset(sa.sa_mask);
+sa.sa_flags = SA_SIGINFO;
+sa.sa_sigaction = ::handler;
+if (::sigaction(SIGALRM, sa, m_old_sa) == -1)
+throw system_error(IMPL_NAME ::timer::timer,
+   Failed to set signal handler, errno);
+	
+
+::sigevent se;
+se.sigev_notify = SIGEV_SIGNAL;
+se.sigev_signo = SIGALRM;
+se.sigev_value.sival_ptr = static_castvoid *(this);
+se.sigev_notify_function = NULL;
+se.sigev_notify_attributes = NULL;
+if (::timer_create(CLOCK_MONOTONIC, se, m_timer) == -1) {
+	::sigaction(SIGALRM, m_old_sa, NULL);
+throw system_error(IMPL_NAME ::timer::timer,
+   Failed to create timer, errno);
+}
 
-if (::setitimer(ITIMER_REAL, timeval, m_old_timeval) == -1)
+::itimerspec it;
+it.it_interval.tv_sec = 0;
+it.it_interval.tv_nsec = 0;
+it.it_value.tv_sec = seconds;
+it.it_value.tv_nsec = 0;
+if (::timer_settime(m_timer, 0, it, m_old_it) == -1) {
+	::sigaction(SIGALRM, m_old_sa, NULL);
+	::timer_delete(m_timer);
 throw system_error(IMPL_NAME ::timer::timer,
Failed to program timer, errno);
+}
 }
 
 impl::timer::~timer(void)
 {
-const int ret = ::setitimer(ITIMER_REAL, m_old_timeval, NULL);
+int ret = ::timer_delete(m_timer);
+INV(ret != -1);
+ret = ::sigaction(SIGALRM, m_old_sa, NULL);
 INV(ret != -1);
-sigalrm::m_timer = NULL;
-sigalrm::m_fired = false;
 }
 
 bool
 impl::timer::fired(void)
 const
 {
-return sigalrm::m_fired;
+return m_fired;
 }
 
 // 
@@ -121,5 +132,5 @@ impl::child_timer::timeout_callback(void
 
 // Should use killpg(2) but, according to signal(7), using this system
 // call in a signal handler context is not safe.
-::kill(m_pid, SIGKILL);
+::killpg(-m_pid, SIGKILL);
 }
Index: src/external/bsd/atf/dist/atf-run/timer.hpp
diff -u src/external/bsd/atf/dist/atf-run/timer.hpp:1.1.1.2 src/external/bsd/atf/dist/atf-run/timer.hpp:1.2
--- src/external/bsd/atf/dist/atf-run/timer.hpp:1.1.1.2	Wed Oct 20 05:14:23 2010
+++ src/external/bsd/atf/dist/atf-run/timer.hpp	Sun Dec 18 17:34:06 2011
@@ -30,12 +30,8 @@
 #if !defined(_ATF_RUN_ALARM_HPP_)
 #define _ATF_RUN_ALARM_HPP_
 
-extern C {
-#include sys/time.h
-#include sys/types.h
-}
-
-#include memory
+#include ctime
+#include csignal
 
 #include atf-c++/utils.hpp
 
@@ -49,14 +45,17 @@ class signal_programmer;
 // 
 
 class timer : utils::noncopyable {
-::itimerval m_old_timeval;
-std::auto_ptr signal_programmer  m_sigalrm;
+::timer_t m_timer;
+::itimerspec m_old_it;
+struct sigaction 

CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 19 03:16:06 UTC 2011

Modified Files:
src/external/bsd/atf/dist/atf-run: timer.cpp

Log Message:
fix killing code I just broke, and give program a chance to cleanup.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/atf-run/timer.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-run/timer.cpp
diff -u src/external/bsd/atf/dist/atf-run/timer.cpp:1.2 src/external/bsd/atf/dist/atf-run/timer.cpp:1.3
--- src/external/bsd/atf/dist/atf-run/timer.cpp:1.2	Sun Dec 18 17:34:06 2011
+++ src/external/bsd/atf/dist/atf-run/timer.cpp	Sun Dec 18 22:16:05 2011
@@ -128,9 +128,10 @@ impl::child_timer::~child_timer(void)
 void
 impl::child_timer::timeout_callback(void)
 {
+static const timespec ts = { 1, 0 };
 m_terminate = true;
-
-// Should use killpg(2) but, according to signal(7), using this system
-// call in a signal handler context is not safe.
-::killpg(-m_pid, SIGKILL);
+::kill(-m_pid, SIGTERM);
+::nanosleep(ts, NULL);
+if (::kill(-m_pid, 0) != -1)
+	::kill(-m_pid, SIGKILL);
 }



CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 18 22:34:06 UTC 2011

Modified Files:
src/external/bsd/atf/dist/atf-run: timer.cpp timer.hpp

Log Message:
Don't use antiquated BSD API's that require global variable, use posix timers
instead.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/atf/dist/atf-run/timer.cpp \
src/external/bsd/atf/dist/atf-run/timer.hpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 19 03:16:06 UTC 2011

Modified Files:
src/external/bsd/atf/dist/atf-run: timer.cpp

Log Message:
fix killing code I just broke, and give program a chance to cleanup.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/atf/dist/atf-run/timer.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/external/bsd/atf/dist

2011-11-16 Thread Julio Merino

On 11/16/11 12:46 PM, Christos Zoulas wrote:

Module Name:src
Committed By:   christos
Date:   Wed Nov 16 17:46:16 UTC 2011

Modified Files:
src/external/bsd/atf/dist/atf-c++/detail: text.cpp text.hpp
src/external/bsd/atf/dist/atf-run: requirements.cpp test-program.cpp

Log Message:
PR/45619: jmmv: Allow atf tests to request a minimum amount of memory


Could you run intrusive changes to atf for review please?

The current changes are incomplete and inappropriate, so they are going 
to make integration upstream a pain.



+int64_t
+impl::to_number(const std::string  str)
+{
+   int64_t num;
+   ::dehumanize_number(str.c_str(),num);


This adds a dependency on NetBSD that should not be there.

[...]

+static
+std::string
+check_memory(const std::string  memory)
+{
+// Make sure we have enough memory
+int64_t memneed = atf::text::to_number(memory);
+int64_t memavail;
+size_t len = sizeof(memavail);
+
+if (::sysctlbyname(hw.usermem64,memavail,len, NULL, 0) == -1) {


Same here and below in the same function.  This is NetBSD specific and 
there is no provisions to support other systems.


[...]

Lastly, this has been added without absolutely no tests and no 
documentation.  (And there seem to be whitespace issues, although I 
can't tell if these are my mua's fault...)


Re: CVS commit: src/external/bsd/atf/dist

2011-11-16 Thread Christos Zoulas
In article 4ec3f8f7.8020...@netbsd.org,
Julio Merino  j...@netbsd.org wrote:
On 11/16/11 12:46 PM, Christos Zoulas wrote:
 Module Name: src
 Committed By:christos
 Date:Wed Nov 16 17:46:16 UTC 2011

 Modified Files:
  src/external/bsd/atf/dist/atf-c++/detail: text.cpp text.hpp
  src/external/bsd/atf/dist/atf-run: requirements.cpp test-program.cpp

 Log Message:
 PR/45619: jmmv: Allow atf tests to request a minimum amount of memory

Could you run intrusive changes to atf for review please?

The current changes are incomplete and inappropriate, so they are going 
to make integration upstream a pain.

Well, there is really no portable way to find the total available memory of
the system that I know of and I did not want to add ifdefs or machinery
to get this working on other OS's. If you know otherwise, feel free to fix it.

The changes are really small and they are additions only. I fail to see how
it is going to be difficult to integrate. The only difficulty here is to
make them portable across OS's, and that can be done with a getrealmemory()
stub function per OS, and include the sources for humanize_number for the
ones that don't have it.

christos



Re: CVS commit: src/external/bsd/atf/dist

2011-11-16 Thread Julio Merino

On 11/16/11 1:51 PM, Christos Zoulas wrote:

In article4ec3f8f7.8020...@netbsd.org,
Julio Merinoj...@netbsd.org  wrote:

On 11/16/11 12:46 PM, Christos Zoulas wrote:

Module Name:src
Committed By:   christos
Date:   Wed Nov 16 17:46:16 UTC 2011

Modified Files:
src/external/bsd/atf/dist/atf-c++/detail: text.cpp text.hpp
src/external/bsd/atf/dist/atf-run: requirements.cpp test-program.cpp

Log Message:
PR/45619: jmmv: Allow atf tests to request a minimum amount of memory


Could you run intrusive changes to atf for review please?

The current changes are incomplete and inappropriate, so they are going
to make integration upstream a pain.


Well, there is really no portable way to find the total available memory of
the system that I know of and I did not want to add ifdefs or machinery
to get this working on other OS's. If you know otherwise, feel free to fix it.


I know there is no portable way, but at least we can default to do 
nothing if this is not supported.  It's better than not building :-P



The changes are really small and they are additions only. I fail to see how
it is going to be difficult to integrate.


Yes, they are small because this is just one change.  But more may come. 
 I'll then have to go and rewrite all these local changes with 
portability in mind.  When the time to integrate a new release comes, 
I'll have to mess around with lots merge conflicts, because the upstream 
code will look nothing like what we have (hence why I asked for this to 
be reviewed first).


Of course, if we assume I keep good track of all local changes and 
integrate them upstream (I do try), I could ignore the local changes 
altogether during the conflicts resolution and use the upstream 
copies... but that's... dangerous because I can miss some little thing. 
 Specially if the local changes are made without tests, because then 
it'll be impossible for me to spot when such changes are not preserved.


Re: CVS commit: src/external/bsd/atf/dist

2011-11-16 Thread Christos Zoulas
In article 4ec40d98.4070...@netbsd.org,
Julio Merino  j...@netbsd.org wrote:

I know there is no portable way, but at least we can default to do 
nothing if this is not supported.  It's better than not building :-P

Oh, I can arrange that. #ifdef __NetBSD__ :-)
But in my view this is worse...

Yes, they are small because this is just one change.  But more may come. 
  I'll then have to go and rewrite all these local changes with 
portability in mind.  When the time to integrate a new release comes, 
I'll have to mess around with lots merge conflicts, because the upstream 
code will look nothing like what we have (hence why I asked for this to 
be reviewed first).

Well, this is the world we live in. Next time be the one to upgrade gdb
or binutils or ssh and have to deal with 10-50K lines of diffs.
You will not be complaining about a 100 line conflict after that :-)

Of course, if we assume I keep good track of all local changes and 
integrate them upstream (I do try), I could ignore the local changes 
altogether during the conflicts resolution and use the upstream 
copies... but that's... dangerous because I can miss some little thing. 
  Specially if the local changes are made without tests, because then 
it'll be impossible for me to spot when such changes are not preserved.

I understand, and when I get more time I will write tests. I just wanted
to stop our tests from failing in a non-hacky way quickly and I have
achieved my goal with less than 30 minutes of coding.

christos



Re: CVS commit: src/external/bsd/atf/dist

2011-11-16 Thread Julio Merino

On 11/16/11 3:11 PM, Christos Zoulas wrote:

In article4ec40d98.4070...@netbsd.org,
Julio Merinoj...@netbsd.org  wrote:


I know there is no portable way, but at least we can default to do
nothing if this is not supported.  It's better than not building :-P


Oh, I can arrange that. #ifdef __NetBSD__ :-)
But in my view this is worse...


Yeah, leave it as is for now.  I'll have to do something similar anyway 
though, but if I can implement the code for the most common systems, 
that's probably good enough.



Yes, they are small because this is just one change.  But more may come.
  I'll then have to go and rewrite all these local changes with
portability in mind.  When the time to integrate a new release comes,
I'll have to mess around with lots merge conflicts, because the upstream
code will look nothing like what we have (hence why I asked for this to
be reviewed first).


Well, this is the world we live in. Next time be the one to upgrade gdb
or binutils or ssh and have to deal with 10-50K lines of diffs.
You will not be complaining about a 100 line conflict after that :-)


That's true... but do we have a chance of getting things integrated into 
gdb quickly and/or on our own to prevent those 10-50K diffs?  For atf 
we do ;-)  (OK, I can definitely try to improve on the quickly 
side...)  Anyway, just something to keep in mind.


Still, I'd appreciate running changes for review at least.  I'm open to 
overlooking details like these that don't fit upstream if that's going 
to make things easier temporarily.


CVS commit: src/external/bsd/atf/dist

2011-11-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov 16 17:46:16 UTC 2011

Modified Files:
src/external/bsd/atf/dist/atf-c++/detail: text.cpp text.hpp
src/external/bsd/atf/dist/atf-run: requirements.cpp test-program.cpp

Log Message:
PR/45619: jmmv: Allow atf tests to request a minimum amount of memory


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/atf/dist/atf-c++/detail/text.cpp \
src/external/bsd/atf/dist/atf-c++/detail/text.hpp
cvs rdiff -u -r1.1.1.4 -r1.2 \
src/external/bsd/atf/dist/atf-run/requirements.cpp
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/atf/dist/atf-run/test-program.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-c++/detail/text.cpp
diff -u src/external/bsd/atf/dist/atf-c++/detail/text.cpp:1.1.1.1 src/external/bsd/atf/dist/atf-c++/detail/text.cpp:1.2
--- src/external/bsd/atf/dist/atf-c++/detail/text.cpp:1.1.1.1	Wed Oct 20 05:14:21 2010
+++ src/external/bsd/atf/dist/atf-c++/detail/text.cpp	Wed Nov 16 12:46:16 2011
@@ -33,6 +33,7 @@ extern C {
 
 #include cctype
 #include cstring
+#include cstdlib
 
 extern C {
 #include ../../atf-c/error.h
@@ -133,3 +134,12 @@ impl::to_bool(const std::string str)
 
 return b;
 }
+
+int64_t
+impl::to_number(const std::string str)
+{
+	int64_t num;
+	::dehumanize_number(str.c_str(), num);
+	return num;
+}
+
Index: src/external/bsd/atf/dist/atf-c++/detail/text.hpp
diff -u src/external/bsd/atf/dist/atf-c++/detail/text.hpp:1.1.1.1 src/external/bsd/atf/dist/atf-c++/detail/text.hpp:1.2
--- src/external/bsd/atf/dist/atf-c++/detail/text.hpp:1.1.1.1	Wed Oct 20 05:14:21 2010
+++ src/external/bsd/atf/dist/atf-c++/detail/text.hpp	Wed Nov 16 12:46:16 2011
@@ -106,6 +106,13 @@ bool to_bool(const std::string);
 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

Index: src/external/bsd/atf/dist/atf-run/requirements.cpp
diff -u src/external/bsd/atf/dist/atf-run/requirements.cpp:1.1.1.4 src/external/bsd/atf/dist/atf-run/requirements.cpp:1.2
--- src/external/bsd/atf/dist/atf-run/requirements.cpp:1.1.1.4	Tue Jun 14 11:23:24 2011
+++ src/external/bsd/atf/dist/atf-run/requirements.cpp	Wed Nov 16 12:46:16 2011
@@ -29,6 +29,14 @@
 
 // TODO: We probably don't want to raise std::runtime_error for the errors
 // detected in this file.
+extern C {
+#include sys/param.h
+#include sys/sysctl.h
+};
+
+#include cstdlib
+#include cstring
+#include cerrno
 #include stdexcept
 
 #include atf-c++/config.hpp
@@ -185,6 +193,36 @@ check_user(const std::string user, cons
  require.user);
 }
 
+static
+std::string
+check_memory(const std::string memory)
+{
+// Make sure we have enough memory 
+int64_t memneed = atf::text::to_number(memory);
+int64_t memavail;
+size_t len = sizeof(memavail);
+
+if (::sysctlbyname(hw.usermem64, memavail, len, NULL, 0) == -1) {
+	const char *e = ::strerror(errno);
+	std::stringstream ss;
+	ss  sysctl hw.usermem64 failed (  e  );
+	return ss.str();
+}
+
+if (memavail  memneed) {
+	char avail[6], need[6];
+	::humanize_number(avail, sizeof(avail), memavail, , HN_AUTOSCALE,
+	HN_B | HN_NOSPACE);
+	::humanize_number(need, sizeof(need), memneed, , HN_AUTOSCALE,
+	HN_B | HN_NOSPACE);
+	std::stringstream ss;
+	ss  available memory (  avail 
+	) is less than required (  need  );
+	return ss.str();
+}
+return ;
+}
+
 } // anonymous namespace
 
 std::string
@@ -211,6 +249,8 @@ impl::check_requirements(const atf::test
 failure_reason = check_progs(value);
 else if (name == require.user)
 failure_reason = check_user(value, config);
+	else if (name == require.memory)
+failure_reason = check_memory(value);
 else {
 // Unknown require.* properties are forbidden by the
 // application/X-atf-tp parser.

Index: src/external/bsd/atf/dist/atf-run/test-program.cpp
diff -u src/external/bsd/atf/dist/atf-run/test-program.cpp:1.10 src/external/bsd/atf/dist/atf-run/test-program.cpp:1.11
--- src/external/bsd/atf/dist/atf-run/test-program.cpp:1.10	Wed Jun 15 04:48:36 2011
+++ src/external/bsd/atf/dist/atf-run/test-program.cpp	Wed Nov 16 12:46:16 2011
@@ -418,6 +418,7 @@ detail::atf_tp_reader::validate_and_inse
 
 const std::string ident_regex = ^[_A-Za-z0-9]+$;
 const std::string integer_regex = ^[0-9]+$;
+const std::string memory_regex = ^[0-9]+[KMGT]$;
 
 if (name == descr) {
 // Any non-empty value is valid.
@@ -438,6 +439,12 @@ detail::atf_tp_reader::validate_and_inse
 } else if (name == require.machine) {
 

CVS commit: src/external/bsd/atf/dist

2011-11-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov 16 17:46:16 UTC 2011

Modified Files:
src/external/bsd/atf/dist/atf-c++/detail: text.cpp text.hpp
src/external/bsd/atf/dist/atf-run: requirements.cpp test-program.cpp

Log Message:
PR/45619: jmmv: Allow atf tests to request a minimum amount of memory


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/atf/dist/atf-c++/detail/text.cpp \
src/external/bsd/atf/dist/atf-c++/detail/text.hpp
cvs rdiff -u -r1.1.1.4 -r1.2 \
src/external/bsd/atf/dist/atf-run/requirements.cpp
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/atf/dist/atf-run/test-program.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/external/bsd/atf/dist/atf-c

2011-11-09 Thread Julio Merino

On 11/9/11 9:42 AM, Christos Zoulas wrote:

Module Name:src
Committed By:   christos
Date:   Wed Nov  9 14:42:43 UTC 2011

Modified Files:
src/external/bsd/atf/dist/atf-c: tc.c

Log Message:
need || instead of


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/atf/dist/atf-c/tc.c


Thanks; it seems to work now.


CVS commit: src/external/bsd/atf/dist/atf-c

2011-11-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov  9 14:42:43 UTC 2011

Modified Files:
src/external/bsd/atf/dist/atf-c: tc.c

Log Message:
need || instead of 


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/atf/dist/atf-c/tc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/atf/dist/atf-c/tc.c
diff -u src/external/bsd/atf/dist/atf-c/tc.c:1.10 src/external/bsd/atf/dist/atf-c/tc.c:1.11
--- src/external/bsd/atf/dist/atf-c/tc.c:1.10	Tue Nov  8 15:25:14 2011
+++ src/external/bsd/atf/dist/atf-c/tc.c	Wed Nov  9 09:42:42 2011
@@ -164,7 +164,7 @@ write_resfile(const int fd, const char *
 ssize_t ret;
 int count = 0;
 
-INV(arg == -1  reason != NULL);
+INV(arg == -1 || reason != NULL);
 
 iov[count].iov_base = __UNCONST(result);
 iov[count++].iov_len = strlen(result);



Re: CVS commit: src/external/bsd/atf/dist/atf-c

2011-11-08 Thread Christos Zoulas
In article 2007202432.ga7...@britannica.bec.de,
Joerg Sonnenberger  jo...@britannica.bec.de wrote:
On Mon, Nov 07, 2011 at 04:06:30PM +, Christos Zoulas wrote:
 Well, I tried to print the failing pattern in t_expand, and it silently
 got truncated. dprintf(3) has been part of TOG since 2006:
 (http://pubs.opengroup.org/onlinepubs/9699919799/functions/dprintf.html)
 So it would be preferable to implement it in terms of asprintf/write +
 or snprintf/malloc/write or even fdopen/fprintf instead of open coding it.

From reading the patch, there are three different brances, right?
Why don't you use writev for this with up to 6 elements in the vector?

Done.

christos



Re: CVS commit: src/external/bsd/atf/dist/atf-c

2011-11-08 Thread Julio Merino
On 11/8/11 3:25 PM, Christos Zoulas wrote:
 In article 2007202432.ga7...@britannica.bec.de,
 Joerg Sonnenberger  jo...@britannica.bec.de wrote:
 On Mon, Nov 07, 2011 at 04:06:30PM +, Christos Zoulas wrote:
 Well, I tried to print the failing pattern in t_expand, and it silently
 got truncated. dprintf(3) has been part of TOG since 2006:
 (http://pubs.opengroup.org/onlinepubs/9699919799/functions/dprintf.html)
 So it would be preferable to implement it in terms of asprintf/write +
 or snprintf/malloc/write or even fdopen/fprintf instead of open coding it.

From reading the patch, there are three different brances, right?
 Why don't you use writev for this with up to 6 elements in the vector?
 
 Done.

Did you even run any tests after doing this?

This is broken.  The assertion you added triggers immediately.

-- 
Julio Merino / @jmmv


  1   2   3   >