From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757989Ab2AEDsf (ORCPT ); Wed, 4 Jan 2012 22:48:35 -0500 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.125]:34876 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757812Ab2AEDsY (ORCPT ); Wed, 4 Jan 2012 22:48:24 -0500 X-Authority-Analysis: v=2.0 cv=Pb19d1dd c=1 sm=0 a=ZycB6UtQUfgMyuk2+PxD7w==:17 a=UBy9sU4F98IA:10 a=u5b5jYH3iYYA:10 a=5SG0PmZfjMsA:10 a=bbbx4UPp9XUA:10 a=20KFwNOVAAAA:8 a=meVymXHHAAAA:8 a=N3sU0LYnj-Dbrz2zWEIA:9 a=QEXdDO2ut3YA:10 a=jEp0ucaQiEUA:10 a=jeBq3FmKZ4MA:10 a=xNilgelrD4XSi3OPj8AA:9 a=ZycB6UtQUfgMyuk2+PxD7w==:117 X-Cloudmark-Score: 0 X-Originating-IP: 74.67.80.29 Message-Id: <20120105034822.324046634@goodmis.org> User-Agent: quilt/0.50-1 Date: Wed, 04 Jan 2012 22:48:00 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds Subject: [PATCH 05/20] ktest: When creating new config, allow the use of ${THIS_DIR} References: <20120105034755.793909214@goodmis.org> Content-Disposition: inline; filename=0005-ktest-When-creating-new-config-allow-the-use-of-THIS.patch Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="00GvhwF7k39YY" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --00GvhwF7k39YY Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: Steven Rostedt Typing in a full path when you know that the path exists within the directory your are running is tedious and unnecessary. Allow the user to use ${PWD} if they want a dynamic path name which will be the path that ktest.pl is executed from or use ${THIS_DIR} which is a variable assigned `pwd` and the the variable will exist within the config, allowing the user to change it and affect all other paths using this variable as well Signed-off-by: Steven Rostedt --- tools/testing/ktest/ktest.pl | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 deletions(-) diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index 05f429d..77b4649 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -158,11 +158,15 @@ EOF ; $config_help{"BUILD_DIR"} =3D << "EOF" The directory that contains the Linux source code (full path). + You can use \${PWD} that will be the path where ktest.pl is run, or use + \${THIS_DIR} which is assigned \${PWD} but may be changed later. EOF ; $config_help{"OUTPUT_DIR"} =3D << "EOF" The directory that the objects will be built (full path). (can not be same as BUILD_DIR) + You can use \${PWD} that will be the path where ktest.pl is run, or use + \${THIS_DIR} which is assigned \${PWD} but may be changed later. EOF ; $config_help{"BUILD_TARGET"} =3D << "EOF" @@ -282,7 +286,7 @@ sub get_ktest_config { next; } } - $entered_configs{$config} =3D process_variables($ans); + $entered_configs{$config} =3D ${ans}; last; } } @@ -3012,6 +3016,17 @@ if (! -f $ktest_config) { print OUT << "EOF" # Generated by ktest.pl # + +# PWD is a ktest.pl variable that will result in the process working +# directory that ktest.pl is executed in. + +# THIS_DIR is automatically assigned the PWD of the path that generated +# the config file. It is best to use this variable when assigning other +# directory paths within this directory. This allows you to easily +# move the test cases to other locations or to other machines. +# +THIS_DIR :=3D $variable{"PWD"} + # Define each test with TEST_START # The config options below it will override the defaults TEST_START @@ -3034,7 +3049,7 @@ if ($#new_configs >=3D 0) { open(OUT, ">>$ktest_config") or die "Can not append to $ktest_config"; foreach my $config (@new_configs) { print OUT "$config =3D $entered_configs{$config}\n"; - $opt{$config} =3D $entered_configs{$config}; + $opt{$config} =3D process_variables($entered_configs{$config}); } } =20 --=20 1.7.7.3 --00GvhwF7k39YY Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAABAgAGBQJPBR2GAAoJEIy3vGnGbaoAfwcQAMPwS0gCwox23crV+z/9fvOG h8cQlpFvTKujxXAtEKrvS/w8AmPSCysru6VVOUHA2d28vvT1CZMUo+w7mJsGSBdF mj9DpTc7BEmy9s8rMXRf4N7NBkBg4N12zlLTUXJ+hhkZa94iNxzbZAy74CWQb6dL Yhvvu7w+fD0AS4vuTuSycDKNCS92VT9mrTx8r+0nFXRHiJ05t0itZaSFVFG3BeRX L9UF0DUwh6VetA6nNVJgcsysVVkR53aAgByRXlp9oP2qPv33QeBxKf8hlLuNIndD zBjHy5EwSP+qrnhrO6p9RomQvS30kD8QwvZC8zPQNUAL7eLy+aq3PA1ByAl0xWUr ql94hb1oLgCkTfA6Qgk+Fuh9llNy/qDzkTyZOaX+I+aDmXVX+gntpr+uBKZYLhBJ LGUxWi2AGJLFMbyyCihC8CPj8+UDtBBiM7/uyrWrrA+h7jvhMXFC/zjWz2CINBQv nkgCaJlkZZQZ6+a/r+QNIqy4/ODYHLd+IkHuAnydB0Pte9Xdbfm6A+ZyeT3v0U0W qMP+hnTr13seBqmPnAiHVnq7xJHNLHJPlj0rjYEBuyeOF8rtnhSOwkzVG7sM4cEM FRbPXMB690L34LFGwJUx1ktC63g4zIHKdcHKCpwXiiatwGtogQnZe+AlP9kgCwmr mLxQ1TsgpffjMmgMyaSb =5tuX -----END PGP SIGNATURE----- --00GvhwF7k39YY--