aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJiri Vanek <[email protected]>2013-10-25 12:19:15 +0200
committerJiri Vanek <[email protected]>2013-10-25 12:19:15 +0200
commit7a81d6c45f69526857236d9d9d985602096caca6 (patch)
tree2abd5f549a322d82e36a75b0576249ddc45ef037 /tests
parent2783ad50d2746de5a8aaf302f11e24b11088eaef (diff)
Plugin debug can now be controlled from itw_settings, in same way java side. For now ICEDTEAPLUGIN_DEBUG on the debug in same way as deployment.log itw-settings property. Individual logging streams are controlled by deployment.log.{headers,file,stdstreams,system} System and file are not yet fully done (same as java side in this moment). Streams are true, all others false by default.
* plugin/icedteanp/IcedTeaNPPlugin.cc: initialized variables new bool variables (debug_initiated), (plugin_debug_headers), (plugin_debug_to_file), (plugin_debug_to_system) as false and (plugin_debug_to_streams) as true. * plugin/icedteanp/IcedTeaNPPlugin.h: above variables declared as extern * plugin/icedteanp/IcedTeaParseProperties.cc: initialization of (default_file_ITW_deploy_props_name) and (custom_jre_key) moved here from IcedTeaNPPlugin.h. New method (read_bool_property) and its more concrete shortcuts (is_debug_on) (is_debug_header_on) (is_logging_to_file) (is_logging_to_stds) (is_logging_to_system) implemented to access properties. * plugin/icedteanp/IcedTeaParseProperties.h: above methods declared. * plugin/icedteanp/IcedTeaPluginUtils.h: (PLUGIN_{ERROR,DEBUG}) methods adapted headers/debug/streams logic as described in title. Headers made more informative (like java side) * tests/cpp-unit-tests/IcedTeaPluginUtilsTest.cc: TEST(PLUGIN_DEBUG_ERROR_PROFILING_debug_on) extended to TEST(PLUGIN_DEBUG_ERROR_PROFILING_debug_on_headers_off).TEST(PLUGIN_DEBUG_ERROR_PROFILING_debug_off) extended to TEST(PLUGIN_DEBUG_ERROR_PROFILING_debug_off_headers_off), and new testsTEST(PLUGIN_DEBUG_ERROR_PROFILING_debug_on_headers_on) TEST(PLUGIN_DEBUG_ERROR_PROFILING_debug_off_headers_on) (100x slower then without headers)
Diffstat (limited to 'tests')
-rw-r--r--tests/cpp-unit-tests/IcedTeaPluginUtilsTest.cc30
1 files changed, 28 insertions, 2 deletions
diff --git a/tests/cpp-unit-tests/IcedTeaPluginUtilsTest.cc b/tests/cpp-unit-tests/IcedTeaPluginUtilsTest.cc
index e17caa5..abb0b19 100644
--- a/tests/cpp-unit-tests/IcedTeaPluginUtilsTest.cc
+++ b/tests/cpp-unit-tests/IcedTeaPluginUtilsTest.cc
@@ -181,15 +181,41 @@ void doDebugErrorRun() {
fprintf (stdout, "PLUGIN_ERROR %d\n", time_spent2);
}
-TEST(PLUGIN_DEBUG_ERROR_PROFILING_debug_on) {
+TEST(PLUGIN_DEBUG_ERROR_PROFILING_debug_on_headers_off) {
bool plugin_debug_backup = plugin_debug;
+ bool plugin_debug_headers_backup = plugin_debug_headers;
plugin_debug = true;
doDebugErrorRun();
plugin_debug = plugin_debug_backup;
+ plugin_debug_headers = plugin_debug_headers_backup;
}
-TEST(PLUGIN_DEBUG_ERROR_PROFILING_debug_off) {
+TEST(PLUGIN_DEBUG_ERROR_PROFILING_debug_off_headers_off) {
bool plugin_debug_backup = plugin_debug;
+ bool plugin_debug_headers_backup = plugin_debug_headers;
plugin_debug = false;
doDebugErrorRun();
plugin_debug = plugin_debug_backup;
+ plugin_debug_headers = plugin_debug_headers_backup;
}
+
+
+TEST(PLUGIN_DEBUG_ERROR_PROFILING_debug_on_headers_on) {
+ bool plugin_debug_backup = plugin_debug;
+ bool plugin_debug_headers_backup = plugin_debug_headers;
+ plugin_debug = true;
+ plugin_debug_headers = true;
+ doDebugErrorRun();
+ plugin_debug = plugin_debug_backup;
+ plugin_debug_headers = plugin_debug_headers_backup;
+}
+
+TEST(PLUGIN_DEBUG_ERROR_PROFILING_debug_off_headers_on) {
+ bool plugin_debug_backup = plugin_debug;
+ bool plugin_debug_headers_backup = plugin_debug_headers;
+ plugin_debug = false;
+ plugin_debug_headers = true;
+ doDebugErrorRun();
+ plugin_debug = plugin_debug_backup;
+ plugin_debug_headers = plugin_debug_headers_backup;
+}
+