Author: tim.bunce
Date: Wed Mar 11 02:37:08 2009
New Revision: 713
Modified:
trunk/NYTProf.xs
trunk/t/00-load.t
trunk/t/92-file_port.t
Log:
Add NYTP_DEFAULT_COMPRESSION constant to application can tell if zlib was
compiled in.
Report NYTP_DEFAULT_COMPRESSION in t/00-load.t.
Make t/92-file_port.t skip_all message consistent with other tests.
Modified: trunk/NYTProf.xs
==============================================================================
--- trunk/NYTProf.xs (original)
+++ trunk/NYTProf.xs Wed Mar 11 02:37:08 2009
@@ -64,6 +64,9 @@
#ifdef HAS_ZLIB
#include <zlib.h>
+#define default_compression_level 6
+#else
+#define default_compression_level 0
#endif
#define NYTP_START_NO 0
@@ -233,11 +236,7 @@
#define use_db_sub options[6].option_value
{ "use_db_sub", 0 },
#define compression_level options[7].option_value
-#ifdef HAS_ZLIB
- { "compress", 6 },
-#else
- { "compress", 0 },
-#endif
+ { "compress", default_compression_level },
#define profile_clock options[8].option_value
{ "clock", -1 },
#define profile_stmts options[9].option_value
@@ -3814,6 +3813,8 @@
newCONSTSUB(stash, "NYTP_SCi_INCL_STIME",
newSViv(NYTP_SCi_INCL_STIME));
newCONSTSUB(stash, "NYTP_SCi_RECI_RTIME",
newSViv(NYTP_SCi_RECI_RTIME));
newCONSTSUB(stash, "NYTP_SCi_REC_DEPTH",
newSViv(NYTP_SCi_REC_DEPTH));
+ /* others */
+ newCONSTSUB(stash, "NYTP_DEFAULT_COMPRESSION",
newSViv(default_compression_level));
}
Modified: trunk/t/00-load.t
==============================================================================
--- trunk/t/00-load.t (original)
+++ trunk/t/00-load.t Wed Mar 11 02:37:08 2009
@@ -1,7 +1,11 @@
-use Test::More tests => 1;
+use Test::More tests => 2;
use Config;
use_ok( 'Devel::NYTProf::Core' );
diag( "Testing Devel::NYTProf $Devel::NYTProf::Core::VERSION on perl $]
$Config{archname}" );
+
+use_ok( 'Devel::NYTProf::Constants', qw(NYTP_DEFAULT_COMPRESSION) );
+
+diag( sprintf "default compression level is %d",
NYTP_DEFAULT_COMPRESSION() );
Modified: trunk/t/92-file_port.t
==============================================================================
--- trunk/t/92-file_port.t (original)
+++ trunk/t/92-file_port.t Wed Mar 11 02:37:08 2009
@@ -5,7 +5,7 @@
use Test::More;
-plan skip_all => "This currently a developer-only test"
+plan skip_all => "Currently a developer-only test"
unless -d '.svn';
eval "require Test::Portability::Files;";
--~--~---------~--~----~------------~-------~--~----~
You've received this message because you are subscribed to
the Devel::NYTProf Development User group.
Group hosted at: http://groups.google.com/group/develnytprof-dev
Project hosted at: http://perl-devel-nytprof.googlecode.com
CPAN distribution: http://search.cpan.org/dist/Devel-NYTProf
To post, email: [email protected]
To unsubscribe, email: [email protected]
-~----------~----~----~----~------~----~------~--~---