aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing
diff options
context:
space:
mode:
authorJon Hunter <jon-hunter@ti.com>2013-04-01 15:33:50 -0400
committerJon Hunter <jon-hunter@ti.com>2013-04-01 15:33:50 -0400
commitdca3a783400a18e2bf4503b1d4a85c4d0ca1a7e4 (patch)
treea3689b801070c1360b120b7280c6adc4de5f692a /tools/testing
parent71856843fb1d8ee455a4c1a60696c74afa4809e5 (diff)
parent31d9adca82ce65e5c99d045b5fd917c702b6fce3 (diff)
Merge commit '31d9adca82ce65e5c99d045b5fd917c702b6fce3' into tmp
Conflicts: arch/arm/plat-omap/dmtimer.c
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/ktest/examples/include/patchcheck.conf37
-rwxr-xr-xtools/testing/ktest/ktest.pl190
-rw-r--r--tools/testing/ktest/sample.conf44
-rw-r--r--tools/testing/selftests/Makefile8
-rw-r--r--tools/testing/selftests/README.txt42
-rw-r--r--tools/testing/selftests/efivarfs/Makefile12
-rw-r--r--tools/testing/selftests/efivarfs/create-read.c38
-rw-r--r--tools/testing/selftests/efivarfs/efivarfs.sh139
-rw-r--r--tools/testing/selftests/efivarfs/open-unlink.c63
9 files changed, 554 insertions, 19 deletions
diff --git a/tools/testing/ktest/examples/include/patchcheck.conf b/tools/testing/ktest/examples/include/patchcheck.conf
index 339d3e1700ff..0eb0a5ac77da 100644
--- a/tools/testing/ktest/examples/include/patchcheck.conf
+++ b/tools/testing/ktest/examples/include/patchcheck.conf
@@ -14,6 +14,16 @@
14PATCH_START := HEAD~3 14PATCH_START := HEAD~3
15PATCH_END := HEAD 15PATCH_END := HEAD
16 16
17# Use the oldconfig if build_type wasn't defined
18DEFAULTS IF NOT DEFINED BUILD_TYPE
19DO_BUILD_TYPE := oldconfig
20
21DEFAULTS ELSE
22DO_BUILD_TYPE := ${BUILD_TYPE}
23
24DEFAULTS
25
26
17# Change PATCH_CHECKOUT to be the branch you want to test. The test will 27# Change PATCH_CHECKOUT to be the branch you want to test. The test will
18# do a git checkout of this branch before starting. Obviously both 28# do a git checkout of this branch before starting. Obviously both
19# PATCH_START and PATCH_END must be in this branch (and PATCH_START must 29# PATCH_START and PATCH_END must be in this branch (and PATCH_START must
@@ -43,6 +53,31 @@ PATCH_TEST_TYPE := boot
43# (space delimited) 53# (space delimited)
44#IGNORE_WARNINGS = 39eaf7ef884dcc44f7ff1bac803ca2a1dcf43544 6edb2a8a385f0cdef51dae37ff23e74d76d8a6ce 54#IGNORE_WARNINGS = 39eaf7ef884dcc44f7ff1bac803ca2a1dcf43544 6edb2a8a385f0cdef51dae37ff23e74d76d8a6ce
45 55
56# Instead of just checking for warnings to files that are changed
57# it can be advantageous to check for any new warnings. If a
58# header file is changed, it could cause a warning in a file not
59# touched by the commit. To detect these kinds of warnings, you
60# can use the WARNINGS_FILE option.
61#
62# If the variable CREATE_WARNINGS_FILE is set, this config will
63# enable the WARNINGS_FILE during the patchcheck test. Also,
64# before running the patchcheck test, it will create the
65# warnings file.
66#
67DEFAULTS IF DEFINED CREATE_WARNINGS_FILE
68WARNINGS_FILE = ${OUTPUT_DIR}/warnings_file
69
70TEST_START IF DEFINED CREATE_WARNINGS_FILE
71# WARNINGS_FILE is already set by the DEFAULTS above
72TEST_TYPE = make_warnings_file
73# Checkout the commit before the patches to test,
74# and record all the warnings that exist before the patches
75# to test are added
76CHECKOUT = ${PATCHCHECK_START}~1
77# Force a full build
78BUILD_NOCLEAN = 0
79BUILD_TYPE = ${DO_BUILD_TYPE}
80
46# If you are running a multi test, and the test failed on the first 81# If you are running a multi test, and the test failed on the first
47# test but on, say the 5th patch. If you want to restart on the 82# test but on, say the 5th patch. If you want to restart on the
48# fifth patch, set PATCH_START1. This will make the first test start 83# fifth patch, set PATCH_START1. This will make the first test start
@@ -61,6 +96,7 @@ PATCHCHECK_TYPE = ${PATCH_TEST_TYPE}
61PATCHCHECK_START = ${PATCH_START1} 96PATCHCHECK_START = ${PATCH_START1}
62PATCHCHECK_END = ${PATCH_END} 97PATCHCHECK_END = ${PATCH_END}
63CHECKOUT = ${PATCH_CHECKOUT} 98CHECKOUT = ${PATCH_CHECKOUT}
99BUILD_TYPE = ${DO_BUILD_TYPE}
64 100
65TEST_START IF ${TEST} == patchcheck && ${MULTI} 101TEST_START IF ${TEST} == patchcheck && ${MULTI}
66TEST_TYPE = patchcheck 102TEST_TYPE = patchcheck
@@ -72,3 +108,4 @@ PATCHCHECK_END = ${PATCH_END}
72CHECKOUT = ${PATCH_CHECKOUT} 108CHECKOUT = ${PATCH_CHECKOUT}
73# Use multi to test different compilers? 109# Use multi to test different compilers?
74MAKE_CMD = CC=gcc-4.5.1 make 110MAKE_CMD = CC=gcc-4.5.1 make
111BUILD_TYPE = ${DO_BUILD_TYPE}
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 35fc584a4ffe..4e67d52eb3a2 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -126,6 +126,7 @@ my $start_minconfig_defined;
126my $output_minconfig; 126my $output_minconfig;
127my $minconfig_type; 127my $minconfig_type;
128my $use_output_minconfig; 128my $use_output_minconfig;
129my $warnings_file;
129my $ignore_config; 130my $ignore_config;
130my $ignore_errors; 131my $ignore_errors;
131my $addconfig; 132my $addconfig;
@@ -193,6 +194,9 @@ my $patchcheck_end;
193# which would require more options. 194# which would require more options.
194my $buildonly = 1; 195my $buildonly = 1;
195 196
197# tell build not to worry about warnings, even when WARNINGS_FILE is set
198my $warnings_ok = 0;
199
196# set when creating a new config 200# set when creating a new config
197my $newconfig = 0; 201my $newconfig = 0;
198 202
@@ -235,6 +239,7 @@ my %option_map = (
235 "START_MIN_CONFIG" => \$start_minconfig, 239 "START_MIN_CONFIG" => \$start_minconfig,
236 "MIN_CONFIG_TYPE" => \$minconfig_type, 240 "MIN_CONFIG_TYPE" => \$minconfig_type,
237 "USE_OUTPUT_MIN_CONFIG" => \$use_output_minconfig, 241 "USE_OUTPUT_MIN_CONFIG" => \$use_output_minconfig,
242 "WARNINGS_FILE" => \$warnings_file,
238 "IGNORE_CONFIG" => \$ignore_config, 243 "IGNORE_CONFIG" => \$ignore_config,
239 "TEST" => \$run_test, 244 "TEST" => \$run_test,
240 "ADD_CONFIG" => \$addconfig, 245 "ADD_CONFIG" => \$addconfig,
@@ -619,6 +624,18 @@ sub set_value {
619 # Note if a test is something other than build, then we 624 # Note if a test is something other than build, then we
620 # will need other manditory options. 625 # will need other manditory options.
621 if ($prvalue ne "install") { 626 if ($prvalue ne "install") {
627 # for bisect, we need to check BISECT_TYPE
628 if ($prvalue ne "bisect") {
629 $buildonly = 0;
630 }
631 } else {
632 # install still limits some manditory options.
633 $buildonly = 2;
634 }
635 }
636
637 if ($buildonly && $lvalue =~ /^BISECT_TYPE(\[.*\])?$/ && $prvalue ne "build") {
638 if ($prvalue ne "install") {
622 $buildonly = 0; 639 $buildonly = 0;
623 } else { 640 } else {
624 # install still limits some manditory options. 641 # install still limits some manditory options.
@@ -1062,7 +1079,7 @@ sub read_config {
1062} 1079}
1063 1080
1064sub __eval_option { 1081sub __eval_option {
1065 my ($option, $i) = @_; 1082 my ($name, $option, $i) = @_;
1066 1083
1067 # Add space to evaluate the character before $ 1084 # Add space to evaluate the character before $
1068 $option = " $option"; 1085 $option = " $option";
@@ -1094,7 +1111,11 @@ sub __eval_option {
1094 my $o = "$var\[$i\]"; 1111 my $o = "$var\[$i\]";
1095 my $parento = "$var\[$parent\]"; 1112 my $parento = "$var\[$parent\]";
1096 1113
1097 if (defined($opt{$o})) { 1114 # If a variable contains itself, use the default var
1115 if (($var eq $name) && defined($opt{$var})) {
1116 $o = $opt{$var};
1117 $retval = "$retval$o";
1118 } elsif (defined($opt{$o})) {
1098 $o = $opt{$o}; 1119 $o = $opt{$o};
1099 $retval = "$retval$o"; 1120 $retval = "$retval$o";
1100 } elsif ($repeated && defined($opt{$parento})) { 1121 } elsif ($repeated && defined($opt{$parento})) {
@@ -1118,7 +1139,7 @@ sub __eval_option {
1118} 1139}
1119 1140
1120sub eval_option { 1141sub eval_option {
1121 my ($option, $i) = @_; 1142 my ($name, $option, $i) = @_;
1122 1143
1123 my $prev = ""; 1144 my $prev = "";
1124 1145
@@ -1134,7 +1155,7 @@ sub eval_option {
1134 "Check for recursive variables\n"; 1155 "Check for recursive variables\n";
1135 } 1156 }
1136 $prev = $option;