Changeset 318

Show
Ignore:
Timestamp:
01/25/06 10:19:26 (3 years ago)
Author:
conrad
Message:

upgrade tests harness to use automake TESTS and nicer INFO/WARN/FAIL macros

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libremix/trunk/src/tests/Makefile.am

    r168 r318  
    55REMIX_LIBS = ../ctxdata/libctxdata.la ../libremix/libremix.la -ldl 
    66 
     7TESTS = sndfiletest 
     8 
    79sndfiletest_SOURCES = sndfiletest.c 
    810sndfiletest_LDADD = $(REMIX_LIBS) @SNDFILE_LIBS@ 
    9  
    10  
    11 check: start-test sndfile-test end-test 
    12  
    13 start-test: 
    14         @echo "----------------------------------------------------------------------" 
    15         @echo "Running tests" 
    16         @echo "----------------------------------------------------------------------" 
    17  
    18 end-test: 
    19         @echo "----------------------------------------------------------------------" 
    20         @echo "All tests completed." 
    21         @echo "----------------------------------------------------------------------" 
    22  
    23 sndfile-test: sndfiletest 
    24         ./sndfiletest 
  • libremix/trunk/src/tests/sndfiletest.c

    r161 r318  
    2020#include <remix/remix.h> 
    2121 
     22#include "tests.h" 
     23 
    2224static void non_existant_file (void); 
    23  
    24 int 
    25 main (int argc, char ** argv) 
    26 { 
    27   non_existant_file () ; 
    28  
    29   return 0; 
    30 } 
    3125 
    3226static void 
     
    3933  int sf_path_key; 
    4034 
    41   printf ("    Non existant file test ................... ") ; 
    42   fflush (stdout) ; 
     35  INFO ("Attempting to read non existant file") ; 
    4336   
    4437  env = remix_init (); 
     
    5245                            CD_STRING("bad_file_name.wav")); 
    5346  if (sf_plugin == NULL) { 
    54     fprintf (stderr, "sf_plugin == NULL\n"); 
    55     exit (1); 
     47    FAIL ("Newly created sndfile plugin NULL"); 
    5648  } 
    5749 
    5850  sf1 = remix_new (env, sf_plugin, sf_parms); 
     51} 
    5952 
    60   puts ("ok"); 
     53int 
     54main (int argc, char ** argv) 
     55
     56  non_existant_file () ; 
     57 
     58  return 0; 
    6159}