| 686 | ****************************************************************************/ |
| 687 | |
| 688 | static int enum_boards(const char *dirpath, struct dirent *entry, void *arg) |
| 689 | { |
| 690 | int ret = 0; |
| 691 | char *boardpath; |
| 692 | char *testpath; |
| 693 | |
| 694 | /* All board directories should contain a Kconfig file, an include/ |
| 695 | * directory, and a src/ directory. |
| 696 | */ |
| 697 | |
| 698 | ret = asprintf(&boardpath, "%s%c%s", dirpath, g_delim, entry->d_name); |
| 699 | if (ret < 0) |
| 700 | { |
| 701 | fprintf(stderr, |
| 702 | "ERROR: asprintf() failed to boardpath\n"); |
| 703 | return ret; |
| 704 | } |
| 705 | |
| 706 | ret = asprintf(&testpath, "%s%cKconfig", boardpath, g_delim); |
| 707 | if (ret < 0) |
| 708 | { |
| 709 | fprintf(stderr, |
| 710 | "ERROR: asprintf() failed to testpath\n"); |
| 711 | return ret; |
| 712 | } |
| 713 | |
| 714 | if (test_filepath(testpath)) |
| 715 | { |
| 716 | free(testpath); |
| 717 | ret = asprintf(&testpath, "%s%cinclude", boardpath, g_delim); |
| 718 | if (ret < 0) |
| 719 | { |
| 720 | fprintf(stderr, |
| 721 | "ERROR: asprintf() failed to testpath\n"); |
| 722 | return ret; |
| 723 | } |
| 724 | |
| 725 | if (test_dirpath(testpath)) |
| 726 | { |
| 727 | free(testpath); |
| 728 | ret = asprintf(&testpath, "%s%csrc", boardpath, g_delim); |
| 729 | if (ret < 0) |
| 730 | { |
| 731 | fprintf(stderr, |
| 732 | "ERROR: asprintf() failed to archpath\n"); |
| 733 | return ret; |
| 734 | } |
| 735 | |
| 736 | if (test_dirpath(testpath)) |
| 737 | { |
| 738 | /* Enumerate the board configurations */ |
| 739 | |
| 740 | foreach_dirent(boardpath, enum_board_configurations, |
| 741 | entry->d_name); |
| 742 | } |
| 743 | } |
| 744 | } |
| 745 |
nothing calls this directly
no test coverage detected