Changeset a35b458 in mainline for uspace/app/tester/tester.c
- Timestamp:
- 2018-03-02T20:10:49Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/tester.c
r3061bc1 ra35b458 84 84 /* Execute the test */ 85 85 const char *ret = test->entry(); 86 86 87 87 if (ret == NULL) { 88 88 printf("\nTest passed\n"); 89 89 return true; 90 90 } 91 91 92 92 printf("\n%s\n", ret); 93 93 return false; … … 99 99 unsigned int i = 0; 100 100 unsigned int n = 0; 101 101 102 102 printf("\n*** Running all safe tests ***\n\n"); 103 103 104 104 for (test = tests; test->name != NULL; test++) { 105 105 if (test->safe) { … … 111 111 } 112 112 } 113 113 114 114 printf("\nCompleted, %u tests run, %u passed.\n", i + n, i); 115 115 } … … 123 123 len = str_length(test->name); 124 124 } 125 125 126 126 unsigned int _len = (unsigned int) len; 127 127 if ((_len != len) || (((int) _len) < 0)) { … … 129 129 return; 130 130 } 131 131 132 132 for (test = tests; test->name != NULL; test++) 133 133 printf("%-*s %s%s\n", _len, test->name, test->desc, 134 134 (test->safe ? "" : " (unsafe)")); 135 135 136 136 printf("%-*s Run all safe tests\n", _len, "*"); 137 137 } … … 145 145 return 0; 146 146 } 147 147 148 148 log_init("tester"); 149 149 … … 151 151 test_argc = argc - 2; 152 152 test_argv = argv + 2; 153 153 154 154 if (str_cmp(argv[1], "*") == 0) { 155 155 run_safe_tests(); 156 156 return 0; 157 157 } 158 158 159 159 test_t *test; 160 160 for (test = tests; test->name != NULL; test++) { … … 163 163 } 164 164 } 165 165 166 166 printf("Unknown test \"%s\"\n", argv[1]); 167 167 return -2;
Note:
See TracChangeset
for help on using the changeset viewer.