"Fossies" - the Fresh Open Source Software Archive

Member "eprints3.4-3.4.4/tests/50_mem_usage.pl" (7 Aug 2022, 3144 Bytes) of package /linux/www/eprints3.4-3.4.4.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "50_mem_usage.pl": 3.4-3.4.3_vs_3.4-3.4.4.

    1 =head1 NAME
    2 
    3 EPrints::Test::Repository
    4 
    5 =cut
    6 
    7 use Test::More tests => 4;
    8 
    9 BEGIN { use_ok( "EPrints" ); }
   10 BEGIN { use_ok( "EPrints::Test" ); }
   11 
   12 {
   13 package EPrints::Test::Repository;
   14 
   15 our @ISA = qw( EPrints::Repository );
   16 
   17     sub _load_config
   18     {
   19         # reset mem usage ready for the first call to a _load method below
   20         EPrints::Test::human_mem_increase();
   21 
   22         return &EPrints::Repository::_load_config;
   23     }
   24     sub _load_workflows
   25     {
   26         Test::More::diag( "\t_load_config=" . EPrints::Test::human_mem_increase() );
   27 
   28         my $rc = &EPrints::Repository::_load_workflows;
   29 
   30         Test::More::diag( "\t_load_workflows=" . EPrints::Test::human_mem_increase() );
   31 
   32         return $rc;
   33     }
   34     sub _load_storage
   35     {
   36         my $rc = &EPrints::Repository::_load_storage;
   37 
   38         Test::More::diag( "\t_load_storage=" . EPrints::Test::human_mem_increase() );
   39 
   40         return $rc;
   41     }
   42     sub _load_namedsets
   43     {
   44         my $rc = &EPrints::Repository::_load_namedsets;
   45 
   46         Test::More::diag( "\t_load_namedsets=" . EPrints::Test::human_mem_increase() );
   47 
   48         return $rc;
   49     }
   50     sub _load_datasets
   51     {
   52         my $rc = &EPrints::Repository::_load_datasets;
   53 
   54         Test::More::diag( "\t_load_datasets=" . EPrints::Test::human_mem_increase() );
   55 
   56         return $rc;
   57     }
   58     sub _load_languages
   59     {
   60         my $rc = &EPrints::Repository::_load_languages;
   61 
   62         Test::More::diag( "\t_load_languages=" . EPrints::Test::human_mem_increase() );
   63 
   64         return $rc;
   65     }
   66     sub _load_templates
   67     {
   68         my $rc = &EPrints::Repository::_load_templates;
   69 
   70         Test::More::diag( "\t_load_templates=" . EPrints::Test::human_mem_increase() );
   71 
   72         return $rc;
   73     }
   74     sub _load_citation_specs
   75     {
   76         my $rc = &EPrints::Repository::_load_citation_specs;
   77 
   78         Test::More::diag( "\t_load_citation_specs=" . EPrints::Test::human_mem_increase() );
   79 
   80         return $rc;
   81     }
   82     sub _load_plugins
   83     {
   84         my $rc = &EPrints::Repository::_load_plugins;
   85 
   86         Test::More::diag( "\t_load_plugins=" . EPrints::Test::human_mem_increase() );
   87 
   88         return $rc;
   89     }
   90 }
   91 
   92 diag( "LOAD=".EPrints::Test::human_mem_increase() );
   93 diag( "Repository-Specific Data" );
   94 my $repository = EPrints::Test::Repository->new( EPrints::Test::get_test_id() );
   95 
   96 EPrints::Test::mem_increase(0); # Reset
   97 my $session = EPrints::Test::get_test_session();
   98 diag( "Session=".EPrints::Test::human_mem_increase() );
   99 
  100 ok(defined $repository, "test repository creation");
  101 ok(defined $session, "test session creation");
  102 
  103 =head1 COPYRIGHT
  104 
  105 =for COPYRIGHT BEGIN
  106 
  107 Copyright 2022 University of Southampton.
  108 EPrints 3.4 is supplied by EPrints Services.
  109 
  110 http://www.eprints.org/eprints-3.4/
  111 
  112 =for COPYRIGHT END
  113 
  114 =for LICENSE BEGIN
  115 
  116 This file is part of EPrints 3.4 L<http://www.eprints.org/>.
  117 
  118 EPrints 3.4 and this file are released under the terms of the
  119 GNU Lesser General Public License version 3 as published by
  120 the Free Software Foundation unless otherwise stated.
  121 
  122 EPrints 3.4 is distributed in the hope that it will be useful,
  123 but WITHOUT ANY WARRANTY; without even the implied warranty of
  124 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  125 See the GNU Lesser General Public License for more details.
  126 
  127 You should have received a copy of the GNU Lesser General Public
  128 License along with EPrints 3.4.
  129 If not, see L<http://www.gnu.org/licenses/>.
  130 
  131 =for LICENSE END
  132