adds simple tiny test suite and updates license headers

Thu, 23 Aug 2018 19:45:36 +0200

author
Mike Becker <universe@uap-core.de>
date
Thu, 23 Aug 2018 19:45:36 +0200
changeset 57
68018eac46c3
parent 56
ed65f8c73fb2
child 58
bb512754aaf3

adds simple tiny test suite and updates license headers

LICENSE file | annotate | diff | comparison | revisions
Makefile.am file | annotate | diff | comparison | revisions
README file | annotate | diff | comparison | revisions
configure.ac file | annotate | diff | comparison | revisions
prebuild.sh file | annotate | diff | comparison | revisions
src/Makefile.am file | annotate | diff | comparison | revisions
src/arguments.c file | annotate | diff | comparison | revisions
src/arguments.h file | annotate | diff | comparison | revisions
src/bfile_heuristics.c file | annotate | diff | comparison | revisions
src/bfile_heuristics.h file | annotate | diff | comparison | revisions
src/cline.c file | annotate | diff | comparison | revisions
src/cline.h file | annotate | diff | comparison | revisions
src/regex_parser.c file | annotate | diff | comparison | revisions
src/regex_parser.h file | annotate | diff | comparison | revisions
src/scanner.c file | annotate | diff | comparison | revisions
src/scanner.h file | annotate | diff | comparison | revisions
src/settings.c file | annotate | diff | comparison | revisions
src/settings.h file | annotate | diff | comparison | revisions
src/stdinc.h file | annotate | diff | comparison | revisions
src/string_list.c file | annotate | diff | comparison | revisions
src/string_list.h file | annotate | diff | comparison | revisions
src/suffix_fnc.c file | annotate | diff | comparison | revisions
src/suffix_fnc.h file | annotate | diff | comparison | revisions
test/Makefile.am file | annotate | diff | comparison | revisions
test/codeonly.sh file | annotate | diff | comparison | revisions
test/nocomments.sh file | annotate | diff | comparison | revisions
test/testfile.c file | annotate | diff | comparison | revisions
test/total.sh file | annotate | diff | comparison | revisions
     1.1 --- a/LICENSE	Thu Aug 23 17:58:38 2018 +0200
     1.2 +++ b/LICENSE	Thu Aug 23 19:45:36 2018 +0200
     1.3 @@ -1,4 +1,4 @@
     1.4 -Copyright 2017 Mike Becker. All rights reserved.
     1.5 +Copyright 2018 Mike Becker. All rights reserved.
     1.6  
     1.7  Redistribution and use in source and binary forms, with or without
     1.8  modification, are permitted provided that the following conditions are met:
     2.1 --- a/Makefile.am	Thu Aug 23 17:58:38 2018 +0200
     2.2 +++ b/Makefile.am	Thu Aug 23 19:45:36 2018 +0200
     2.3 @@ -1,4 +1,4 @@
     2.4 -# Copyright 2017 Mike Becker. All rights reserved.
     2.5 +# Copyright 2018 Mike Becker. All rights reserved.
     2.6  # 
     2.7  # Redistribution and use in source and binary forms, with or without
     2.8  # modification, are permitted provided that the following conditions are met:
     3.1 --- a/README	Thu Aug 23 17:58:38 2018 +0200
     3.2 +++ b/README	Thu Aug 23 19:45:36 2018 +0200
     3.3 @@ -1,6 +1,6 @@
     3.4                                         cline
     3.5                          _________________________________________
     3.6 -                             Copyright (C) 2017 Mike Becker
     3.7 +                             Copyright (C) 2018 Mike Becker
     3.8  
     3.9  Contents:
    3.10  1) About ................................................................... 12
    3.11 @@ -47,7 +47,7 @@
    3.12  
    3.13  4) License ____________________________________________________________________
    3.14  
    3.15 -Copyright 2017 Mike Becker. All rights reserved.
    3.16 +Copyright 2018 Mike Becker. All rights reserved.
    3.17  
    3.18  Redistribution and use in source and binary forms, with or without
    3.19  modification, are permitted provided that the following conditions are met:
     4.1 --- a/configure.ac	Thu Aug 23 17:58:38 2018 +0200
     4.2 +++ b/configure.ac	Thu Aug 23 19:45:36 2018 +0200
     4.3 @@ -1,4 +1,4 @@
     4.4 -# Copyright 2017 Mike Becker. All rights reserved.
     4.5 +# Copyright 2018 Mike Becker. All rights reserved.
     4.6  # 
     4.7  # Redistribution and use in source and binary forms, with or without
     4.8  # modification, are permitted provided that the following conditions are met:
     4.9 @@ -22,7 +22,7 @@
    4.10  # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    4.11  
    4.12  AC_PREREQ([2.69])
    4.13 -AC_INIT(cline, 1.1, universe@uap-core.de)
    4.14 +AC_INIT(cline, 1.2, universe@uap-core.de)
    4.15  AM_INIT_AUTOMAKE
    4.16  
    4.17  # Conditionals
     5.1 --- a/prebuild.sh	Thu Aug 23 17:58:38 2018 +0200
     5.2 +++ b/prebuild.sh	Thu Aug 23 19:45:36 2018 +0200
     5.3 @@ -1,4 +1,4 @@
     5.4 -# Copyright 2017 Mike Becker. All rights reserved.
     5.5 +# Copyright 2018 Mike Becker. All rights reserved.
     5.6  # 
     5.7  # Redistribution and use in source and binary forms, with or without
     5.8  # modification, are permitted provided that the following conditions are met:
     6.1 --- a/src/Makefile.am	Thu Aug 23 17:58:38 2018 +0200
     6.2 +++ b/src/Makefile.am	Thu Aug 23 19:45:36 2018 +0200
     6.3 @@ -1,4 +1,4 @@
     6.4 -# Copyright 2017 Mike Becker. All rights reserved.
     6.5 +# Copyright 2018 Mike Becker. All rights reserved.
     6.6  # 
     6.7  # Redistribution and use in source and binary forms, with or without
     6.8  # modification, are permitted provided that the following conditions are met:
     7.1 --- a/src/arguments.c	Thu Aug 23 17:58:38 2018 +0200
     7.2 +++ b/src/arguments.c	Thu Aug 23 19:45:36 2018 +0200
     7.3 @@ -1,6 +1,6 @@
     7.4  /*
     7.5   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 
     7.6 - * Copyright 2017 Mike Becker. All rights reserved.
     7.7 + * Copyright 2018 Mike Becker. All rights reserved.
     7.8   * 
     7.9   * Redistribution and use in source and binary forms, with or without
    7.10   * modification, are permitted provided that the following conditions are met:
    7.11 @@ -21,13 +21,7 @@
    7.12   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
    7.13   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    7.14   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    7.15 - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    7.16 - *
    7.17 - * 
    7.18 - * arguments.c
    7.19 - *
    7.20 - *  Created on: 15.09.2011
    7.21 - *      Author: Mike
    7.22 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    7.23   */
    7.24  
    7.25  #include "arguments.h"
     8.1 --- a/src/arguments.h	Thu Aug 23 17:58:38 2018 +0200
     8.2 +++ b/src/arguments.h	Thu Aug 23 19:45:36 2018 +0200
     8.3 @@ -1,6 +1,6 @@
     8.4  /*
     8.5   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 
     8.6 - * Copyright 2017 Mike Becker. All rights reserved.
     8.7 + * Copyright 2018 Mike Becker. All rights reserved.
     8.8   * 
     8.9   * Redistribution and use in source and binary forms, with or without
    8.10   * modification, are permitted provided that the following conditions are met:
    8.11 @@ -21,12 +21,7 @@
    8.12   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
    8.13   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    8.14   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    8.15 - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    8.16 - *
    8.17 - * arguments.h
    8.18 - *
    8.19 - *  Created on: 15.09.2011
    8.20 - *      Author: Mike
    8.21 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    8.22   */
    8.23  
    8.24  #ifndef ARGUMENTS_H_
     9.1 --- a/src/bfile_heuristics.c	Thu Aug 23 17:58:38 2018 +0200
     9.2 +++ b/src/bfile_heuristics.c	Thu Aug 23 19:45:36 2018 +0200
     9.3 @@ -1,6 +1,6 @@
     9.4  /*
     9.5   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 
     9.6 - * Copyright 2017 Mike Becker. All rights reserved.
     9.7 + * Copyright 2018 Mike Becker. All rights reserved.
     9.8   * 
     9.9   * Redistribution and use in source and binary forms, with or without
    9.10   * modification, are permitted provided that the following conditions are met:
    9.11 @@ -21,12 +21,7 @@
    9.12   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
    9.13   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    9.14   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    9.15 - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    9.16 - *
    9.17 - * bfile_heuristics.c
    9.18 - *
    9.19 - *  Created on: 20.10.2011
    9.20 - *      Author: Mike
    9.21 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    9.22   */
    9.23  
    9.24  #include "bfile_heuristics.h"
    10.1 --- a/src/bfile_heuristics.h	Thu Aug 23 17:58:38 2018 +0200
    10.2 +++ b/src/bfile_heuristics.h	Thu Aug 23 19:45:36 2018 +0200
    10.3 @@ -1,6 +1,6 @@
    10.4  /*
    10.5   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 
    10.6 - * Copyright 2017 Mike Becker. All rights reserved.
    10.7 + * Copyright 2018 Mike Becker. All rights reserved.
    10.8   * 
    10.9   * Redistribution and use in source and binary forms, with or without
   10.10   * modification, are permitted provided that the following conditions are met:
   10.11 @@ -21,12 +21,7 @@
   10.12   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   10.13   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   10.14   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   10.15 - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
   10.16 - *
   10.17 - * bfile_heuristics.h
   10.18 - *
   10.19 - *  Created on: 20.10.2011
   10.20 - *      Author: Mike
   10.21 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   10.22   */
   10.23  
   10.24  #ifndef BFILE_HEURISTICS_H_
    11.1 --- a/src/cline.c	Thu Aug 23 17:58:38 2018 +0200
    11.2 +++ b/src/cline.c	Thu Aug 23 19:45:36 2018 +0200
    11.3 @@ -1,6 +1,6 @@
    11.4  /*
    11.5   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 
    11.6 - * Copyright 2017 Mike Becker. All rights reserved.
    11.7 + * Copyright 2018 Mike Becker. All rights reserved.
    11.8   * 
    11.9   * Redistribution and use in source and binary forms, with or without
   11.10   * modification, are permitted provided that the following conditions are met:
   11.11 @@ -21,12 +21,7 @@
   11.12   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   11.13   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   11.14   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   11.15 - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
   11.16 - *
   11.17 - * cline.c
   11.18 - *
   11.19 - *  Created on: 23.05.2011
   11.20 - *      Author: Mike
   11.21 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   11.22   */
   11.23  
   11.24  #include "cline.h"
   11.25 @@ -58,8 +53,8 @@
   11.26      "\n  -v, --version       - print out version information"
   11.27      "\n  -V                  - turn verbose output off, print the result only"
   11.28      "\n\nShortcuts:"
   11.29 -    "\n  --exclude-cstyle-comments"
   11.30 -    "\n = -E \"\\s*//\" -e \"\\s*/\\*\" \"\\*/\\s*\""
   11.31 +    "\n  --exclude-cstyle-comments : -E '\\s*//' -e '\\s*/\\*' '\\*/\\s*'"
   11.32 +    "\n  --exclude-blank-lines     : -E '^\\s*$'"
   11.33      "\n\n"
   11.34      "The default call without any options is:"    
   11.35      "\n  cline ./\n\n"
   11.36 @@ -205,12 +200,14 @@
   11.37      }
   11.38      if (argflags == 0) {
   11.39        /* SHORTCUTS */
   11.40 -      /* exclude-cstyle-comments */
   11.41        if (strcmp(argv[t], "--exclude-cstyle-comments") == 0) {
   11.42          add_string(settings->regex->pattern_list, "\\s*//");
   11.43          add_string(settings->regex->pattern_list, "$");
   11.44          add_string(settings->regex->pattern_list, "\\s*/\\*");
   11.45          add_string(settings->regex->pattern_list, "\\*/\\s*");
   11.46 +      } else if (strcmp(argv[t], "--exclude-blank-lines") == 0) {
   11.47 +        add_string(settings->regex->pattern_list, "^\\s*$");
   11.48 +        add_string(settings->regex->pattern_list, "$");
   11.49        }
   11.50        /* Path */
   11.51        else {
    12.1 --- a/src/cline.h	Thu Aug 23 17:58:38 2018 +0200
    12.2 +++ b/src/cline.h	Thu Aug 23 19:45:36 2018 +0200
    12.3 @@ -1,6 +1,6 @@
    12.4  /*
    12.5   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 
    12.6 - * Copyright 2017 Mike Becker. All rights reserved.
    12.7 + * Copyright 2018 Mike Becker. All rights reserved.
    12.8   * 
    12.9   * Redistribution and use in source and binary forms, with or without
   12.10   * modification, are permitted provided that the following conditions are met:
   12.11 @@ -21,12 +21,7 @@
   12.12   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   12.13   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   12.14   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   12.15 - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
   12.16 - *
   12.17 - * cline.h
   12.18 - *
   12.19 - *  Created on: 23.05.2011
   12.20 - *      Author: Mike
   12.21 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   12.22   */
   12.23  
   12.24  #ifndef CLINE_H_
    13.1 --- a/src/regex_parser.c	Thu Aug 23 17:58:38 2018 +0200
    13.2 +++ b/src/regex_parser.c	Thu Aug 23 19:45:36 2018 +0200
    13.3 @@ -1,6 +1,6 @@
    13.4  /*
    13.5   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 
    13.6 - * Copyright 2017 Mike Becker. All rights reserved.
    13.7 + * Copyright 2018 Mike Becker. All rights reserved.
    13.8   * 
    13.9   * Redistribution and use in source and binary forms, with or without
   13.10   * modification, are permitted provided that the following conditions are met:
   13.11 @@ -21,12 +21,7 @@
   13.12   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   13.13   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   13.14   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   13.15 - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
   13.16 - *
   13.17 - * regex_parser.c
   13.18 - *
   13.19 - *  Created on: 26.01.2012
   13.20 - *      Author: Mike
   13.21 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   13.22   */
   13.23  
   13.24  #include "regex_parser.h"
    14.1 --- a/src/regex_parser.h	Thu Aug 23 17:58:38 2018 +0200
    14.2 +++ b/src/regex_parser.h	Thu Aug 23 19:45:36 2018 +0200
    14.3 @@ -1,6 +1,6 @@
    14.4  /*
    14.5   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 
    14.6 - * Copyright 2017 Mike Becker. All rights reserved.
    14.7 + * Copyright 2018 Mike Becker. All rights reserved.
    14.8   * 
    14.9   * Redistribution and use in source and binary forms, with or without
   14.10   * modification, are permitted provided that the following conditions are met:
   14.11 @@ -21,12 +21,7 @@
   14.12   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   14.13   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   14.14   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   14.15 - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
   14.16 - *
   14.17 - * regex_parser.h
   14.18 - *
   14.19 - *  Created on: 26.01.2012
   14.20 - *      Author: Mike
   14.21 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   14.22   */
   14.23  
   14.24  #ifndef REGEX_PARSER_H_
    15.1 --- a/src/scanner.c	Thu Aug 23 17:58:38 2018 +0200
    15.2 +++ b/src/scanner.c	Thu Aug 23 19:45:36 2018 +0200
    15.3 @@ -1,6 +1,6 @@
    15.4  /*
    15.5   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 
    15.6 - * Copyright 2017 Mike Becker. All rights reserved.
    15.7 + * Copyright 2018 Mike Becker. All rights reserved.
    15.8   * 
    15.9   * Redistribution and use in source and binary forms, with or without
   15.10   * modification, are permitted provided that the following conditions are met:
   15.11 @@ -21,12 +21,7 @@
   15.12   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   15.13   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   15.14   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   15.15 - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
   15.16 - *
   15.17 - * scanner.c
   15.18 - *
   15.19 - *  Created on: 23.05.2011
   15.20 - *      Author: Mike
   15.21 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   15.22   */
   15.23  
   15.24  
    16.1 --- a/src/scanner.h	Thu Aug 23 17:58:38 2018 +0200
    16.2 +++ b/src/scanner.h	Thu Aug 23 19:45:36 2018 +0200
    16.3 @@ -1,6 +1,6 @@
    16.4  /*
    16.5   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 
    16.6 - * Copyright 2017 Mike Becker. All rights reserved.
    16.7 + * Copyright 2018 Mike Becker. All rights reserved.
    16.8   * 
    16.9   * Redistribution and use in source and binary forms, with or without
   16.10   * modification, are permitted provided that the following conditions are met:
   16.11 @@ -21,12 +21,7 @@
   16.12   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   16.13   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   16.14   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   16.15 - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
   16.16 - *
   16.17 - * scanner.h
   16.18 - *
   16.19 - *  Created on: 23.05.2011
   16.20 - *      Author: Mike
   16.21 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   16.22   */
   16.23  
   16.24  #ifndef SCANNER_H_
    17.1 --- a/src/settings.c	Thu Aug 23 17:58:38 2018 +0200
    17.2 +++ b/src/settings.c	Thu Aug 23 19:45:36 2018 +0200
    17.3 @@ -1,6 +1,6 @@
    17.4  /*
    17.5   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 
    17.6 - * Copyright 2017 Mike Becker. All rights reserved.
    17.7 + * Copyright 2018 Mike Becker. All rights reserved.
    17.8   * 
    17.9   * Redistribution and use in source and binary forms, with or without
   17.10   * modification, are permitted provided that the following conditions are met:
   17.11 @@ -21,12 +21,7 @@
   17.12   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   17.13   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   17.14   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   17.15 - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
   17.16 - *
   17.17 - * settings.c
   17.18 - *
   17.19 - *  Created on: 15.09.2011
   17.20 - *      Author: Mike
   17.21 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   17.22   */
   17.23  
   17.24  #include "settings.h"
    18.1 --- a/src/settings.h	Thu Aug 23 17:58:38 2018 +0200
    18.2 +++ b/src/settings.h	Thu Aug 23 19:45:36 2018 +0200
    18.3 @@ -1,6 +1,6 @@
    18.4  /*
    18.5   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 
    18.6 - * Copyright 2017 Mike Becker. All rights reserved.
    18.7 + * Copyright 2018 Mike Becker. All rights reserved.
    18.8   * 
    18.9   * Redistribution and use in source and binary forms, with or without
   18.10   * modification, are permitted provided that the following conditions are met:
   18.11 @@ -21,12 +21,7 @@
   18.12   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   18.13   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   18.14   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   18.15 - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
   18.16 - *
   18.17 - * settings.h
   18.18 - *
   18.19 - *  Created on: 15.09.2011
   18.20 - *      Author: Mike
   18.21 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   18.22   */
   18.23  
   18.24  #ifndef SETTINGS_H_
    19.1 --- a/src/stdinc.h	Thu Aug 23 17:58:38 2018 +0200
    19.2 +++ b/src/stdinc.h	Thu Aug 23 19:45:36 2018 +0200
    19.3 @@ -1,6 +1,6 @@
    19.4  /*
    19.5   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 
    19.6 - * Copyright 2017 Mike Becker. All rights reserved.
    19.7 + * Copyright 2018 Mike Becker. All rights reserved.
    19.8   * 
    19.9   * Redistribution and use in source and binary forms, with or without
   19.10   * modification, are permitted provided that the following conditions are met:
   19.11 @@ -21,12 +21,7 @@
   19.12   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   19.13   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   19.14   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   19.15 - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
   19.16 - *
   19.17 - * stdinc.h
   19.18 - *
   19.19 - *  Created on: 15.09.2011
   19.20 - *      Author: Mike
   19.21 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   19.22   */
   19.23  
   19.24  #ifndef STDINC_H_
    20.1 --- a/src/string_list.c	Thu Aug 23 17:58:38 2018 +0200
    20.2 +++ b/src/string_list.c	Thu Aug 23 19:45:36 2018 +0200
    20.3 @@ -1,6 +1,6 @@
    20.4  /*
    20.5   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 
    20.6 - * Copyright 2017 Mike Becker. All rights reserved.
    20.7 + * Copyright 2018 Mike Becker. All rights reserved.
    20.8   * 
    20.9   * Redistribution and use in source and binary forms, with or without
   20.10   * modification, are permitted provided that the following conditions are met:
   20.11 @@ -21,12 +21,7 @@
   20.12   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   20.13   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   20.14   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   20.15 - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
   20.16 - *
   20.17 - * string_list.c
   20.18 - *
   20.19 - *  Created on: 15.09.2011
   20.20 - *      Author: Mike
   20.21 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   20.22   */
   20.23  
   20.24  #include "string_list.h"
    21.1 --- a/src/string_list.h	Thu Aug 23 17:58:38 2018 +0200
    21.2 +++ b/src/string_list.h	Thu Aug 23 19:45:36 2018 +0200
    21.3 @@ -1,6 +1,6 @@
    21.4  /*
    21.5   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 
    21.6 - * Copyright 2017 Mike Becker. All rights reserved.
    21.7 + * Copyright 2018 Mike Becker. All rights reserved.
    21.8   * 
    21.9   * Redistribution and use in source and binary forms, with or without
   21.10   * modification, are permitted provided that the following conditions are met:
   21.11 @@ -21,12 +21,7 @@
   21.12   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
   21.13   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   21.14   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   21.15 - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
   21.16 - *
   21.17 - * string_list.h
   21.18 - *
   21.19 - *  Created on: 15.09.2011
   21.20 - *      Author: Mike
   21.21 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   21.22   */
   21.23  
   21.24  #ifndef STRING_LIST_H_
    22.1 --- a/src/suffix_fnc.c	Thu Aug 23 17:58:38 2018 +0200
    22.2 +++ b/src/suffix_fnc.c	Thu Aug 23 19:45:36 2018 +0200
    22.3 @@ -1,6 +1,6 @@
    22.4  /*
    22.5   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 
    22.6 - * Copyright 2017 Mike Becker. All rights reserved.
    22.7 + * Copyright 2018 Mike Becker. All rights reserved.
    22.8   * 
    22.9   * Redistribution and use in source and binary forms, with or without
   22.10   * modification, are permitted provided that the following conditions are met:
   22.11 @@ -22,11 +22,6 @@
   22.12   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   22.13   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   22.14   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
   22.15 - *
   22.16 - * suffix_fnc.c
   22.17 - *
   22.18 - *  Created on: 15.09.2011
   22.19 - *      Author: Mike
   22.20   */
   22.21  
   22.22  #include "suffix_fnc.h"
    23.1 --- a/src/suffix_fnc.h	Thu Aug 23 17:58:38 2018 +0200
    23.2 +++ b/src/suffix_fnc.h	Thu Aug 23 19:45:36 2018 +0200
    23.3 @@ -1,6 +1,6 @@
    23.4  /*
    23.5   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 
    23.6 - * Copyright 2017 Mike Becker. All rights reserved.
    23.7 + * Copyright 2018 Mike Becker. All rights reserved.
    23.8   * 
    23.9   * Redistribution and use in source and binary forms, with or without
   23.10   * modification, are permitted provided that the following conditions are met:
   23.11 @@ -23,10 +23,6 @@
   23.12   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   23.13   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
   23.14   *
   23.15 - * suffix_fnc.h
   23.16 - *
   23.17 - *  Created on: 15.09.2011
   23.18 - *      Author: Mike
   23.19   */
   23.20  
   23.21  #ifndef SUFFIX_FNC_H_
    24.1 --- a/test/Makefile.am	Thu Aug 23 17:58:38 2018 +0200
    24.2 +++ b/test/Makefile.am	Thu Aug 23 19:45:36 2018 +0200
    24.3 @@ -22,4 +22,4 @@
    24.4  # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    24.5  
    24.6  TESTS = $(check_SCRIPTS)
    24.7 -check_SCRIPTS = total.sh nocomments.sh codeonly.sh
    24.8 \ No newline at end of file
    24.9 +check_SCRIPTS = total.sh nocomments.sh codeonly.sh
    25.1 --- a/test/codeonly.sh	Thu Aug 23 17:58:38 2018 +0200
    25.2 +++ b/test/codeonly.sh	Thu Aug 23 19:45:36 2018 +0200
    25.3 @@ -27,5 +27,18 @@
    25.4  # POSSIBILITY OF SUCH DAMAGE.
    25.5  #
    25.6  
    25.7 -echo "Verifying correctness of total line count."
    25.8 +echo -n "Verifying correctness of code only line count: "
    25.9  
   25.10 +clineprg="$(pwd)/../src/cline"
   25.11 +
   25.12 +cd $srcdir
   25.13 +count=`$clineprg -Vs testfile.c --exclude-cstyle-comments --exclude-blank-lines`
   25.14 +expected=5
   25.15 +
   25.16 +if [ "$count" -eq "$expected" ]; then
   25.17 +    echo "OK."
   25.18 +    exit 0;
   25.19 +else
   25.20 +    echo "FAIL! $count is not $expected"
   25.21 +    exit 1;
   25.22 +fi
    26.1 --- a/test/nocomments.sh	Thu Aug 23 17:58:38 2018 +0200
    26.2 +++ b/test/nocomments.sh	Thu Aug 23 19:45:36 2018 +0200
    26.3 @@ -27,5 +27,18 @@
    26.4  # POSSIBILITY OF SUCH DAMAGE.
    26.5  #
    26.6  
    26.7 -echo "Verifying correctness of total line count."
    26.8 +echo -n "Verifying correctness of line count without comments: "
    26.9  
   26.10 +clineprg="$(pwd)/../src/cline"
   26.11 +
   26.12 +cd $srcdir
   26.13 +count=`$clineprg -Vs testfile.c --exclude-cstyle-comments`
   26.14 +expected=12
   26.15 +
   26.16 +if [ "$count" -eq "$expected" ]; then
   26.17 +    echo "OK."
   26.18 +    exit 0;
   26.19 +else
   26.20 +    echo "FAIL! $count is not $expected"
   26.21 +    exit 1;
   26.22 +fi
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/test/testfile.c	Thu Aug 23 19:45:36 2018 +0200
    27.3 @@ -0,0 +1,21 @@
    27.4 +/*
    27.5 + * Many Files have license headers.
    27.6 + */
    27.7 +// And add other stuff below.
    27.8 +
    27.9 +
   27.10 +int main(int argc, char* argv) { // comments behind code don't matter
   27.11 +    
   27.12 +    int zero /* in block comments we are genius enough to
   27.13 +              * detect, if there is still some code in the line
   27.14 +              */ = 0;
   27.15 +    
   27.16 +    /* otherwise the whole comment is
   27.17 +     * not counted*/   
   27.18 +    
   27.19 +    // this holds also for this empty line
   27.20 +    
   27.21 +    return zero;
   27.22 +}
   27.23 +
   27.24 +/* rare case, but must also work: last line is a comment */
   27.25 \ No newline at end of file
    28.1 --- a/test/total.sh	Thu Aug 23 17:58:38 2018 +0200
    28.2 +++ b/test/total.sh	Thu Aug 23 19:45:36 2018 +0200
    28.3 @@ -27,5 +27,18 @@
    28.4  # POSSIBILITY OF SUCH DAMAGE.
    28.5  #
    28.6  
    28.7 -echo "Verifying correctness of total line count."
    28.8 +echo -n "Verifying correctness of total line count: "
    28.9  
   28.10 +clineprg="$(pwd)/../src/cline"
   28.11 +
   28.12 +cd $srcdir
   28.13 +count=`$clineprg -Vs testfile.c`
   28.14 +expected=21
   28.15 +
   28.16 +if [ "$count" -eq "$expected" ]; then
   28.17 +    echo "OK."
   28.18 +    exit 0;
   28.19 +else
   28.20 +    echo "FAIL! $count is not $expected"
   28.21 +    exit 1;
   28.22 +fi

mercurial