<%perl> use strict; our $perl_unit_cnt=0; our $perl_exists_cnt=0; our $perl_test_cnt=0; our $python_unit_cnt=0; our $python_exists_cnt=0; our $python_test_cnt=0; our $exe_unit_cnt=0; our $exe_exists_cnt=0; our $exe_test_cnt=0; our $data_path="/usr/local/MOPS_DEVEL/htdocs/testing/";
<& default-header.mas &>

##
### Perl Unit Tests <%perl> print "
Unit name | Status | Count
--- | --- | ---
"; ($perl_unit_cnt,$perl_exists_cnt,$perl_test_cnt)=print_units("$data_path/perl-units.txt"); print "
"; print "Perl unit count is $perl_unit_cnt"; print " | $perl_exists_cnt exist"; print " | $perl_test_cnt"; print "
"; | ### Python Unit Tests <%perl> print "
Unit name | Status | Count
--- | --- | ---
"; ($python_unit_cnt,$python_exists_cnt,$python_test_cnt)=print_units("$data_path/python-units.txt"); print "
"; print "Python unit count is $python_unit_cnt"; print " | $python_exists_cnt exist"; print " | $python_test_cnt"; print "
"; | ### Executable Unit Tests <%perl> print "
Unit name | Status | Count
--- | --- | ---
"; ($exe_unit_cnt,$exe_exists_cnt,$exe_test_cnt)=print_units("$data_path/exe-units.txt"); print "
"; print "Executable unit count is $exe_unit_cnt"; print " | $exe_exists_cnt exist"; print " | $exe_test_cnt"; print "
";

<& default-footer.mas &>
<%perl> sub print_units { my($file)=@_; my $unit_cnt=0; my $exists_cnt=0; my $test_cnt=0; open(FILE,"<$file"); my @data=; close(FILE); foreach my $line (@data) { my @s=split(",",$line); print "
"; print ""; print $s[0]; $unit_cnt++; print ""; if($s[1]) { print ""; print "Exists"; $exists_cnt++; } else { print ""; print "Not exists"; } print ""; print ""; if($s[1]) { print $s[1]; # print count $test_cnt+=$s[1]; } print ""; print "
"; } return($unit_cnt,$exists_cnt,$test_cnt); }