Changeset 34db7fa in mainline for kernel/generic/src/console/cmd.c
- Timestamp:
- 2006-12-12T12:32:02Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 96348adc
- Parents:
- df496c5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/cmd.c
rdf496c5 r34db7fa 68 68 #ifdef CONFIG_TEST 69 69 #include <test.h> 70 #endif 71 72 #ifdef CONFIG_BENCH 73 #include <arch/cycle.h> 70 74 #endif 71 75 … … 859 863 } 860 864 865 static bool run_test(const test_t * test) 866 { 867 printf("%s\t\t%s\n", test->name, test->desc); 868 #ifdef CONFIG_BENCH 869 uint64_t t0 = get_cycle(); 870 #endif 871 char * ret = test->entry(); 872 #ifdef CONFIG_BENCH 873 uint64_t dt = get_cycle() - t0; 874 printf("Time: %llu cycles\n", dt); 875 #endif 876 877 if (ret == NULL) { 878 printf("Test passed\n"); 879 return true; 880 } 881 882 printf("%s\n", ret); 883 return false; 884 } 885 861 886 /** Command for returning kernel tests 862 887 * … … 872 897 for (test = tests; test->name != NULL; test++) { 873 898 if (test->safe) { 874 printf("\n%s\t\t%s\n\n", test->name, test->desc); 875 test->entry(); 899 printf("\n"); 900 if (!run_test(test)) 901 break; 876 902 } 877 903 } … … 882 908 if (strcmp(test->name, argv->buffer) == 0) { 883 909 fnd = true; 884 test->entry();910 run_test(test); 885 911 break; 886 912 } … … 888 914 889 915 if (!fnd) 890 printf("Unknown test .\n");916 printf("Unknown test\n"); 891 917 } 892 918
Note:
See TracChangeset
for help on using the changeset viewer.