LCOV - code coverage report
Current view: top level - Python - getversion.c (source / functions) Hit Total Coverage
Test: CPython 3.12 LCOV report [commit 5e6661bce9] Lines: 8 8 100.0 %
Date: 2023-03-20 08:15:36 Functions: 2 2 100.0 %
Branches: 2 2 100.0 %

           Branch data     Line data    Source code
       1                 :            : 
       2                 :            : /* Return the full version string. */
       3                 :            : 
       4                 :            : #include "Python.h"
       5                 :            : 
       6                 :            : #include "patchlevel.h"
       7                 :            : 
       8                 :            : static int initialized = 0;
       9                 :            : static char version[250];
      10                 :            : 
      11                 :         58 : void _Py_InitVersion(void)
      12                 :            : {
      13         [ +  + ]:         58 :     if (initialized) {
      14                 :         29 :         return;
      15                 :            :     }
      16                 :         29 :     initialized = 1;
      17                 :         29 :     PyOS_snprintf(version, sizeof(version), "%.80s (%.80s) %.80s",
      18                 :            :                   PY_VERSION, Py_GetBuildInfo(), Py_GetCompiler());
      19                 :            : }
      20                 :            : 
      21                 :            : const char *
      22                 :         29 : Py_GetVersion(void)
      23                 :            : {
      24                 :         29 :     _Py_InitVersion();
      25                 :         29 :     return version;
      26                 :            : }
      27                 :            : 
      28                 :            : // Export the Python hex version as a constant.
      29                 :            : const unsigned long Py_Version = PY_VERSION_HEX;

Generated by: LCOV version 1.14