"Fossies" - the Fresh Open Source Software Archive

Member "cloc-1.86/Unix/t/00_C.t" (19 May 2020, 38231 Bytes) of package /linux/privat/cloc-1.86.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 "00_C.t": 1.84_vs_1.86.

    1 #!/usr/bin/env perl
    2 use warnings;
    3 use strict;
    4 use Test::More;
    5 use Cwd;
    6 my @Tests = (
    7                 {
    8                     'name' => 'Agda',
    9                     'ref'  => '../tests/outputs/Lookup.agda.yaml',
   10                     'args' => '../tests/inputs/Lookup.agda',
   11                 },
   12                 {
   13                     'name' => 'Apex Class',
   14                     'ref'  => '../tests/outputs/RemoteSiteHelperTest.cls.yaml',
   15                     'args' => '../tests/inputs/RemoteSiteHelperTest.cls',
   16                 },
   17                 {
   18                     'name' => 'APL',
   19                     'ref'  => '../tests/outputs/rand.apl.yaml',
   20                     'args' => '../tests/inputs/rand.apl',
   21                 },
   22                 {
   23                     'name' => 'AsciiDoc',
   24                     'ref'  => '../tests/outputs/asciidoctor.adoc.yaml',
   25                     'args' => '../tests/inputs/asciidoctor.adoc',
   26                 },
   27                 {
   28                     'name' => 'ASP.NET',
   29                     'ref'  => '../tests/outputs/page_layout.aspx.yaml',
   30                     'args' => '../tests/inputs/page_layout.aspx',
   31                 },
   32                 {
   33                     'name' => 'Assembly 1',
   34                     'ref'  => '../tests/outputs/Assembler-Intel.asm.yaml',
   35                     'args' => '../tests/inputs/Assembler-Intel.asm',
   36                 },
   37                 {
   38                     'name' => 'Assembly 2',
   39                     'ref'  => '../tests/outputs/Assembly-sysv.S.yaml',
   40                     'args' => '../tests/inputs/Assembly-sysv.S',
   41                 },
   42                 {
   43                     'name' => 'Assembly 3',
   44                     'ref'  => '../tests/outputs/zos_assembly.s.yaml',
   45                     'args' => '../tests/inputs/zos_assembly.s',
   46                 },
   47                 {
   48                     'name' => 'ANTLR Grammar 1',
   49                     'ref'  => '../tests/outputs/ExprParser.g.yaml',
   50                     'args' => '../tests/inputs/ExprParser.g',
   51                 },
   52                 {
   53                     'name' => 'ANTLR Grammar 2',
   54                     'ref'  => '../tests/outputs/C.g4.yaml',
   55                     'args' => '../tests/inputs/C.g4',
   56                 },
   57                 {
   58                     'name' => 'Bazel',
   59                     'ref'  => '../tests/outputs/BUILD.yaml',
   60                     'args' => '../tests/inputs/BUILD',
   61                 },
   62                 {
   63                     'name' => 'Blade',
   64                     'ref'  => '../tests/outputs/master.blade.php.yaml',
   65                     'args' => '../tests/inputs/master.blade.php',
   66                 },
   67                 {
   68                     'name' => 'Brainfuck',
   69                     'ref'  => '../tests/outputs/hello.bf.yaml',
   70                     'args' => '../tests/inputs/hello.bf',
   71                 },
   72                 {
   73                     'name' => 'BrightScript',
   74                     'ref'  => '../tests/outputs/roku.brs.yaml',
   75                     'args' => '../tests/inputs/roku.brs',
   76                 },
   77                 {
   78                     'name' => 'C simple',
   79                     'args' => '../tests/inputs/C-Ansi.c',
   80                     'ref'  => '../tests/outputs/C-Ansi.c.yaml',
   81                 },
   82                 {
   83                     'name' => 'C# 2',
   84                     'ref'  => '../tests/outputs/wokka.cs.yaml',
   85                     'args' => '../tests/inputs/wokka.cs',
   86                 },
   87                 {
   88                     'name' => 'C# 3',
   89                     'ref'  => '../tests/outputs/assembly.cs.yaml',
   90                     'args' => '../tests/inputs/assembly.cs',
   91                 },
   92                 {
   93                     'name' => 'C/C++ header',
   94                     'ref'  => '../tests/outputs/locale_facets.h.yaml',
   95                     'args' => '../tests/inputs/locale_facets.h',
   96                 },
   97                 {
   98                     'name' => 'Chapel',
   99                     'ref'  => '../tests/outputs/Chapel.chpl.yaml',
  100                     'args' => '../tests/inputs/Chapel.chpl',
  101                 },
  102                 {
  103                     'name' => 'Cucumber',
  104                     'ref'  => '../tests/outputs/cucumber.feature.yaml',
  105                     'args' => '../tests/inputs/cucumber.feature',
  106                 },
  107                 {
  108                     'name' => 'Clean',
  109                     'ref'  => '../tests/outputs/iclean.icl.yaml',
  110                     'args' => '../tests/inputs/iclean.icl',
  111                 },
  112                 {
  113                     'name' => 'COBOL',
  114                     'ref'  => '../tests/outputs/conditions.CBL.yaml',
  115                     'args' => '../tests/inputs/conditions.CBL',
  116                 },
  117                 {
  118                     'name' => 'COBOL 2',
  119                     'ref'  => '../tests/outputs/wokka.cbl.yaml',
  120                     'args' => '../tests/inputs/wokka.cbl',
  121                 },
  122                 {
  123                     'name' => 'COBOL 3',
  124                     'ref'  => '../tests/outputs/Cobol.cbl.yaml',
  125                     'args' => '../tests/inputs/Cobol.cbl',
  126                 },
  127                 {
  128                     'name' => 'ColdFusion',
  129                     'ref'  => '../tests/outputs/ColdFusion.cfm.yaml',
  130                     'args' => '../tests/inputs/ColdFusion.cfm',
  131                 },
  132                 {
  133                     'name' => 'C#',
  134                     'ref'  => '../tests/outputs/C#.cs.yaml',
  135                     'args' => '../tests/inputs/C#.cs',
  136                 },
  137                 {
  138                     'name' => 'C++',
  139                     'ref'  => '../tests/outputs/C++-MFC.cc.yaml',
  140                     'args' => '../tests/inputs/C++-MFC.cc',
  141                 },
  142                 {
  143                     'name' => 'C++ Uppercase extension',
  144                     'ref'  => '../tests/outputs/C++-uppercase.CPP.yaml',
  145                     'args' => '../tests/inputs/C++-uppercase.CPP',
  146                 },
  147                 {
  148                     'name' => 'C simple',
  149                     'ref'  => '../tests/outputs/C-Ansi.c.yaml',
  150                     'args' => '../tests/inputs/C-Ansi.c',
  151                 },
  152                 {
  153                     'name' => 'dhall',
  154                     'ref'  => '../tests/outputs/Prelude.dhall.yaml',
  155                     'args' => '../tests/inputs/Prelude.dhall',
  156                 },
  157                 {
  158                     'name' => 'DIET',
  159                     'ref'  => '../tests/outputs/layout.dt.yaml',
  160                     'args' => '../tests/inputs/layout.dt',
  161                 },
  162                 {
  163                     'name' => 'dir 1',
  164                     'ref'  => '../tests/outputs/foo_bar.yaml',
  165                     'args' => '../tests/inputs/foo_bar',
  166                 },
  167                 {
  168                     'name' => 'dir 2',
  169                     'ref'  => '../tests/outputs/dd.yaml',
  170                     'args' => '../tests/inputs/dd',
  171                 },
  172                 {
  173                     'name' => 'dir 3',
  174                     'ref'  => '../tests/outputs/aa.yaml',
  175                     'args' => '../tests/inputs/aa',
  176                 },
  177                 {
  178                     'name' => 'Dockerfile',
  179                     'ref'  => '../tests/outputs/Dockerfile.yaml',
  180                     'args' => '../tests/inputs/Dockerfile',
  181                 },
  182                 {
  183                     'name' => 'DOS batch',
  184                     'ref'  => '../tests/outputs/MSDOS.bat.yaml',
  185                     'args' => '../tests/inputs/MSDOS.bat',
  186                 },
  187                 {
  188                     'name' => 'Drools',
  189                     'ref'  => '../tests/outputs/drools.drl.yaml',
  190                     'args' => '../tests/inputs/drools.drl',
  191                 },
  192                 {
  193                     'name' => 'ECPP',
  194                     'ref'  => '../tests/outputs/comp.ecpp.yaml',
  195                     'args' => '../tests/inputs/comp.ecpp',
  196                 },
  197                 {
  198                     'name' => 'EJS',
  199                     'ref'  => '../tests/outputs/sample.ejs.yaml',
  200                     'args' => '../tests/inputs/sample.ejs',
  201                 },
  202                 {
  203                     'name' => 'Elixir',
  204                     'ref'  => '../tests/outputs/elixir.ex.yaml',
  205                     'args' => '../tests/inputs/elixir.ex',
  206                 },
  207                 {
  208                     'name' => 'Embedded Crystal',
  209                     'ref'  => '../tests/outputs/capture.ecr.yaml',
  210                     'args' => '../tests/inputs/capture.ecr',
  211                 },
  212                 {
  213                     'name' => 'Fennel',    
  214                     'ref'  => '../tests/outputs/generate.fnl.yaml',
  215                     'args' => '../tests/inputs/generate.fnl',
  216                 },
  217                 {
  218                     'name' => 'Fish Shell',
  219                     'ref'  => '../tests/outputs/git_helpers.fish.yaml',
  220                     'args' => '../tests/inputs/git_helpers.fish',
  221                 },
  222                 {
  223                     'name' => 'Focus',
  224                     'ref'  => '../tests/outputs/FOCUS.focexec.yaml',
  225                     'args' => '../tests/inputs/FOCUS.focexec',
  226                 },
  227                 {
  228                     'name' => 'Fortran 77',
  229                     'ref'  => '../tests/outputs/Fortran77.f.yaml',
  230                     'args' => '../tests/inputs/Fortran77.f',
  231                 },
  232                 {
  233                     'name' => 'Fortran 77 2',
  234                     'ref'  => '../tests/outputs/hello.f.yaml',
  235                     'args' => '../tests/inputs/hello.f',
  236                 },
  237                 {
  238                     'name' => 'Fortran 90',
  239                     'ref'  => '../tests/outputs/Fortran90.f90.yaml',
  240                     'args' => '../tests/inputs/Fortran90.f90',
  241                 },
  242                 {
  243                     'name' => 'Fortran 90 2',
  244                     'ref'  => '../tests/outputs/hello.f90.yaml',
  245                     'args' => '../tests/inputs/hello.f90',
  246                 },
  247                 {
  248                     'name' => 'Freemarker Template',
  249                     'ref'  => '../tests/outputs/FreemarkerTemplate.ftl.yaml',
  250                     'args' => '../tests/inputs/FreemarkerTemplate.ftl',
  251                 },
  252                 {
  253                     'name' => 'FXML',
  254                     'ref'  => '../tests/outputs/vbox.fxml.yaml',
  255                     'args' => '../tests/inputs/vbox.fxml',
  256                 },
  257                 {
  258                     'name' => 'F#',
  259                     'ref'  => '../tests/outputs/fsharp.fs.yaml',
  260                     'args' => '../tests/inputs/fsharp.fs',
  261                 },
  262                 {
  263                     'name' => 'F# Script',
  264                     'ref'  => '../tests/outputs/fsharp_script.fsx.yaml',
  265                     'args' => '../tests/inputs/fsharp_script.fsx',
  266                 },
  267                 {
  268                     'name' => 'Gencat NLS',
  269                     'ref'  => '../tests/outputs/Gencat-NLS.msg.yaml',
  270                     'args' => '../tests/inputs/Gencat-NLS.msg',
  271                 },
  272                 {
  273                     'name' => 'Glade',
  274                     'ref'  => '../tests/outputs/glade-search-popover.ui.yaml',
  275                     'args' => '../tests/inputs/glade-search-popover.ui',
  276                 },
  277                 {
  278                     'name' => 'GLSL',
  279                     'ref'  => '../tests/outputs/blur.glsl.yaml',
  280                     'args' => '../tests/inputs/blur.glsl',
  281                 },
  282                 {
  283                     'name' => 'Go',
  284                     'ref'  => '../tests/outputs/hello_app.go-1.yaml',
  285                     'args' => '../tests/inputs/hello_app*.go',
  286                 },
  287                 {
  288                     'name' => 'Go --no-autogen',
  289                     'ref'  => '../tests/outputs/hello_app.go-2.yaml',
  290                     'args' => '--no-autogen ../tests/inputs/hello_app*.go',
  291                 },
  292                 {
  293                     'name' => 'Groovy',
  294                     # issue #139; avoid
  295                     # Complex regular subexpression recursion limit (32766) exceeded
  296                     'ref'  => '../tests/outputs/regex_limit.gradle.yaml',
  297                     'args' => '../tests/inputs/regex_limit.gradle',
  298                 },
  299                 {
  300                     'name' => 'GraphQL',
  301                     'ref'  => '../tests/outputs/graphql.gql.yaml',
  302                     'args' => '../tests/inputs/graphql.gql',
  303                 },
  304                 {
  305                     'name' => 'HAML',
  306                     'ref'  => '../tests/outputs/just_stuff.haml.yaml',
  307                     'args' => '../tests/inputs/just_stuff.haml',
  308                 },
  309                 {
  310                     'name' => 'Haskell',
  311                     'ref'  => '../tests/outputs/test2.lhs.yaml',
  312                     'args' => '../tests/inputs/test2.lhs',
  313                 },
  314                 {
  315                     'name' => 'Haskell 2',
  316                     'ref'  => '../tests/outputs/test1.lhs.yaml',
  317                     'args' => '../tests/inputs/test1.lhs',
  318                 },
  319                 {
  320                     'name' => 'Haskell 3',
  321                     'ref'  => '../tests/outputs/Haskell.hs.yaml',
  322                     'args' => '../tests/inputs/Haskell.hs',
  323                 },
  324                 {
  325                     'name' => 'Haskell 4',
  326                     'ref'  => '../tests/outputs/test.hs.yaml',
  327                     'args' => '../tests/inputs/test.hs',
  328                 },
  329                 {
  330                     'name' => 'Haxe',
  331                     'ref'  => '../tests/outputs/Sys.hx.yaml',
  332                     'args' => '../tests/inputs/Sys.hx',
  333                 },
  334                 {
  335                     'name' => 'HCL',
  336                     'ref'  => '../tests/outputs/nomad_job.hcl.yaml',
  337                     'args' => '../tests/inputs/nomad_job.hcl',
  338                 },
  339                 {
  340                     'name' => 'Hoon',
  341                     'ref'  => '../tests/outputs/arvo.hoon.yaml',
  342                     'args' => '../tests/inputs/arvo.hoon',
  343                 },
  344                 {
  345                     'name' => 'IDL 1',
  346                     'ref'  => '../tests/outputs/IDL.idl.yaml',
  347                     'args' => '../tests/inputs/IDL.idl',
  348                 },
  349                 {
  350                     'name' => 'IDL 2',
  351                     'ref'  => '../tests/outputs/streamlines.pro.yaml',
  352                     'args' => '../tests/inputs/streamlines.pro',
  353                 },
  354                 {
  355                     'name' => 'Idris',
  356                     'ref'  => '../tests/outputs/Combinators.idr.yaml',
  357                     'args' => '../tests/inputs/Combinators.idr',
  358                 },
  359                 {
  360                     'name' => 'Idris (block comments)',
  361                     'ref'  => '../tests/outputs/idris_block_comments.idr.yaml',
  362                     'args' => '../tests/inputs/idris_block_comments.idr',
  363                 },
  364                 {
  365                     'name' => 'Igor Pro',
  366                     'ref'  => '../tests/outputs/igorpro.ipf.yaml',
  367                     'args' => '../tests/inputs/igorpro.ipf',
  368                 },
  369                 {
  370                     'name' => 'Jupyter Notebook',
  371                     'ref'  => '../tests/outputs/Trapezoid_Rule.ipynb.yaml',
  372                     'args' => '../tests/inputs/Trapezoid_Rule.ipynb',
  373                 },
  374                 {
  375                     'name' => 'Imba',
  376                     'ref'  => '../tests/outputs/class.imba.yaml',
  377                     'args' => '../tests/inputs/class.imba',
  378                 },
  379                 {
  380                     'name' => 'INI',
  381                     'ref'  => '../tests/outputs/wpedia.ini.yaml',
  382                     'args' => '../tests/inputs/wpedia.ini',
  383                 },
  384                 {
  385                     'name' => 'IPL',
  386                     'ref'  => '../tests/outputs/insertJournalEntry.ipl.yaml',
  387                     'args' => '../tests/inputs/insertJournalEntry.ipl',
  388                 },
  389                 {
  390                     'name' => 'Java',
  391                     'ref'  => '../tests/outputs/Java.java.yaml',
  392                     'args' => '../tests/inputs/Java.java',
  393                 },
  394                 {
  395                     'name' => 'JCL',
  396                     'ref'  => '../tests/outputs/offline.jcl.yaml',
  397                     'args' => '../tests/inputs/offline.jcl',
  398                 },
  399                 {
  400                     'name' => 'JSON',
  401                     'ref'  => '../tests/outputs/glossary.json.yaml',
  402                     'args' => '../tests/inputs/glossary.json',
  403                 },
  404                 {
  405                     'name' => 'JSON5',
  406                     'ref'  => '../tests/outputs/glossary.json5.yaml',
  407                     'args' => '../tests/inputs/glossary.json5',
  408                 },
  409                 {
  410                     'name' => 'Julia',
  411                     'ref'  => '../tests/outputs/julia.jl.yaml',
  412                     'args' => '../tests/inputs/julia.jl',
  413                 },
  414                 {
  415                     'name' => 'Kotlin',
  416                     'ref'  => '../tests/outputs/hello.kt.yaml',
  417                     'args' => '../tests/inputs/hello.kt',
  418                 },
  419                 {
  420                     'name' => 'Lean',
  421                     'ref'  => '../tests/outputs/dlist.lean.yaml',
  422                     'args' => '../tests/inputs/dlist.lean',
  423                 },
  424                 {
  425                     'name' => 'LFE',
  426                     'ref'  => '../tests/outputs/ping_pong.lfe.yaml',
  427                     'args' => '../tests/inputs/ping_pong.lfe',
  428                 },
  429                 {
  430                     'name' => 'Lisp',
  431                     'ref'  => '../tests/outputs/sharpsign.cl.yaml',
  432                     'args' => '../tests/inputs/sharpsign.cl',
  433                 },
  434                 {
  435                     'name' => 'Literate Idris',
  436                     'ref'  => '../tests/outputs/Hello.lidr.yaml',
  437                     'args' => '../tests/inputs/Hello.lidr',
  438                 },
  439                 {
  440                     'name' => 'Logtalk',
  441                     'ref'  => '../tests/outputs/logtalk.lgt.yaml',
  442                     'args' => '../tests/inputs/logtalk.lgt',
  443                 },
  444                 {
  445                     'name' => 'Lua',
  446                     'ref'  => '../tests/outputs/hello.lua.yaml',
  447                     'args' => '../tests/inputs/hello.lua',
  448                 },
  449                 {
  450                     'name' => 'Lua nested comments',
  451                     'ref'  => '../tests/outputs/nested.lua.yaml',
  452                     'args' => '../tests/inputs/nested.lua',
  453                 },
  454                 {
  455                     'name' => 'Makefile',
  456                     'ref'  => '../tests/outputs/Makefile.yaml',
  457                     'args' => '../tests/inputs/Makefile',
  458                 },
  459                 {
  460                     'name' => 'Makefile 2',
  461                     'ref'  => '../tests/outputs/mfile.mk.yaml',
  462                     'args' => '../tests/inputs/mfile.mk',
  463                 },
  464                 {
  465                     'name' => 'Mako',
  466                     'ref'  => '../tests/outputs/Mako.mako.yaml',
  467                     'args' => '../tests/inputs/Mako.mako',
  468                 },
  469                 {
  470                     'name' => 'Mathematica',
  471                     'ref'  => '../tests/outputs/Mathematica_1.m.yaml',
  472                     'args' => '../tests/inputs/Mathematica_1.m',
  473                 },
  474                 {
  475                     'name' => 'Mathematica 2',
  476                     'ref'  => '../tests/outputs/Mathematica_2.wlt.yaml',
  477                     'args' => '../tests/inputs/Mathematica_2.wlt',
  478                 },
  479                 {
  480                     'name' => 'MATLAB',
  481                     'ref'  => '../tests/outputs/Octave.m.yaml',
  482                     'args' => '../tests/inputs/Octave.m',
  483                 },
  484                 {
  485                     'name' => 'MATLAB 2',
  486                     'ref'  => '../tests/outputs/Lanczos.m.yaml',
  487                     'args' => '../tests/inputs/Lanczos.m',
  488                 },
  489                 {
  490                     'name' => 'Mumps',
  491                     'ref'  => '../tests/outputs/Mumps.mps.yaml',
  492                     'args' => '../tests/inputs/Mumps.mps',
  493                 },
  494                 {
  495                     'name' => 'Mustache',
  496                     'ref'  => '../tests/outputs/x.mustache.yaml',
  497                     'args' => '../tests/inputs/x.mustache',
  498                 },
  499                 {
  500                     'name' => 'Mustache 2',
  501                     'ref'  => '../tests/outputs/includes_demo.mustache.yaml',
  502                     'args' => '../tests/inputs/includes_demo.mustache',
  503                 },
  504                 {
  505                     'name' => 'MXML',
  506                     'ref'  => '../tests/outputs/drupal.mxml.yaml',
  507                     'args' => '../tests/inputs/drupal.mxml',
  508                 },
  509                 {
  510                     'name' => 'Nim',
  511                     'ref'  => '../tests/outputs/statcsv.nim.yaml',
  512                     'args' => '../tests/inputs/statcsv.nim',
  513                 },
  514                 {
  515                     'name' => 'Nix',
  516                     'ref'  => '../tests/outputs/darwin-configuration.nix.yaml',
  517                     'args' => '../tests/inputs/darwin-configuration.nix',
  518                 },
  519                 {
  520                     'name' => 'Objective C',
  521                     'ref'  => '../tests/outputs/qsort_demo.m.yaml',
  522                     'args' => '../tests/inputs/qsort_demo.m',
  523                 },
  524                 {
  525                     'name' => 'Oracle PL/SQL',
  526                     'ref'  => '../tests/outputs/bubs_tak_ard.prc.yaml',
  527                     'args' => '../tests/inputs/bubs_tak_ard.prc',
  528                 },
  529                 {
  530                     'name' => 'Pascal',
  531                     'ref'  => '../tests/outputs/Pascal.pas.yaml',
  532                     'args' => '../tests/inputs/Pascal.pas',
  533                 },
  534                 {
  535                     'name' => 'Pascal 2',
  536                     'ref'  => '../tests/outputs/Pascal.pp.yaml',
  537                     'args' => '../tests/inputs/Pascal.pp',
  538                 },
  539                 {
  540                     'name' => 'Pascal 3',
  541                     'ref'  => '../tests/outputs/hello1.pas.yaml',
  542                     'args' => '../tests/inputs/hello1.pas',
  543                 },
  544                 {
  545                     'name' => 'Pascal 4',
  546                     'ref'  => '../tests/outputs/hello.pas.yaml',
  547                     'args' => '../tests/inputs/hello.pas',
  548                 },
  549                 {
  550                     'name' => 'PHP',
  551                     'ref'  => '../tests/outputs/test1.inc.yaml',
  552                     'args' => '../tests/inputs/test1.inc',
  553                 },
  554                 {
  555                     'name' => 'PHP 2',
  556                     'ref'  => '../tests/outputs/test1.php.yaml',
  557                     'args' => '../tests/inputs/test1.php',
  558                 },
  559                 {
  560                     'name' => 'Pig Latin',
  561                     'ref'  => '../tests/outputs/script1-hadoop.pig.yaml',
  562                     'args' => '../tests/inputs/script1-hadoop.pig',
  563                 },
  564                 {
  565                     'name' => 'ProGuard',
  566                     'ref'  => '../tests/outputs/proguard-project-app.pro.yaml',
  567                     'args' => '../tests/inputs/proguard-project-app.pro',
  568                 },
  569                 {
  570                     'name' => 'Prolog',
  571                     'ref'  => '../tests/outputs/birds.pro.yaml',
  572                     'args' => '../tests/inputs/birds.pro',
  573                 },
  574                 {
  575                     'name' => 'PO File',
  576                     'ref'  => '../tests/outputs/en_AU.po.yaml',
  577                     'args' => '../tests/inputs/en_AU.po',
  578                 },
  579                 {
  580                     'name' => 'PL/I',
  581                     'ref'  => '../tests/outputs/hello.pl1.yaml',
  582                     'args' => '../tests/inputs/hello.pl1',
  583                 },
  584                 {
  585                     'name' => 'PL/M',
  586                     'ref'  => '../tests/outputs/find.plm.yaml',
  587                     'args' => '../tests/inputs/find.plm',
  588                 },
  589                 {
  590                     'name' => 'Puppet',
  591                     'ref'  => '../tests/outputs/modules1-ntp1.pp.yaml',
  592                     'args' => '../tests/inputs/modules1-ntp1.pp',
  593                 },
  594                 {
  595                     'name' => 'Python',
  596                     'ref'  => '../tests/outputs/hi.py.yaml',
  597                     'args' => '../tests/inputs/hi.py',
  598                 },
  599                 {
  600                     'name' => 'Python wheel file',
  601                     'ref'  => '../tests/outputs/test-1.0-py2.py3-none-win32.whl.yaml',
  602                     'args' => '../tests/inputs/test-1.0-py2.py3-none-win32.whl',
  603                 },
  604                 {
  605                     'name' => 'Qt Linguist',
  606                     'ref'  => '../tests/outputs/i18n_de.ts.yaml',
  607                     'args' => '../tests/inputs/i18n_de.ts',
  608                 },
  609                 {
  610                     'name' => 'R 1',
  611                     'ref'  => '../tests/outputs/sample.R.yaml',
  612                     'args' => '../tests/inputs/sample.R',
  613                 },
  614                 {
  615                     'name' => 'R 2',
  616                     'ref'  => '../tests/outputs/utilities.R.yaml',
  617                     'args' => '../tests/inputs/utilities.R',
  618                 },
  619                 {
  620                     'name' => 'R 3',
  621                     'ref'  => '../tests/outputs/acpclust.R.yaml',
  622                     'args' => '../tests/inputs/acpclust.R',
  623                 },
  624                 {
  625                     'name' => 'Racket',
  626                     'ref'  => '../tests/outputs/md5.rkt.yaml',
  627                     'args' => '../tests/inputs/md5.rkt',
  628                 },
  629                 {
  630                     'name' => 'RAML',
  631                     'ref'  => '../tests/outputs/helloworld.raml.yaml',
  632                     'args' => '../tests/inputs/helloworld.raml',
  633                 },
  634                 {
  635                     'name' => 'Razor',
  636                     'ref'  => '../tests/outputs/razor.cshtml.yaml',
  637                     'args' => '../tests/inputs/razor.cshtml',
  638                 },
  639                 {
  640                     'name' => 'ReasonML',
  641                     'ref'  => '../tests/outputs/LogMain.re.yaml',
  642                     'args' => '../tests/inputs/LogMain.re',
  643                 },
  644                 {
  645                     'name' => 'reStructuredText',
  646                     'ref'  => '../tests/outputs/reStructuredText.rst.yaml',
  647                     'args' => '../tests/inputs/reStructuredText.rst',
  648                 },
  649                 {
  650                     'name' => 'RobotFramework',
  651                     'ref'  => '../tests/outputs/robotframework.robot.yaml',
  652                     'args' => '../tests/inputs/robotframework.robot',
  653                 },
  654                 {
  655                     'name' => 'Rmd',
  656                     'ref'  => '../tests/outputs/test.Rmd.yaml',
  657                     'args' => '../tests/inputs/test.Rmd',
  658                 },
  659                 {
  660                     'name' => 'Ruby',
  661                     'ref'  => '../tests/outputs/messages.rb.yaml',
  662                     'args' => '../tests/inputs/messages.rb',
  663                 },
  664                 {
  665                     'name' => 'Sass',
  666                     'ref'  => '../tests/outputs/style.scss.yaml',
  667                     'args' => '../tests/inputs/style.scss',
  668                 },
  669                 {
  670                     'name' => 'SaltStack',
  671                     'ref'  => '../tests/outputs/certificates.sls.yaml',
  672                     'args' => '../tests/inputs/certificates.sls',
  673                 },
  674                 {
  675                     'name' => 'Scheme',
  676                     'ref'  => '../tests/outputs/scheme.sls.yaml',
  677                     'args' => '../tests/inputs/scheme.sls',
  678                 },
  679                 {
  680                     'name' => 'Starlark',
  681                     'ref'  => '../tests/outputs/build.bzl.yaml',
  682                     'args' => '../tests/inputs/build.bzl',
  683                 },
  684                 {
  685                     'name' => 'Slim',
  686                     'ref'  => '../tests/outputs/Slim.html.slim.yaml',
  687                     'args' => '../tests/inputs/Slim.html.slim',
  688                 },
  689                 {
  690                     'name' => 'Smalltalk 1',
  691                     'ref'  => '../tests/outputs/chat.st.yaml',
  692                     'args' => '../tests/inputs/chat.st',
  693                 },
  694                 {
  695                     'name' => 'Smalltalk 2',
  696                     'ref'  => '../tests/outputs/captcha.cs.yaml',
  697                     'args' => '../tests/inputs/captcha.cs',
  698                 },
  699                 {
  700                     'name' => 'Smarty',
  701                     'ref'  => '../tests/outputs/guestbook.tpl.yaml',
  702                     'args' => '../tests/inputs/guestbook.tpl',
  703                 },
  704                 {
  705                     'name' => 'SparForte',
  706                     'ref'  => '../tests/outputs/hello.sp.yaml',
  707                     'args' => '../tests/inputs/hello.sp',
  708                 },
  709                 {
  710                     'name' => 'Solidity',
  711                     'ref'  => '../tests/outputs/solidity.sol.yaml',
  712                     'args' => '../tests/inputs/solidity.sol',
  713                 },
  714                 {
  715                     'name' => 'Specman e 1',
  716                     'ref'  => '../tests/outputs/specman_e.e.yaml',
  717                     'args' => '../tests/inputs/specman_e.e',
  718                 },
  719                 {
  720                     'name' => 'Specman e 2',
  721                     'ref'  => '../tests/outputs/specman_e2.e.yaml',
  722                     'args' => '../tests/inputs/specman_e2.e',
  723                 },
  724                 {
  725                     'name' => 'Squirrel',
  726                     'ref'  => '../tests/outputs/squirrel_table.nut.yaml',
  727                     'args' => '../tests/inputs/squirrel_table.nut',
  728                 },
  729                 {
  730                     'name' => 'Stata',
  731                     'ref'  => '../tests/outputs/stata.do.yaml',
  732                     'args' => '../tests/inputs/stata.do',
  733                 },
  734                 {
  735                     'name' => 'SugarSS',
  736                     'ref'  => '../tests/outputs/rules.sss.yaml',
  737                     'args' => '../tests/inputs/rules.sss',
  738                 },
  739                 {
  740                     'name' => 'Svelte',
  741                     'ref'  => '../tests/outputs/reactive.svelte.yaml',
  742                     'args' => '../tests/inputs/reactive.svelte',
  743                 },
  744                 {
  745                     'name' => 'SVG',
  746                     'ref'  => '../tests/outputs/SVG_logo.svg.yaml',
  747                     'args' => '../tests/inputs/SVG_logo.svg',
  748                 },
  749                 {
  750                     'name' => 'Swift',
  751                     'ref'  => '../tests/outputs/tour.swift.yaml',
  752                     'args' => '../tests/inputs/tour.swift',
  753                 },
  754                 {
  755                     'name' => 'SWIG',
  756                     'ref'  => '../tests/outputs/swig_example.i.yaml',
  757                     'args' => '../tests/inputs/swig_example.i',
  758                 },
  759                 {
  760                     'name' => 'Tcl/Tk',
  761                     'ref'  => '../tests/outputs/Tk.yaml',
  762                     'args' => '../tests/inputs/Tk',
  763                 },
  764                 {
  765                     'name' => 'TeX',
  766                     'ref'  => '../tests/outputs/LaTeX.tex.yaml',
  767                     'args' => '../tests/inputs/LaTeX.tex',
  768                 },
  769                 {
  770                     'name' => 'Thrift',
  771                     'ref'  => '../tests/outputs/DocTest.thrift.yaml',
  772                     'args' => '../tests/inputs/DocTest.thrift',
  773                 },
  774                 {
  775                     'name' => 'TOML',
  776                     'ref'  => '../tests/outputs/toml_example.toml.yaml',
  777                     'args' => '../tests/inputs/toml_example.toml',
  778                 },
  779                 {
  780                     'name' => 'TNSDL',
  781                     'ref'  => '../tests/outputs/tnsdl.sdl.yaml',
  782                     'args' => '../tests/inputs/tnsdl.sdl',
  783                 },
  784                 {
  785                     'name' => 'TTCN',
  786                     'ref'  => '../tests/outputs/clusterConf.ttcn.yaml',
  787                     'args' => '../tests/inputs/clusterConf.ttcn',
  788                 },
  789                 {
  790                     'name' => 'TypeScript',
  791                     'ref'  => '../tests/outputs/TypeScript.ts.yaml',
  792                     'args' => '../tests/inputs/TypeScript.ts',
  793                 },
  794                 {
  795                     'name' => 'TypeScript 2',
  796                     'ref'  => '../tests/outputs/TypeScript_2.ts.yaml',
  797                     'args' => '../tests/inputs/TypeScript_2.ts',
  798                 },
  799                 {
  800                     'name' => 'TypeScript 3',
  801                     'ref'  => '../tests/outputs/warship.ts.yaml',
  802                     'args' => '../tests/inputs/warship.ts',
  803                 },
  804                 {
  805                     'name' => 'TypeScript 4',
  806                     'ref'  => '../tests/outputs/greeter.tsx.yaml',
  807                     'args' => '../tests/inputs/greeter.tsx',
  808                 },
  809                 {
  810                     'name' => 'Vala',
  811                     'ref'  => '../tests/outputs/gnureadline.vala.yaml',
  812                     'args' => '../tests/inputs/gnureadline.vala',
  813                 },
  814                 {
  815                     'name' => 'VB.Net',
  816                     'ref'  => '../tests/outputs/VisualBasic.Net.vba.yaml',
  817                     'args' => '../tests/inputs/VisualBasic.Net.vba',
  818                 },
  819                 {
  820                     'name' => 'Velocity Template Language',
  821                     'ref'  => '../tests/outputs/vtl.vm.yaml',
  822                     'args' => '../tests/inputs/vtl.vm',
  823                 },
  824                 {
  825                     'name' => 'Verilog',
  826                     'ref'  => '../tests/outputs/verilog.sv.yaml',
  827                     'args' => '../tests/inputs/verilog.sv',
  828                 },
  829                 {
  830                     'name' => 'Visual Basic',
  831                     'ref'  => '../tests/outputs/JetCar.cls.yaml',
  832                     'args' => '../tests/inputs/JetCar.cls',
  833                 },
  834                 {
  835                     'name' => 'Vuejs Component',
  836                     'ref'  => '../tests/outputs/ItemView.vue.yaml',
  837                     'args' => '../tests/inputs/ItemView.vue',
  838                 },
  839                 {
  840                     'name' => 'WebAssembly',
  841                     'ref'  => '../tests/outputs/type.wast.yaml',
  842                     'args' => '../tests/inputs/type.wast',
  843                 },
  844                 {
  845                     'name' => 'Windows Message',
  846                     'ref'  => '../tests/outputs/ZosMsg.mc.yaml',
  847                     'args' => '../tests/inputs/ZosMsg.mc',
  848                 },
  849                 {
  850                     'name' => 'Windows Message 2',
  851                     'ref'  => '../tests/outputs/Sample.mc.yaml',
  852                     'args' => '../tests/inputs/Sample.mc',
  853                 },
  854                 {
  855                     'name' => 'Windows Module',
  856                     'ref'  => '../tests/outputs/ZosNp.def.yaml',
  857                     'args' => '../tests/inputs/ZosNp.def',
  858                 },
  859                 {
  860                     'name' => 'Windows Resource',
  861                     'ref'  => '../tests/outputs/ZosNet.rc.yaml',
  862                     'args' => '../tests/inputs/ZosNet.rc',
  863                 },
  864                 {
  865                     'name' => 'xBase',
  866                     'ref'  => '../tests/outputs/harbour_xbase.prg.yaml',
  867                     'args' => '../tests/inputs/harbour_xbase.prg',
  868                 },
  869                 {
  870                     'name' => 'XML',
  871                     'ref'  => '../tests/outputs/XML.xml.yaml',
  872                     'args' => '../tests/inputs/XML.xml',
  873                 },
  874                 {
  875                     'name' => 'XQuery',
  876                     'ref'  => '../tests/outputs/pop_by_country.xq.yaml',
  877                     'args' => '../tests/inputs/pop_by_country.xq',
  878                 },
  879                 {
  880                     'name' => 'XSLT',
  881                     'ref'  => '../tests/outputs/XSL-FO.xsl.yaml',
  882                     'args' => '../tests/inputs/XSL-FO.xsl',
  883                 },
  884                 {
  885                     'name' => 'XSLT 2',
  886                     'ref'  => '../tests/outputs/XSLT.xslt.yaml',
  887                     'args' => '../tests/inputs/XSLT.xslt',
  888                 },
  889                 {
  890                     'name' => 'Xtend',
  891                     'ref'  => '../tests/outputs/Xtend.xtend.yaml',
  892                     'args' => '../tests/inputs/Xtend.xtend',
  893                 },
  894             );
  895 
  896 my $Verbose = 0;
  897 
  898 my $results  = 'results.yaml';
  899 my $work_dir = getcwd;
  900 my $cloc     = "$work_dir/../cloc";   # all-purpose version
  901 #my $cloc     = "$work_dir/cloc";      # Unix-tuned version
  902 my $Run = "$cloc --quiet --yaml --out $results ";
  903 foreach my $t (@Tests) {
  904     print  $Run . $t->{'args'} if $Verbose;
  905     system($Run . $t->{'args'});
  906     ok(-e $results, $t->{'name'} . " created output");
  907     my %ref  = load_yaml($t->{'ref'});
  908     my %this = load_yaml($results);
  909     is_deeply(\%ref, \%this, $t->{'name'} . " results match");
  910 }
  911 done_testing();
  912 
  913 sub load_yaml { # {{{1
  914     my ($file, ) = @_;
  915     my %result = ();
  916     if (!-r $file) {
  917         warn "File not found: $file\n";
  918         return %result;
  919     }
  920     open IN, $file or return %result;
  921     my $section = undef;
  922     while (<IN>) {
  923         next if /^\s*#/ or /^--/;
  924         if (/^\s*'?(.*?)'?\s*:\s*$/) {
  925             $section = $1;
  926             next;
  927         }
  928         next unless defined $section;
  929         next if $section eq 'header';
  930         chomp;
  931         s/\s+//g;
  932         my ($K, $V) = split(':');
  933         $K =~ s/'//g;
  934         $result{$section}{$K} = $V;
  935     }
  936     close IN;
  937     return %result
  938 } # 1}}}