aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCyril Hrubis <chrubis@suse.cz>2019-03-06 16:24:29 +0100
committerCyril Hrubis <chrubis@suse.cz>2019-03-26 10:32:47 +0100
commitce08216e743f3a319068299d304f90a1dbafcd29 (patch)
tree26d7c7439fb606eb4011f6d42c43127c2d23f8c5 /include
parent5085e14c7e7a8493895439cbe02faa65dddc0d7f (diff)
tst_test: Add test variants
The test variants are intended for running the test more than once for a different settings. The indended purpose is to run tests for both libc wrapper and raw syscall as well as for different syscall variants. The commit itself adds a test_variant integer that, if set, denotes number of test variants. The test is then forked and executed test_variant times each time with different value in global tst_variant variable. Signed-off-by: Cyril Hrubis <chrubis@suse.cz> Reviewed-by: Steve Muckle <smuckle@google.com> Reviewed-by: Petr Vorel <pvorel@suse.cz> Acked-by: Jan Stancek <jstancek@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/tst_test.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/tst_test.h b/include/tst_test.h
index da41f776d..cf2447fe3 100644
--- a/include/tst_test.h
+++ b/include/tst_test.h
@@ -114,6 +114,8 @@ int tst_parse_int(const char *str, int *val, int min, int max);
int tst_parse_long(const char *str, long *val, long min, long max);
int tst_parse_float(const char *str, float *val, float min, float max);
+extern unsigned int tst_variant;
+
struct tst_test {
/* number of tests available in test() function */
unsigned int tcnt;
@@ -146,6 +148,16 @@ struct tst_test {
*/
int all_filesystems:1;
+ /*
+ * If set non-zero denotes number of test variant, the test is executed
+ * variants times each time with tst_variant set to different number.
+ *
+ * This allows us to run the same test for different settings. The
+ * intended use is to test different syscall wrappers/variants but the
+ * API is generic and does not limit the usage in any way.
+ */
+ unsigned int test_variants;
+
/* Minimal device size in megabytes */
unsigned int dev_min_size;