- Timestamp:
- Nov 29, 2018, 2:28:09 PM (6 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master
- Children:
- 64d534d
- Parents:
- 505b49a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/utils_tests.h
r505b49a rc6bb567a 19 19 #ifndef PATH_MAX 20 20 #define PATH_MAX 1024 21 #endif 22 23 #ifndef AUBIO_TESTS_SOURCE 24 #error "AUBIO_TESTS_SOURCE is not defined" 21 25 #endif 22 26 … … 72 76 #if defined(__GNUC__) // mkstemp 73 77 78 int check_source(char *source_path) 79 { 80 return access(source_path, R_OK); 81 } 82 74 83 int create_temp_sink(char *sink_path) 75 84 { … … 87 96 #elif defined(HAVE_WIN_HACKS) //&& !defined(__GNUC__) 88 97 // windows workaround, where mkstemp does not exist... 98 99 int check_source(char *source_path) 100 { 101 return _access(source_path, 04); 102 } 103 89 104 int create_temp_sink(char *templ) 90 105 { … … 113 128 #endif 114 129 130 // pass progname / default 131 int run_on_default_source( int main(int, char**) ) 132 { 133 const int argc = 2; 134 int err = 0; 135 char** argv = (char**)calloc(argc, sizeof(char*)); 136 argv[0] = __FILE__; 137 argv[1] = AUBIO_TESTS_SOURCE; 138 // check if the file can be read 139 if ( check_source(argv[1]) ) return 1; 140 err = main(argc, argv); 141 if (argv) free(argv); 142 return err; 143 } 115 144 116 145 int run_on_default_sink( int main(int, char**) )
Note: See TracChangeset
for help on using the changeset viewer.