From 2a5fcfae024ffc370bb780572279f45a1da3f946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 19 Dec 2017 10:13:34 +0000 Subject: more portable perl shebangs (#7701) same motivation as in #5816: - distributions have scripts to rewrite shebangs on installation and they know what locations to rely on. - For tests/compilation we should rather rely on the user to have setup there PATH correctly. --- tools/check-includes.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/check-includes.pl b/tools/check-includes.pl index bf23929d47..6aae7c1534 100755 --- a/tools/check-includes.pl +++ b/tools/check-includes.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # # checkincludes: Find files included more than once in (other) files. # Copyright abandoned, 2000, Niels Kristian Bech Jensen . -- cgit v1.2.3 From 7629744a3dbca313b55882d3a63135b2a9b27805 Mon Sep 17 00:00:00 2001 From: bleep_blop Date: Sun, 24 Dec 2017 06:53:20 +0000 Subject: separate flags from shebang --- tools/add-git-hook.sh | 3 ++- tools/find-build-dir.sh | 3 ++- tools/meson-check-compilation.sh | 3 ++- tools/meson-check-help.sh | 3 ++- tools/meson-git-contrib.sh | 3 ++- tools/meson-hwdb-update.sh | 3 ++- tools/meson-make-symlink.sh | 3 ++- 7 files changed, 14 insertions(+), 7 deletions(-) (limited to 'tools') diff --git a/tools/add-git-hook.sh b/tools/add-git-hook.sh index 4ee919faf4..c1db99b18a 100755 --- a/tools/add-git-hook.sh +++ b/tools/add-git-hook.sh @@ -1,4 +1,5 @@ -#!/bin/sh -eu +#!/bin/sh +set -eu cd "$MESON_SOURCE_ROOT" diff --git a/tools/find-build-dir.sh b/tools/find-build-dir.sh index 33b40f93f7..06b6297ea5 100755 --- a/tools/find-build-dir.sh +++ b/tools/find-build-dir.sh @@ -1,4 +1,5 @@ -#!/bin/sh -e +#!/bin/sh +set -e # Try to guess the build directory: # we look for subdirectories of the parent directory that look like ninja build dirs. diff --git a/tools/meson-check-compilation.sh b/tools/meson-check-compilation.sh index d3b2a312fd..ce39e1684b 100755 --- a/tools/meson-check-compilation.sh +++ b/tools/meson-check-compilation.sh @@ -1,3 +1,4 @@ -#!/bin/sh -eu +#!/bin/sh +set -eu "$@" '-' -o/dev/null Date: Wed, 20 Dec 2017 12:51:14 +0100 Subject: meson: resurrect API documentation target We had this functionality back in Automake times, let's resurrect it. --- tools/meson-check-api-docs.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tools/meson-check-api-docs.sh (limited to 'tools') diff --git a/tools/meson-check-api-docs.sh b/tools/meson-check-api-docs.sh new file mode 100644 index 0000000000..5bc808c1e4 --- /dev/null +++ b/tools/meson-check-api-docs.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +set -eu + +for symbol in `nm -g --defined-only "$@" | grep " T " | cut -d" " -f3 | sort -u` ; do + if test -f ${MESON_BUILD_ROOT}/man/$symbol.3 ; then + echo "✓ Symbol $symbol() is documented." + else + printf " \x1b[1;31mSymbol $symbol() lacks documentation.\x1b[0m\n" + fi +done -- cgit v1.2.3 From 7db7d5b73368fde010a258a5b2c48faf0d3e82c8 Mon Sep 17 00:00:00 2001 From: Jonathan Rudenberg Date: Sat, 13 Jan 2018 19:51:07 -0500 Subject: fuzz: add initial fuzzing infrastructure The fuzzers will be used by oss-fuzz to automatically and continuously fuzz systemd. This commit includes the build tooling necessary to build fuzz targets, and a fuzzer for the DNS packet parser. --- tools/meson-check-api-docs.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tools/meson-check-api-docs.sh (limited to 'tools') diff --git a/tools/meson-check-api-docs.sh b/tools/meson-check-api-docs.sh old mode 100644 new mode 100755 -- cgit v1.2.3 From b68dfb9e83dc2d12cf9d8ae5ef3ddaca537a8519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 19 Jan 2018 17:54:30 +1100 Subject: Hook up oss-fuzz test cases as tests This is a bit painful because a separate build of systemd is necessary. The tests are guarded by tests!=false and slow-tests==true. Running them is not slow, but compilation certainly is. If this proves unwieldy, we can add a separate option controlling those builds later. The build for each sanitizer has its own directory, and we build all fuzzer tests there, and then pull them out one-by-one by linking into the target position as necessary. It would be nicer to just build the desired fuzzer, but we need to build the whole nested build as one unit. [I also tried making systemd and nested meson subproject. This would work nicely, but meson does not allow that because the nested target names are the same as the outer project names. If that is ever fixed, that would be the way to go.] v2: - make sure things still work if memory sanitizer is not available v3: - switch to syntax which works with meson 0.42.1 found in Ubuntu --- tools/meson-build.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 tools/meson-build.sh (limited to 'tools') diff --git a/tools/meson-build.sh b/tools/meson-build.sh new file mode 100755 index 0000000000..302749d8ed --- /dev/null +++ b/tools/meson-build.sh @@ -0,0 +1,10 @@ +#!/bin/sh +set -eux + +src="$1" +dst="$2" +target="$3" +options="$4" + +[ -d "$dst" ] || meson "$src" "$dst" $options +ninja -C "$dst" "$target" -- cgit v1.2.3 From 7c4a80727732296c6311a8366888fe0b6a124fda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Osman=20Ta=C5=9Fkaya?= Date: Sat, 27 Jan 2018 16:03:08 +0300 Subject: [gdb-sd_dump_hashmaps.py] String Formatting Update (#7819) Changes: % changed as .format() --- tools/gdb-sd_dump_hashmaps.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tools') diff --git a/tools/gdb-sd_dump_hashmaps.py b/tools/gdb-sd_dump_hashmaps.py index b3c356b579..7f5d31eca6 100644 --- a/tools/gdb-sd_dump_hashmaps.py +++ b/tools/gdb-sd_dump_hashmaps.py @@ -51,7 +51,7 @@ class sd_dump_hashmaps(gdb.Command): t = ["plain", "ordered", "set"][int(h["type"])] - print "%s, %s, %s, %d, %d, %d, %s (%s:%d)" % (t, h["hash_ops"], bool(h["has_indirect"]), n_entries, d["max_entries"], n_buckets, d["func"], d["file"], d["line"]) + print "{}, {}, {}, {}, {}, {}, {} ({}:{})".format(t, h["hash_ops"], bool(h["has_indirect"]), n_entries, d["max_entries"], n_buckets, d["func"], d["file"], d["line"]) if arg != "" and n_entries > 0: dib_raw_addr = storage_ptr + (all_entry_sizes[h["type"]] * n_buckets) @@ -63,10 +63,10 @@ class sd_dump_hashmaps(gdb.Command): for dib in sorted(iter(histogram)): if dib != 255: - print "%3d %8d %f%% of entries" % (dib, histogram[dib], 100.0*histogram[dib]/n_entries) + print "{:>3} {:>8} {} of entries".format(dib, histogram[dib], 100.0*histogram[dib]/n_entries) else: - print "%3d %8d %f%% of slots" % (dib, histogram[dib], 100.0*histogram[dib]/n_buckets) - print "mean DIB of entries: %f" % (sum([dib*histogram[dib] for dib in iter(histogram) if dib != 255])*1.0/n_entries) + print "{:>3} {:>8} {} of slots".format(dib, histogram[dib], 100.0*histogram[dib]/n_buckets) + print "mean DIB of entries: {}".format(sum([dib*histogram[dib] for dib in iter(histogram) if dib != 255])*1.0/n_entries) blocks = [] current_len = 1 @@ -87,9 +87,9 @@ class sd_dump_hashmaps(gdb.Command): if len(blocks) > 1 and blocks[0][0] == blocks[0][1] and blocks[-1][0] == n_buckets - 1: blocks[0][1] += blocks[-1][1] blocks = blocks[0:-1] - print "max block: %s" % max(blocks, key=lambda a: a[1]) - print "sum block lens: %d" % sum(b[1] for b in blocks) - print "mean block len: %f" % (1.0 * sum(b[1] for b in blocks) / len(blocks)) + print "max block: {}".format(max(blocks, key=lambda a: a[1])) + print "sum block lens: {}".format(sum(b[1] for b in blocks)) + print "mean block len: {}".format((1.0 * sum(b[1] for b in blocks) / len(blocks))) d = d["debug_list_next"] -- cgit v1.2.3