lib: warning messages should be sent to stderr
PATCH 1/3 lib: warning messages should be sent to stderr
This is a regression from commit df11a0f (lib: add a critical warning level).
Signed-off-by Thomas Wood <[email protected]>
--- lib/igt_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/igt_core.c +1 -1
@@ -1522,7 +1522,7 @@ void igt_vlog(const char *domain, enum igt_log_level level, const char *format,return ; } -if (level >IGT_LOG_WARN ) { +if (level >=IGT_LOG_WARN ) { file = stderr;fflush (stdout); }
Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/3 lib: print warning and critical messages when listing subtests
These messages are sent to stderr and could indicate an issue when enumerating subtests.
Signed-off-by Thomas Wood <[email protected]>
--- lib/igt_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/igt_core.c +1 -1
@@ -1507,7 +1507,7 @@ void igt_vlog(const char *domain, enum igt_log_level level, const char *format, program_name = command_str;#endif -if (list_subtests) +if (list_subtests && level <=IGT_LOG_WARN )return ;if (igt_log_level > level)
Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/3 lib: validate subtest names
In reply to Thomas WoodSubtest names should only contain '-', '_' and alphanumeric characters.
Signed-off-by Thomas Wood <[email protected]>
--- lib/igt_core.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
lib/igt_core.c +12 -0
@@ -54,6 +54,7 @@#include <termios.h> #include <errno.h> #include <time.h> +#include <ctype.h> #include "drmtest.h" #include "intel_chipset.h"
@@ -693,10 +694,21 @@ void igt_simple_init_parse_opts(int argc, char **argv,*/ bool __igt_run_subtest (const char *subtest_name) { +int i; +assert (!in_subtest);assert (!in_fixture);assert (test_with_subtests); +/* check the subtest name only contains a-z, A-Z, 0-9, '-' and '_' */ +for (i =0 ; subtest_name[i] !='\0' ; i++) +if (subtest_name[i] !='_' && subtest_name[i] !='-' + && !isalnum (subtest_name[i])) { +igt_critical ("Invalid subtest name \"%s\".\n" , + subtest_name); +igt_exit (); + } +if (list_subtests) {printf ("%s\n" , subtest_name);return false;
Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx