Changeset 6682

Show
Ignore:
Timestamp:
03/08/10 11:42:36 (18 months ago)
Author:
westram
Message:
  • execute "slow" tests after other tests
  • flagged save/load DB test as slow
Location:
trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/ARBDB/ad_save_load.cxx

    r6661 r6682  
    13511351#define TEST_loadsave_CLEANUP() TEST_ASSERT(system("rm -f [ab]2[ab]*.* master.* slave.* renamed.* fast.* fast2b.* TEST_loadsave.ARF") == 0) 
    13521352 
    1353 void TEST_loadsave() { 
     1353void TEST_SLOW_loadsave() { 
    13541354    TEST_loadsave_CLEANUP(); 
    13551355 
  • trunk/UNIT_TESTER/README.txt

    r6547 r6682  
    4040   Failing tests: 
    4141 
    42           If you have some broken behavior that you cannot fix now, please do NOT leave 
    43           the test as "failing". Instead change TEST_ASSERT into 
     42      If you have some broken behavior that you cannot fix now, please do NOT leave 
     43      the test as "failing". Instead change TEST_ASSERT into 
    4444 
    45               TEST_ASSERT_BROKEN(failing_condition); 
     45          TEST_ASSERT_BROKEN(failing_condition); 
    4646 
    47           That will print a warning as reminder as long as the condition fails. 
    48           When the behavior was fixed (so that the condition is fulfilled now), 
    49           it will abort the test as failed! 
    50           Just change TEST_ASSERT_BROKEN back into TEST_ASSERT then. 
     47      That will print a warning as reminder as long as the condition fails. 
     48      When the behavior was fixed (so that the condition is fulfilled now), 
     49      it will abort the test as failed! 
     50      Just change TEST_ASSERT_BROKEN back into TEST_ASSERT then. 
     51 
    5152 
    5253   Missing tests: 
    5354 
    54            You may drop a reminder like 
     55      You may drop a reminder like 
    5556 
    56                MISSING_TEST(describe what is missing); 
     57          MISSING_TEST(describe what is missing); 
    5758 
    58            which will appear as warning during test run. 
     59      which will appear as warning during test run. 
     60 
     61 
     62   Order of tests: 
     63 
     64      Tests are executed in the order they appear in the code. 
     65      Multiple Files are sorted alphabethically. 
     66 
     67      Tests with names starting with 'TEST_SLOW_' are executed after 
     68      all other tests. These are meant to indicate "slow" tests 
     69      (i.e. tests which need more than a second to execute) 
    5970 
    6071 
  • trunk/UNIT_TESTER/UnitTester.cxx

    r6677 r6682  
    1818#include <cstdlib> 
    1919#include <cstdio> 
     20#include <cstring> 
    2021 
    2122#include <sys/time.h> 
     
    152153    } 
    153154 
     155    if (duration_ms_this>1000) {                    // long test duration 
     156        if (strlen(test.name) <= 10 || memcmp(test.name, "TEST_SLOW_", 10) != 0) { 
     157            fprintf(stderr, "%s: Warning: Name of slow tests shall start with TEST_SLOW_ (it'll be run after other tests)\n", 
     158                    test.location); 
     159        } 
     160    } 
     161 
    154162    return result == TEST_OK; 
    155163} 
  • trunk/UNIT_TESTER/sym2testcode.pl

    r6653 r6682  
    141141  } keys %$id_r; 
    142142 
     143  # sort TEST_SLOW_ to the end 
     144  { 
     145    my @tests_fast = (); 
     146    my @tests_slow = (); 
     147 
     148    foreach (@tests) { 
     149      if (/^TEST_SLOW_/) { push @tests_slow, $_; } 
     150      else { push @tests_fast, $_; } 
     151    } 
     152 
     153    @tests = @tests_fast; 
     154    push @tests, @tests_slow; 
     155  } 
     156 
    143157  my $code = ''; 
    144158