mirror of
https://github.com/curl/curl.git
synced 2026-05-14 22:16:19 +03:00
To avoid redundant work in CI and to avoid a single checksrc issue make all autotools jobs fail. After this patch checksrc issues make fail the checksrc job, the `dist / verify-out-of-tree-autotools-debug`, `dist / maketgz-and-verify-in-tree` jobs and the fuzzer job (if run). Of these, the `dist` jobs replicate local builds, also testing the build logic. Also add a script to check the complete local repository, optionally with the build tree to verify generated C files. Also: - automatically run checksrc in subdirectories having a `checksrc` target. (examples, OS400, tests http/client, unit and tunit) - tests/libtest: make sure to run `checksrc` on generated `lib1521.c`. (requires in-tree autotools build.) - tests: run `checksrc` on targets also for non-`DEBUGBUILD` builds. It ensures to check `lib1521.c` in CI via job `dist / maketgz-and-verify-in-tree`. - src: drop redundant `$(builddir)` in autotools builds. - scripts: add `checksrc-all.sh` script to check all C sources and the build directory as an option. - use the above from CI, also make it verify all generated sources. - silence `checksrc` issues in generated C sources. - checksrc: add `-v` option to enable verbose mode. - checksrc: make verbose mode show checked filename and fix to only return error on failure. - make sure that generated C files pass `checksrc`. Assisted-by: Daniel Stenberg Closes #17376
62 lines
1.7 KiB
Perl
Executable file
62 lines
1.7 KiB
Perl
Executable file
#!/usr/bin/env perl
|
|
#***************************************************************************
|
|
# _ _ ____ _
|
|
# Project ___| | | | _ \| |
|
|
# / __| | | | |_) | |
|
|
# | (__| |_| | _ <| |___
|
|
# \___|\___/|_| \_\_____|
|
|
#
|
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
|
#
|
|
# This software is licensed as described in the file COPYING, which
|
|
# you should have received as part of this distribution. The terms
|
|
# are also available at https://curl.se/docs/copyright.html.
|
|
#
|
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
# copies of the Software, and permit persons to whom the Software is
|
|
# furnished to do so, under the terms of the COPYING file.
|
|
#
|
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
# KIND, either express or implied.
|
|
#
|
|
# SPDX-License-Identifier: curl
|
|
#
|
|
###########################################################################
|
|
|
|
my $varname = "var";
|
|
if($ARGV[0] eq "--var") {
|
|
shift;
|
|
$varname = shift @ARGV;
|
|
}
|
|
|
|
my $varname_upper = uc($varname);
|
|
|
|
print <<HEAD
|
|
/*
|
|
* NEVER EVER edit this manually, fix the mk-file-embed.pl script instead!
|
|
*/
|
|
/* !checksrc! disable COPYRIGHT all */
|
|
#ifndef CURL_DECLARED_${varname_upper}
|
|
#define CURL_DECLARED_${varname_upper}
|
|
extern const unsigned char ${varname}[];
|
|
#endif
|
|
const unsigned char ${varname}[] = {
|
|
HEAD
|
|
;
|
|
|
|
while (<STDIN>) {
|
|
my $line = $_;
|
|
foreach my $n (split //, $line) {
|
|
my $ord = ord($n);
|
|
printf("%s,", $ord);
|
|
if($ord == 10) {
|
|
printf("\n");
|
|
}
|
|
}
|
|
}
|
|
|
|
print <<ENDLINE
|
|
0
|
|
};
|
|
ENDLINE
|
|
;
|