Warmcat homepage andy@warmcat.com
libwebsockets
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1756843289, "reponame":"openssl", "desc":"OpenSSL", "owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://warmcat.com/repo/openssl", "f":3, "items": [ {"schema":"libjg2-1", "cid":"c89abca67c30e170b596b3c86ac005e8", "commit": {"type":"commit", "time": 1453820302, "time_ofs": 60, "oid_tree": { "oid": "54b4a55aa0e9ee24a135f7dd3b8410cb4da8121f", "alias": []}, "oid":{ "oid": "a00c84f6c656cdadbaf8bec6149189ba1bd37aee", "alias": []}, "msg": "Have OpenSSL::Test handle perl scripts like any program", "sig_commit": { "git_time": { "time": 1453820302, "offset": 60 }, "name": "Richard Levitte", "email": "levitte@openssl.org", "md5": "b737120f0642a6a5c30c6291e6170c77" }, "sig_author": { "git_time": { "time": 1453816641, "offset": 60 }, "name": "Richard Levitte", "email": "levitte@openssl.org", "md5": "b737120f0642a6a5c30c6291e6170c77" }}, "body": "Have OpenSSL::Test handle perl scripts like any program\n\nSince we're building some of our perl scripts and the result might not\nend up in apps/ (*), we may need to treat them like the compile\nprograms we use for testing.\n\nThis introduces perlapp() and perltest(), which behave like app() and\ntest(), but will add the perl executable in the command line.\n\n-----\n\n(*) For example, with a mk1mf build, the result will end up in $(BIN_D)\n\nReviewed-by: Matt Caswell \u003cmatt@openssl.org\u003e\n" , "diff": "diff --git a/test/testlib/OpenSSL/Test.pm b/test/testlib/OpenSSL/Test.pm\nindex e4218c5..491984c 100644\n--- a/test/testlib/OpenSSL/Test.pm\n+++ b/test/testlib/OpenSSL/Test.pm\n@@ -9,7 +9,7 @@ use Exporter;\n use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);\n $VERSION \u003d \u00220.7\u0022;\n @ISA \u003d qw(Exporter);\n-@EXPORT \u003d (@Test::More::EXPORT, qw(setup indir app test run));\n+@EXPORT \u003d (@Test::More::EXPORT, qw(setup indir app perlapp test perltest run));\n @EXPORT_OK \u003d (@Test::More::EXPORT_OK, qw(top_dir top_file pipe with cmdstr\n quotify));\n \n@@ -76,6 +76,9 @@ my %hooks \u003d (\n \n );\n \n+# Debug flag, to be set manually when needed\n+my $debug \u003d 0;\n+\n # Declare some utility functions that are defined at the end\n sub top_file;\n sub top_dir;\n@@ -224,6 +227,13 @@ string PATH, I\u003cor\u003e, if the value is C\u003cundef\u003e, C\u003c/dev/null\u003e or similar.\n \n \u003dback\n \n+\u003ditem B\u003cperlapp ARRAYREF, OPTS\u003e\n+\n+\u003ditem B\u003cperltest ARRAYREF, OPTS\u003e\n+\n+Both these functions function the same way as B\u003capp\u003e and B\u003ctest\u003e, except\n+that they expect the command to be a perl script.\n+\n \u003dback\n \n \u003dcut\n@@ -242,6 +252,20 @@ sub test {\n \t\t return __build_cmd($num, \u005c\u0026__test_file, $cmd, %opts); }\n }\n \n+sub perlapp {\n+ my $cmd \u003d shift;\n+ my %opts \u003d @_;\n+ return sub { my $num \u003d shift;\n+\t\t return __build_cmd($num, \u005c\u0026__perlapps_file, $cmd, %opts); }\n+}\n+\n+sub perltest {\n+ my $cmd \u003d shift;\n+ my %opts \u003d @_;\n+ return sub { my $num \u003d shift;\n+\t\t return __build_cmd($num, \u005c\u0026__perltest_file, $cmd, %opts); }\n+}\n+\n \u003dover 4\n \n \u003ditem B\u003crun CODEREF, OPTS\u003e\n@@ -587,6 +611,13 @@ sub __test_file {\n return catfile($directories{TEST},@_,$f);\n }\n \n+sub __perltest_file {\n+ BAIL_OUT(\u0022Must run setup() first\u0022) if (! $test_name);\n+\n+ my $f \u003d pop;\n+ return ($^X, catfile($directories{TEST},@_,$f));\n+}\n+\n sub __apps_file {\n BAIL_OUT(\u0022Must run setup() first\u0022) if (! $test_name);\n \n@@ -594,6 +625,13 @@ sub __apps_file {\n return catfile($directories{APPS},@_,$f);\n }\n \n+sub __perlapps_file {\n+ BAIL_OUT(\u0022Must run setup() first\u0022) if (! $test_name);\n+\n+ my $f \u003d pop;\n+ return ($^X, catfile($directories{APPS},@_,$f));\n+}\n+\n sub __results_file {\n BAIL_OUT(\u0022Must run setup() first\u0022) if (! $test_name);\n \n@@ -650,7 +688,7 @@ sub __cwd {\n \t}\n }\n \n- if (0) {\n+ if ($debug) {\n \tprint STDERR \u0022DEBUG: __cwd(), directories and files:\u005cn\u0022;\n \tprint STDERR \u0022 \u005c$directories{TEST} \u003d \u005c\u0022$directories{TEST}\u005c\u0022\u005cn\u0022;\n \tprint STDERR \u0022 \u005c$directories{RESULTS} \u003d \u005c\u0022$directories{RESULTS}\u005c\u0022\u005cn\u0022;\n@@ -682,13 +720,22 @@ sub __fixup_cmd {\n }\n \n # We test both with and without extension. The reason\n- # is that we might, for example, be passed a Perl script\n- # ending with .pl...\n- my $file \u003d \u0022$prog$ext\u0022;\n- if ( -x $file ) {\n-\treturn $prefix.$file;\n- } elsif ( -f $prog ) {\n-\treturn $prog;\n+ # is that we might be passed a complete file spec, with\n+ # extension.\n+ if ( ! -x $prog ) {\n+\tmy $prog \u003d \u0022$prog$ext\u0022;\n+\tif ( ! -x $prog ) {\n+\t $prog \u003d undef;\n+\t}\n+ }\n+\n+ if (defined($prog)) {\n+\t# Make sure to quotify the program file on platforms that may\n+\t# have spaces or similar in their path name.\n+\t# To our knowledge, VMS is the exception where quotifying should\n+\t# never happem.\n+\t($prog) \u003d quotify($prog) unless $^O eq \u0022VMS\u0022;\n+\treturn $prefix.$prog;\n }\n \n print STDERR \u0022$prog not found\u005cn\u0022;\n@@ -702,8 +749,22 @@ sub __build_cmd {\n my $path_builder \u003d shift;\n # Make a copy to not destroy the caller's array\n my @cmdarray \u003d ( @{$_[0]} ); shift;\n- my $cmd \u003d __fixup_cmd($path_builder-\u003e(shift @cmdarray));\n- my @args \u003d @cmdarray;\n+\n+ # We do a little dance, as $path_builder might return a list of\n+ # more than one. If so, only the first is to be considered a\n+ # program to fix up, the rest is part of the arguments. This\n+ # happens for perl scripts, where $path_builder will return\n+ # a list of two, $^X and the script name\n+ my @prog \u003d ($path_builder-\u003e(shift @cmdarray));\n+ my $cmd \u003d __fixup_cmd(shift @prog);\n+ if (@prog) {\n+\tif ( ! -f $prog[0] ) {\n+\t print STDERR \u0022$prog[0] not found\u005cn\u0022;\n+\t $cmd \u003d undef;\n+\t}\n+ }\n+ my @args \u003d (@prog, @cmdarray);\n+\n my %opts \u003d @_;\n \n return () if !$cmd;\n@@ -730,6 +791,11 @@ sub __build_cmd {\n my $display_cmd \u003d \u0022$cmd$arg_str$stdin$stdout$stderr\u0022;\n $cmd .\u003d \u0022$arg_str$stdin$stdout 2\u003e $errlog\u0022;\n \n+ if ($debug) {\n+\tprint STDERR \u0022DEBUG[__build_cmd]: \u005c$cmd \u003d \u005c\u0022$cmd\u005c\u0022\u005cn\u0022;\n+\tprint STDERR \u0022DEBUG[__build_cmd]: \u005c$display_cmd \u003d \u005c\u0022$display_cmd\u005c\u0022\u005cn\u0022;\n+ }\n+\n return ($cmd, $display_cmd, $errlog \u003d\u003e $saved_stderr);\n }\n \n","s":{"c":1756843289,"u": 2569}} ],"g": 3563,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}