diff options
author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2013-12-11 15:40:46 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2013-12-11 15:53:31 -0500 |
commit | 8e80bf05ff7e7bda6f1683b1201ada56c4efa4c1 (patch) | |
tree | 1f0163a5642e0b11e334ad2df872047252a5de07 | |
parent | 298a0d1d575026edec7fbb9b7e8cbb8fe18498cd (diff) |
ktest: Add special variable ${KERNEL_VERSION}
Add a special variable that can be used in other variables called
${KERNEL_VERSION}. This will embed the current kernel version into
the variable. For example:
WARNINGS_FILE = ${OUTPUT_DIR}/warnings-${KERNEL_VERSION}
If the current version is v3.8 then the WARNINGS_FILE will become
${OUTPUT_DIR}/warnings-v3.8
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rwxr-xr-x | tools/testing/ktest/ktest.pl | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index 5dc5704d8680..b285933873c7 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl | |||
@@ -1129,6 +1129,10 @@ sub __eval_option { | |||
1129 | } elsif (defined($opt{$var})) { | 1129 | } elsif (defined($opt{$var})) { |
1130 | $o = $opt{$var}; | 1130 | $o = $opt{$var}; |
1131 | $retval = "$retval$o"; | 1131 | $retval = "$retval$o"; |
1132 | } elsif ($var eq "KERNEL_VERSION" && defined($make)) { | ||
1133 | # special option KERNEL_VERSION uses kernel version | ||
1134 | get_version(); | ||
1135 | $retval = "$retval$version"; | ||
1132 | } else { | 1136 | } else { |
1133 | $retval = "$retval\$\{$var\}"; | 1137 | $retval = "$retval\$\{$var\}"; |
1134 | } | 1138 | } |
@@ -3919,6 +3923,18 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) { | |||
3919 | 3923 | ||
3920 | my $makecmd = set_test_option("MAKE_CMD", $i); | 3924 | my $makecmd = set_test_option("MAKE_CMD", $i); |
3921 | 3925 | ||
3926 | $outputdir = set_test_option("OUTPUT_DIR", $i); | ||
3927 | $builddir = set_test_option("BUILD_DIR", $i); | ||
3928 | |||
3929 | chdir $builddir || die "can't change directory to $builddir"; | ||
3930 | |||
3931 | if (!-d $outputdir) { | ||
3932 | mkpath($outputdir) or | ||
3933 | die "can't create $outputdir"; | ||
3934 | } | ||
3935 | |||
3936 | $make = "$makecmd O=$outputdir"; | ||
3937 | |||
3922 | # Load all the options into their mapped variable names | 3938 | # Load all the options into their mapped variable names |
3923 | foreach my $opt (keys %option_map) { | 3939 | foreach my $opt (keys %option_map) { |
3924 | ${$option_map{$opt}} = set_test_option($opt, $i); | 3940 | ${$option_map{$opt}} = set_test_option($opt, $i); |
@@ -3943,13 +3959,9 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) { | |||
3943 | $start_minconfig = $minconfig; | 3959 | $start_minconfig = $minconfig; |
3944 | } | 3960 | } |
3945 | 3961 | ||
3946 | chdir $builddir || die "can't change directory to $builddir"; | 3962 | if (!-d $tmpdir) { |
3947 | 3963 | mkpath($tmpdir) or | |
3948 | foreach my $dir ($tmpdir, $outputdir) { | 3964 | die "can't create $tmpdir"; |
3949 | if (!-d $dir) { | ||
3950 | mkpath($dir) or | ||
3951 | die "can't create $dir"; | ||
3952 | } | ||
3953 | } | 3965 | } |
3954 | 3966 | ||
3955 | $ENV{"SSH_USER"} = $ssh_user; | 3967 | $ENV{"SSH_USER"} = $ssh_user; |
@@ -3958,7 +3970,6 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) { | |||
3958 | $buildlog = "$tmpdir/buildlog-$machine"; | 3970 | $buildlog = "$tmpdir/buildlog-$machine"; |
3959 | $testlog = "$tmpdir/testlog-$machine"; | 3971 | $testlog = "$tmpdir/testlog-$machine"; |
3960 | $dmesg = "$tmpdir/dmesg-$machine"; | 3972 | $dmesg = "$tmpdir/dmesg-$machine"; |
3961 | $make = "$makecmd O=$outputdir"; | ||
3962 | $output_config = "$outputdir/.config"; | 3973 | $output_config = "$outputdir/.config"; |
3963 | 3974 | ||
3964 | if (!$buildonly) { | 3975 | if (!$buildonly) { |