From: Benjamin Kosnik Date: Mon, 5 May 2008 17:22:02 +0000 (+0000) Subject: testsuite_visualization.h: Move contents into... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1d3d8fff365549b74d58dde19588759953346920;p=gcc.git testsuite_visualization.h: Move contents into... 2008-05-05 Benjamin Kosnik * testsuite/util/testsuite_visualization.h: Move contents into... * testsuite/util/testsuite_performance.h: ...here. * testsuite/util/testsuite_common_types.h: Move performance-related test infrastructure into testsuite_performance. * testsuite/performance/25_algorithms/search_n.cc: Fix includes. * testsuite/performance/23_containers/find/map.cc: Same. * testsuite/performance/23_containers/create/map.cc: Same. * testsuite/performance/23_containers/insert_erase/associative.cc: Same. * testsuite/performance/23_containers/insert/sequence.cc: Same. * testsuite/performance/23_containers/insert/associative.cc: Same. * testsuite/performance/23_containers/create_from_sorted/set.cc: Same. * testsuite/performance/23_containers/index/map.cc: Same. * testsuite/performance/23_containers/insert_from_sorted/set.cc: Same. * testsuite/performance/23_containers/create_sort/list.cc: Same. * testsuite/performance/23_containers/sort_search/list.cc: Same. * testsuite/performance/23_containers/producer_consumer/sequence.cc: Same. * testsuite/performance/23_containers/producer_consumer/associative.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. From-SVN: r134949 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 864a580fcd2..ff9ac66e394 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,29 @@ +2008-05-05 Benjamin Kosnik + + * testsuite/util/testsuite_visualization.h: Move contents into... + * testsuite/util/testsuite_performance.h: ...here. + * testsuite/util/testsuite_common_types.h: Move + performance-related test infrastructure into + testsuite_performance. + * testsuite/performance/25_algorithms/search_n.cc: Fix includes. + * testsuite/performance/23_containers/find/map.cc: Same. + * testsuite/performance/23_containers/create/map.cc: Same. + * testsuite/performance/23_containers/insert_erase/associative.cc: Same. + * testsuite/performance/23_containers/insert/sequence.cc: Same. + * testsuite/performance/23_containers/insert/associative.cc: Same. + * testsuite/performance/23_containers/create_from_sorted/set.cc: Same. + * testsuite/performance/23_containers/index/map.cc: Same. + * testsuite/performance/23_containers/insert_from_sorted/set.cc: Same. + * testsuite/performance/23_containers/create_sort/list.cc: Same. + * testsuite/performance/23_containers/sort_search/list.cc: Same. + * testsuite/performance/23_containers/producer_consumer/sequence.cc: + Same. + * testsuite/performance/23_containers/producer_consumer/associative.cc: + Same. + + * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. + * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. + 2008-05-05 Benjamin Kosnik * 20_util/make_signed/requirements/typedefs-1.cc: Correct requirements. diff --git a/libstdc++-v3/testsuite/29_atomics/atomic/cons/assign_neg.cc b/libstdc++-v3/testsuite/29_atomics/atomic/cons/assign_neg.cc index 435309860a3..a22a558f26e 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic/cons/assign_neg.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic/cons/assign_neg.cc @@ -38,7 +38,7 @@ int main() return 0; } -// { dg-error "within this context" "" { target *-*-* } 310 } +// { dg-error "within this context" "" { target *-*-* } 309 } // { dg-error "is private" "" { target *-*-* } 1750 } // { dg-error "is private" "" { target *-*-* } 1782 } // { dg-error "is private" "" { target *-*-* } 1799 } diff --git a/libstdc++-v3/testsuite/29_atomics/atomic/cons/copy_neg.cc b/libstdc++-v3/testsuite/29_atomics/atomic/cons/copy_neg.cc index 011933a8eb8..49125182ebb 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic/cons/copy_neg.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic/cons/copy_neg.cc @@ -38,7 +38,7 @@ int main() return 0; } -// { dg-error "within this context" "" { target *-*-* } 333 } +// { dg-error "within this context" "" { target *-*-* } 332 } // { dg-error "is private" "" { target *-*-* } 1749 } // { dg-error "is private" "" { target *-*-* } 1781 } // { dg-error "is private" "" { target *-*-* } 1798 } diff --git a/libstdc++-v3/testsuite/performance/23_containers/create/map.cc b/libstdc++-v3/testsuite/performance/23_containers/create/map.cc index 5049e1a1ff5..1ec20613a3a 100644 --- a/libstdc++-v3/testsuite/performance/23_containers/create/map.cc +++ b/libstdc++-v3/testsuite/performance/23_containers/create/map.cc @@ -27,7 +27,7 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -#include +#include template void diff --git a/libstdc++-v3/testsuite/performance/23_containers/create_from_sorted/set.cc b/libstdc++-v3/testsuite/performance/23_containers/create_from_sorted/set.cc index 97ea3af117a..c9259c0919c 100644 --- a/libstdc++-v3/testsuite/performance/23_containers/create_from_sorted/set.cc +++ b/libstdc++-v3/testsuite/performance/23_containers/create_from_sorted/set.cc @@ -25,7 +25,7 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -#include +#include template void diff --git a/libstdc++-v3/testsuite/performance/23_containers/create_sort/list.cc b/libstdc++-v3/testsuite/performance/23_containers/create_sort/list.cc index 7a47f32b2ec..063075f3a97 100644 --- a/libstdc++-v3/testsuite/performance/23_containers/create_sort/list.cc +++ b/libstdc++-v3/testsuite/performance/23_containers/create_sort/list.cc @@ -25,7 +25,7 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -#include +#include template void diff --git a/libstdc++-v3/testsuite/performance/23_containers/find/map.cc b/libstdc++-v3/testsuite/performance/23_containers/find/map.cc index e6c2c79a7fc..6d09d030a76 100644 --- a/libstdc++-v3/testsuite/performance/23_containers/find/map.cc +++ b/libstdc++-v3/testsuite/performance/23_containers/find/map.cc @@ -27,7 +27,7 @@ // 2004-03-11 Dhruv Matani -#include +#include template void diff --git a/libstdc++-v3/testsuite/performance/23_containers/index/map.cc b/libstdc++-v3/testsuite/performance/23_containers/index/map.cc index 386890d90ea..e08b7d8d4c5 100644 --- a/libstdc++-v3/testsuite/performance/23_containers/index/map.cc +++ b/libstdc++-v3/testsuite/performance/23_containers/index/map.cc @@ -25,7 +25,7 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -#include +#include // libstdc++/13823 recast for this testing framework template diff --git a/libstdc++-v3/testsuite/performance/23_containers/insert/associative.cc b/libstdc++-v3/testsuite/performance/23_containers/insert/associative.cc index b3f8f71327c..a047f9933ae 100644 --- a/libstdc++-v3/testsuite/performance/23_containers/insert/associative.cc +++ b/libstdc++-v3/testsuite/performance/23_containers/insert/associative.cc @@ -25,7 +25,7 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -#include +#include template void diff --git a/libstdc++-v3/testsuite/performance/23_containers/insert/sequence.cc b/libstdc++-v3/testsuite/performance/23_containers/insert/sequence.cc index 7023332e5e9..41faac12eb9 100644 --- a/libstdc++-v3/testsuite/performance/23_containers/insert/sequence.cc +++ b/libstdc++-v3/testsuite/performance/23_containers/insert/sequence.cc @@ -25,7 +25,7 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -#include +#include template void diff --git a/libstdc++-v3/testsuite/performance/23_containers/insert_erase/associative.cc b/libstdc++-v3/testsuite/performance/23_containers/insert_erase/associative.cc index ee48ce2a708..f3a29d07a02 100644 --- a/libstdc++-v3/testsuite/performance/23_containers/insert_erase/associative.cc +++ b/libstdc++-v3/testsuite/performance/23_containers/insert_erase/associative.cc @@ -25,7 +25,7 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -#include +#include template void diff --git a/libstdc++-v3/testsuite/performance/23_containers/insert_from_sorted/set.cc b/libstdc++-v3/testsuite/performance/23_containers/insert_from_sorted/set.cc index 72b1921e697..201edd9d189 100644 --- a/libstdc++-v3/testsuite/performance/23_containers/insert_from_sorted/set.cc +++ b/libstdc++-v3/testsuite/performance/23_containers/insert_from_sorted/set.cc @@ -25,7 +25,7 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -#include +#include template void diff --git a/libstdc++-v3/testsuite/performance/23_containers/producer_consumer/associative.cc b/libstdc++-v3/testsuite/performance/23_containers/producer_consumer/associative.cc index 841cdf0477e..d0e1f2c6a8e 100644 --- a/libstdc++-v3/testsuite/performance/23_containers/producer_consumer/associative.cc +++ b/libstdc++-v3/testsuite/performance/23_containers/producer_consumer/associative.cc @@ -25,7 +25,7 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -#include +#include typedef int test_type; diff --git a/libstdc++-v3/testsuite/performance/23_containers/producer_consumer/sequence.cc b/libstdc++-v3/testsuite/performance/23_containers/producer_consumer/sequence.cc index 1590c974b47..80c200f0df4 100644 --- a/libstdc++-v3/testsuite/performance/23_containers/producer_consumer/sequence.cc +++ b/libstdc++-v3/testsuite/performance/23_containers/producer_consumer/sequence.cc @@ -25,7 +25,7 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -#include +#include typedef int test_type; diff --git a/libstdc++-v3/testsuite/performance/23_containers/sort_search/list.cc b/libstdc++-v3/testsuite/performance/23_containers/sort_search/list.cc index 14b42b4c009..71f66fde76a 100644 --- a/libstdc++-v3/testsuite/performance/23_containers/sort_search/list.cc +++ b/libstdc++-v3/testsuite/performance/23_containers/sort_search/list.cc @@ -25,7 +25,7 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -#include +#include template void diff --git a/libstdc++-v3/testsuite/performance/25_algorithms/search_n.cc b/libstdc++-v3/testsuite/performance/25_algorithms/search_n.cc index d316cf8ecb6..814de706799 100644 --- a/libstdc++-v3/testsuite/performance/25_algorithms/search_n.cc +++ b/libstdc++-v3/testsuite/performance/25_algorithms/search_n.cc @@ -53,7 +53,7 @@ main(void) array[i] = (match != 0) ? 1 : 0; if(--match < 0) match = rand() % (match_length - 1); } - test_container fcon(array, array + length); + __gnu_test::test_container fcon(array, array + length); start_counters(time, resource); for(int i = 0; i < 100; i++) search_n(fcon.begin(), fcon.end(), 10, 1); @@ -61,7 +61,7 @@ main(void) report_performance(__FILE__, "forward iterator", time, resource); clear_counters(time, resource); - test_container rcon(array, array + length); + __gnu_test::test_container rcon(array, array + length); start_counters(time, resource); for(int i = 0; i < 100; i++) search_n(rcon.begin(), rcon.end(), 10, 1); diff --git a/libstdc++-v3/testsuite/util/testsuite_common_types.h b/libstdc++-v3/testsuite/util/testsuite_common_types.h index bd9e76d4e2e..35bd907d8da 100644 --- a/libstdc++-v3/testsuite/util/testsuite_common_types.h +++ b/libstdc++-v3/testsuite/util/testsuite_common_types.h @@ -31,7 +31,6 @@ #ifndef _TESTSUITE_COMMON_TYPES_H #define _TESTSUITE_COMMON_TYPES_H 1 -#include #include #include @@ -347,122 +346,4 @@ namespace __gnu_test }; } // namespace __gnu_test - - -// Function template, function objects for the tests. -template - struct value_type : public std::pair - { - inline value_type& operator++() - { - ++this->second; - return *this; - } - - inline operator TestType() const { return this->second; } - }; - -template - void - do_loop(); - -template - void* - do_thread(void* p = NULL) - { - do_loop(); - return p; - } - -template - void - test_container(const char* filename) - { - using namespace __gnu_test; - time_counter time; - resource_counter resource; - { - start_counters(time, resource); - if (!Thread) - { - // No threads, so run 4x. - do_loop(); - } - else - { -#if defined (_GLIBCXX_GCC_GTHR_POSIX_H) && !defined (NOTHREAD) - pthread_t t1, t2, t3, t4; - pthread_create(&t1, 0, &do_thread, 0); - pthread_create(&t2, 0, &do_thread, 0); - pthread_create(&t3, 0, &do_thread, 0); - pthread_create(&t4, 0, &do_thread, 0); - - pthread_join(t1, NULL); - pthread_join(t2, NULL); - pthread_join(t3, NULL); - pthread_join(t4, NULL); -#endif - } - stop_counters(time, resource); - - // Detailed text data. - Container obj; - int status; - std::ostringstream comment; - comment << "type: " << abi::__cxa_demangle(typeid(obj).name(), - 0, 0, &status); - report_header(filename, comment.str()); - report_performance("", "", time, resource); - - // Detailed data for visualization. - std::string vizfilename(filename); - vizfilename += ".dat"; - write_viz_data(time, vizfilename.c_str()); - } - } - -template - struct test_sequence - { - test_sequence(const char* filename) : _M_filename(filename) { } - - template - void - operator()(Container) - { - const int i = 20000; - test_container(_M_filename); - } - - private: - const char* _M_filename; - }; - - -inline std::string::size_type -sequence_find_container(std::string& type) -{ - const std::string::size_type npos = std::string::npos; - std::string::size_type n1 = type.find("vector"); - std::string::size_type n2 = type.find("list"); - std::string::size_type n3 = type.find("deque"); - std::string::size_type n4 = type.find("string"); - - if (n1 != npos || n2 != npos || n3 != npos || n4 != npos) - return std::min(std::min(n1, n2), std::min(n3, n4)); - else - throw std::runtime_error("sequence_find_container not found"); -} - -inline std::string::size_type -associative_find_container(std::string& type) -{ - using std::string; - string::size_type n1 = type.find("map"); - string::size_type n2 = type.find("set"); - if (n1 != string::npos || n2 != string::npos) - return std::min(n1, n2); - else - throw std::runtime_error("associative_find_container not found"); -} #endif diff --git a/libstdc++-v3/testsuite/util/testsuite_performance.h b/libstdc++-v3/testsuite/util/testsuite_performance.h index ad873ed6d23..246651812d8 100644 --- a/libstdc++-v3/testsuite/util/testsuite_performance.h +++ b/libstdc++-v3/testsuite/util/testsuite_performance.h @@ -1,7 +1,7 @@ // -*- C++ -*- // Testing performance utilities for the C++ library testsuite. // -// Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. +// Copyright (C) 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -38,6 +38,11 @@ #include #include #include +#include +#include +#include +#include +#include #ifdef __linux__ #include @@ -260,5 +265,229 @@ namespace __gnu_test } } // namespace __gnu_test + +// Ah, we wish it wasn't so... +bool first_container = false; +extern const char* filename; + +typedef std::string::size_type (*callback_type) (std::string&); + +template + void + write_viz_container(callback_type find_container, const char* filename) + { + typedef std::string string; + + // Create title. + { + const char ws(' '); + std::ostringstream title; + + std::string titlename(filename); + std::string::size_type n = titlename.find('.'); + if (n != string::npos) + titlename = std::string(titlename.begin(), titlename.begin() + n); + + title << titlename; + title << ws; + title << Iter; + title << ws; +#if 0 + title << "thread<"; + std::boolalpha(title); + title << Thread; + title << '>'; +#endif + + titlename += ".title"; + std::ofstream titlefile(titlename.c_str()); + if (!titlefile.good()) + throw std::runtime_error("write_viz_data cannot open titlename"); + titlefile << title.str() << std::endl; + } + + // Create compressed type name. + Container obj; + int status; + std::string type(abi::__cxa_demangle(typeid(obj).name(), 0, 0, &status)); + + // Extract fully-qualified typename. + // Assumes "set" or "map" are uniquely determinate. + string::iterator beg = type.begin(); + string::iterator end; + string::size_type n = (*find_container)(type); + + // Find start of fully-qualified name. + // Assume map, find end. + string::size_type nend = type.find('<', n); + if (nend != string::npos) + end = type.begin() + nend; + + string compressed_type; + compressed_type += '"'; + compressed_type += string(beg, end); + compressed_type += '<'; +#if 0 + typename Container::key_type v; + compressed_type += typeid(v).name(); +#else + compressed_type += "int"; +#endif + compressed_type += ", A>"; + + // XXX + if (Thread == true) + compressed_type += " thread"; + compressed_type += '"'; + + std::ofstream file(filename, std::ios_base::app); + if (!file.good()) + throw std::runtime_error("write_viz_data cannot open filename"); + + file << compressed_type; + first_container = false; + } + + +void +write_viz_data(__gnu_test::time_counter& time, const char* filename) +{ + std::ofstream file(filename, std::ios_base::app); + if (!file.good()) + throw std::runtime_error("write_viz_data cannot open filename"); + + // Print out score in appropriate column. + const char tab('\t'); + int score = time.real_time(); + file << tab << score; +} + +void +write_viz_endl(const char* filename) +{ + std::ofstream file(filename, std::ios_base::app); + if (!file.good()) + throw std::runtime_error("write_viz_endl cannot open filename"); + file << std::endl; +} + + +// Function template, function objects for the tests. +template + struct value_type : public std::pair + { + inline value_type& operator++() + { + ++this->second; + return *this; + } + + inline operator TestType() const { return this->second; } + }; + +template + void + do_loop(); + +template + void* + do_thread(void* p = NULL) + { + do_loop(); + return p; + } + +template + void + test_container(const char* filename) + { + using namespace __gnu_test; + time_counter time; + resource_counter resource; + { + start_counters(time, resource); + if (!Thread) + { + // No threads, so run 4x. + do_loop(); + } + else + { +#if defined (_GLIBCXX_GCC_GTHR_POSIX_H) && !defined (NOTHREAD) + pthread_t t1, t2, t3, t4; + pthread_create(&t1, 0, &do_thread, 0); + pthread_create(&t2, 0, &do_thread, 0); + pthread_create(&t3, 0, &do_thread, 0); + pthread_create(&t4, 0, &do_thread, 0); + + pthread_join(t1, NULL); + pthread_join(t2, NULL); + pthread_join(t3, NULL); + pthread_join(t4, NULL); +#endif + } + stop_counters(time, resource); + + // Detailed text data. + Container obj; + int status; + std::ostringstream comment; + comment << "type: " << abi::__cxa_demangle(typeid(obj).name(), + 0, 0, &status); + report_header(filename, comment.str()); + report_performance("", "", time, resource); + + // Detailed data for visualization. + std::string vizfilename(filename); + vizfilename += ".dat"; + write_viz_data(time, vizfilename.c_str()); + } + } + +template + struct test_sequence + { + test_sequence(const char* filename) : _M_filename(filename) { } + + template + void + operator()(Container) + { + const int i = 20000; + test_container(_M_filename); + } + + private: + const char* _M_filename; + }; + + +inline std::string::size_type +sequence_find_container(std::string& type) +{ + const std::string::size_type npos = std::string::npos; + std::string::size_type n1 = type.find("vector"); + std::string::size_type n2 = type.find("list"); + std::string::size_type n3 = type.find("deque"); + std::string::size_type n4 = type.find("string"); + + if (n1 != npos || n2 != npos || n3 != npos || n4 != npos) + return std::min(std::min(n1, n2), std::min(n3, n4)); + else + throw std::runtime_error("sequence_find_container not found"); +} + +inline std::string::size_type +associative_find_container(std::string& type) +{ + using std::string; + string::size_type n1 = type.find("map"); + string::size_type n2 = type.find("set"); + if (n1 != string::npos || n2 != string::npos) + return std::min(n1, n2); + else + throw std::runtime_error("associative_find_container not found"); +} + #endif // _GLIBCXX_PERFORMANCE_H diff --git a/libstdc++-v3/testsuite/util/testsuite_visualization.h b/libstdc++-v3/testsuite/util/testsuite_visualization.h deleted file mode 100644 index 0e2757666a4..00000000000 --- a/libstdc++-v3/testsuite/util/testsuite_visualization.h +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (C) 2005 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// As a special exception, you may use this file as part of a free software -// library without restriction. Specifically, if other files instantiate -// templates or use macros or inline functions from this file, or you compile -// this file and link it with other files to produce an executable, this -// file does not by itself cause the resulting executable to be covered by -// the GNU General Public License. This exception does not however -// invalidate any other reasons why the executable file might be covered by -// the GNU General Public License. - -#include -#include -#include -#include -#include -#include - -// Ah, we wish it wasn't so... -bool first_container = false; -extern const char* filename; - -typedef std::string::size_type (*callback_type) (std::string&); - -template - void - write_viz_container(callback_type find_container, const char* filename) - { - typedef std::string string; - - // Create title. - { - const char ws(' '); - std::ostringstream title; - - std::string titlename(filename); - std::string::size_type n = titlename.find('.'); - if (n != string::npos) - titlename = std::string(titlename.begin(), titlename.begin() + n); - - title << titlename; - title << ws; - title << Iter; - title << ws; -#if 0 - title << "thread<"; - std::boolalpha(title); - title << Thread; - title << '>'; -#endif - - titlename += ".title"; - std::ofstream titlefile(titlename.c_str()); - if (!titlefile.good()) - throw std::runtime_error("write_viz_data cannot open titlename"); - titlefile << title.str() << std::endl; - } - - // Create compressed type name. - Container obj; - int status; - std::string type(abi::__cxa_demangle(typeid(obj).name(), 0, 0, &status)); - - // Extract fully-qualified typename. - // Assumes "set" or "map" are uniquely determinate. - string::iterator beg = type.begin(); - string::iterator end; - string::size_type n = (*find_container)(type); - - // Find start of fully-qualified name. - // Assume map, find end. - string::size_type nend = type.find('<', n); - if (nend != string::npos) - end = type.begin() + nend; - - string compressed_type; - compressed_type += '"'; - compressed_type += string(beg, end); - compressed_type += '<'; -#if 0 - typename Container::key_type v; - compressed_type += typeid(v).name(); -#else - compressed_type += "int"; -#endif - compressed_type += ", A>"; - - // XXX - if (Thread == true) - compressed_type += " thread"; - compressed_type += '"'; - - std::ofstream file(filename, std::ios_base::app); - if (!file.good()) - throw std::runtime_error("write_viz_data cannot open filename"); - - file << compressed_type; - first_container = false; - } - - -void -write_viz_data(__gnu_test::time_counter& time, const char* filename) -{ - std::ofstream file(filename, std::ios_base::app); - if (!file.good()) - throw std::runtime_error("write_viz_data cannot open filename"); - - // Print out score in appropriate column. - const char tab('\t'); - int score = time.real_time(); - file << tab << score; -} - -void -write_viz_endl(const char* filename) -{ - std::ofstream file(filename, std::ios_base::app); - if (!file.good()) - throw std::runtime_error("write_viz_endl cannot open filename"); - file << std::endl; -} - - -#if 0 -// cons -write_viz_container(&sequence_find_container, - filename); -#endif - -#if 0 -// dtor -write_viz_endl(filename) -#endif