Chromium Code Reviews| Index: tools/memory/suppression_string_gen.sh |
| diff --git a/tools/memory/suppression_string_gen.sh b/tools/memory/suppression_string_gen.sh |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..f259b4c560f8f17909528682dcfade30b35f9cf4 |
| --- /dev/null |
| +++ b/tools/memory/suppression_string_gen.sh |
| @@ -0,0 +1,18 @@ |
| +#!/bin/sh |
| + |
| +# Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +# This script generates a C source declaring a string with the contents of a |
| +# given file. |
| +# Usage: |
| +# ./suppression_string_gen.sh <variable_name> <input> <output> |
| + |
|
Nico
2014/05/27 15:42:30
set -eu?
Alexander Potapenko
2014/05/28 10:34:38
Done.
|
| +varname=$1 |
| +infile=$2 |
| +outfile=$3 |
| + |
| +echo "char ${varname}[] =" > ${outfile} |
| +cat ${infile} | awk '{printf("\"%s\\n\"\n", $0)}' >> ${outfile} |
| +echo ";" >> ${outfile} |