Changeset 8386dbe for tests


Ignore:
Timestamp:
Nov 29, 2018, 4:26:04 PM (11 months ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master
Children:
ee0c4d50
Parents:
eba0cc4
Message:

[tests] add run_on_default_source_and_sink helper

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/utils_tests.h

    reba0cc4 r8386dbe  
    169169  return err;
    170170}
     171
     172int run_on_default_source_and_sink( int main(int, char**) )
     173{
     174  const int argc = 3;
     175  int err = 0;
     176  char** argv = (char**)calloc(argc, sizeof(char*));
     177  char sink_path[PATH_MAX] = "tmp_aubio_XXXXXX";
     178  int fd = create_temp_sink(sink_path);
     179  if (!fd) return 1;
     180  argv[0] = __FILE__;
     181  argv[1] = DEFINEDSTRING(AUBIO_TESTS_SOURCE);
     182  argv[2] = sink_path;
     183  // check if the file can be read
     184  if ( check_source(argv[1]) ) return 1;
     185  err = main(argc, argv);
     186  close_temp_sink(sink_path, fd);
     187  if (argv) free(argv);
     188  return err;
     189}
Note: See TracChangeset for help on using the changeset viewer.