Changeset 6e1e2d0 for tests


Ignore:
Timestamp:
May 1, 2023, 4:19:09 PM (3 years ago)
Author:
caparsons <caparson@…>
Branches:
ADT, ast-experimental, master
Children:
c083c3d
Parents:
a50fdfb (diff), 985b624 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

resolved merge conflicts

Location:
tests
Files:
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • tests/.expect/PRNG.x64.txt

    ra50fdfb r6e1e2d0  
     1
     2CFA xoshiro256pp
    13
    24                    PRNG()     PRNG(5)   PRNG(0,5)
     
    5658
    5759Sequential
    58 trials 100000000 buckets 100000 min 875 max 1146 avg 1000.0 std 31.6 rstd 3.2%
     60trials 20000000 buckets 100000 min 139 max 265 avg 200.0 std 14.1 rstd 7.0%
    5961
    6062Concurrent
    61 trials 100000000 buckets 100000 min 875 max 1146 avg 1000.0 std 31.6 rstd 3.2%
    62 trials 100000000 buckets 100000 min 875 max 1146 avg 1000.0 std 31.6 rstd 3.2%
    63 trials 100000000 buckets 100000 min 875 max 1146 avg 1000.0 std 31.6 rstd 3.2%
    64 trials 100000000 buckets 100000 min 875 max 1146 avg 1000.0 std 31.6 rstd 3.2%
     63trials 20000000 buckets 100000 min 139 max 265 avg 200.0 std 14.1 rstd 7.0%
     64trials 20000000 buckets 100000 min 139 max 265 avg 200.0 std 14.1 rstd 7.0%
     65trials 20000000 buckets 100000 min 139 max 265 avg 200.0 std 14.1 rstd 7.0%
     66trials 20000000 buckets 100000 min 139 max 265 avg 200.0 std 14.1 rstd 7.0%
    6567
    6668                   prng(t)   prng(t,5) prng(t,0,5)
  • tests/.expect/PRNG.x86.txt

    ra50fdfb r6e1e2d0  
     1
     2CFA xoshiro128pp
    13
    24                    PRNG()     PRNG(5)   PRNG(0,5)
     
    5658
    5759Sequential
    58 trials 100000000 buckets 100000 min 858 max 1147 avg 1000.0 std 31.5 rstd 3.2%
     60trials 20000000 buckets 100000 min 144 max 270 avg 200.0 std 14.1 rstd 7.1%
    5961
    6062Concurrent
    61 trials 100000000 buckets 100000 min 858 max 1147 avg 1000.0 std 31.5 rstd 3.2%
    62 trials 100000000 buckets 100000 min 858 max 1147 avg 1000.0 std 31.5 rstd 3.2%
    63 trials 100000000 buckets 100000 min 858 max 1147 avg 1000.0 std 31.5 rstd 3.2%
    64 trials 100000000 buckets 100000 min 858 max 1147 avg 1000.0 std 31.5 rstd 3.2%
     63trials 20000000 buckets 100000 min 144 max 270 avg 200.0 std 14.1 rstd 7.1%
     64trials 20000000 buckets 100000 min 144 max 270 avg 200.0 std 14.1 rstd 7.1%
     65trials 20000000 buckets 100000 min 144 max 270 avg 200.0 std 14.1 rstd 7.1%
     66trials 20000000 buckets 100000 min 144 max 270 avg 200.0 std 14.1 rstd 7.1%
    6567
    6668                   prng(t)   prng(t,5) prng(t,0,5)
  • tests/Makefile.am

    ra50fdfb r6e1e2d0  
    1111## Created On       : Sun May 31 09:08:15 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Fri Feb  3 23:06:44 2023
    14 ## Update Count     : 94
     13## Last Modified On : Mon Apr 10 23:24:02 2023
     14## Update Count     : 96
    1515###############################################################################
    1616
     
    184184
    185185SYNTAX_ONLY_CODE = expression typedefRedef variableDeclarator switch numericConstants identFuncDeclarator \
    186         init1 limits nested-types cast labelledExit array quasiKeyword include/stdincludes include/includes builtins/sync warnings/self-assignment
     186        init1 limits nested-types cast labelledExit array quasiKeyword include/stdincludes include/includes builtins/sync warnings/self-assignment concurrent/waitfor/parse
    187187$(SYNTAX_ONLY_CODE): % : %.cfa $(CFACCBIN)
    188188        $(CFACOMPILE_SYNTAX)
  • tests/PRNG.cfa

    ra50fdfb r6e1e2d0  
    88// Created On       : Wed Dec 29 09:38:12 2021
    99// Last Modified By : Peter A. Buhr
    10 // Last Modified On : Wed Dec 21 20:39:59 2022
    11 // Update Count     : 406
     10// Last Modified On : Sun Apr 23 22:02:09 2023
     11// Update Count     : 420
    1212//
    1313
     
    1515#include <stdlib.hfa>                                                                   // PRNG
    1616#include <clock.hfa>
    17 #include <thread.hfa>
    1817#include <limits.hfa>                                                                   // MAX
    1918#include <math.hfa>                                                                             // sqrt
    2019#include <malloc.h>                                                                             // malloc_stats
    2120#include <locale.h>                                                                             // setlocale
     21#include <thread.hfa>
    2222#include <mutex_stmt.hfa>
    2323
    24 #ifdef __x86_64__                                                                               // 64-bit architecture
     24#define xstr(s) str(s)
     25#define str(s) #s
     26
     27#if defined( __x86_64__ ) || defined( __aarch64__ )             // 64-bit architecture
    2528#define PRNG PRNG64
    2629#else                                                                                                   // 32-bit architecture
    2730#define PRNG PRNG32
    2831#endif // __x86_64__
     32
     33//#define TIME
    2934
    3035#ifdef TIME                                                                                             // use -O2 -nodebug
     
    3843#endif // TIME
    3944
    40 void avgstd( unsigned int buckets[] ) {
    41         unsigned int min = MAX, max = 0;
     45static void avgstd( size_t trials, size_t buckets[] ) {
     46        size_t min = MAX, max = 0;
    4247        double sum = 0.0, diff;
    4348        for ( i; BUCKETS ) {
     
    5459        } // for
    5560        double std = sqrt( sum / BUCKETS );
    56         mutex( sout ) sout | "trials"  | TRIALS | "buckets" | BUCKETS
     61        mutex( sout ) sout | "trials"  | trials | "buckets" | BUCKETS
    5762                | "min" | min | "max" | max
    5863                | "avg" | wd(0,1, avg) | "std" | wd(0,1, std) | "rstd" | wd(0,1, (avg == 0 ? 0.0 : std / avg * 100)) | "%";
     
    6469thread T1 {};
    6570void main( T1 & ) {
    66         unsigned int * buckets = calloc( BUCKETS );                     // too big for task stack
    67         for ( TRIALS / 100 ) {
     71        size_t * buckets = calloc( BUCKETS );                           // too big for task stack
     72        for ( TRIALS / 50 ) {
    6873                buckets[rand() % BUCKETS] += 1;                                 // concurrent
    6974        } // for
    70         avgstd( buckets );
     75        avgstd( TRIALS / 50, buckets );
    7176        free( buckets );
    7277} // main
     
    7681        PRNG prng;
    7782        if ( seed != 0 ) set_seed( prng, seed );
    78         unsigned int * buckets = calloc( BUCKETS );                     // too big for task stack
     83        size_t * buckets = calloc( BUCKETS );                           // too big for task stack
    7984        for ( TRIALS ) {
    8085                buckets[prng( prng ) % BUCKETS] += 1;                   // concurrent
    8186        } // for
    82         avgstd( buckets );
     87        avgstd( TRIALS, buckets );
    8388        free( buckets );
    8489} // main
     
    8691thread T3 {};
    8792void main( T3 & th ) {
    88         unsigned int * buckets = calloc( BUCKETS );                     // too big for task stack
    89         for ( TRIALS ) {
     93        size_t * buckets = calloc( BUCKETS );                           // too big for task stack
     94        for ( TRIALS / 5 ) {
    9095                buckets[prng() % BUCKETS] += 1;                                 // concurrent
    9196        } // for
    92         avgstd( buckets );
     97        avgstd( TRIALS / 5, buckets );
    9398        free( buckets );
    9499} // main
     
    96101thread T4 {};
    97102void main( T4 & th ) {
    98         unsigned int * buckets = calloc( BUCKETS );                     // too big for task stack
     103        size_t * buckets = calloc( BUCKETS );                           // too big for task stack
    99104        for ( TRIALS ) {
    100                 buckets[prng( th ) % BUCKETS] += 1;     // concurrent
    101         } // for
    102         avgstd( buckets );
     105                buckets[prng( th ) % BUCKETS] += 1;                             // concurrent
     106        } // for
     107        avgstd( TRIALS, buckets );
    103108        free( buckets );
    104109} // main
     
    108113static void dummy( thread$ & th ) __attribute__(( noinline ));
    109114static void dummy( thread$ & th ) {
    110         unsigned int * buckets = (unsigned int *)calloc( BUCKETS, sizeof(unsigned int) ); // too big for task stack
    111         for ( unsigned int i = 0; i < TRIALS; i += 1 ) {
     115        size_t * buckets = (size_t *)calloc( BUCKETS, sizeof(size_t) ); // too big for task stack
     116        for ( size_t i = 0; i < TRIALS; i += 1 ) {
    112117                buckets[prng( th ) % BUCKETS] += 1;                             // sequential
    113118        } // for
    114         avgstd( buckets );
     119        avgstd( TRIALS, buckets );
    115120        free( buckets );
    116121} // dummy
     
    118123
    119124int main() {
    120         // causes leaked storage message
    121         // setlocale( LC_NUMERIC, getenv( "LANG" ) );                   // print digit separator
     125        // setlocale( LC_NUMERIC, getenv( "LANG" ) );           // causes leaked storage message
     126
     127        // only works on the current pthread thread
    122128        // locale_t loc = newlocale( LC_NUMERIC_MASK, getenv( "LANG" ), (locale_t)0p );
    123129        // if ( loc == (locale_t)0p ) abort( "newlocale" );
     
    126132        enum { TASKS = 4 };
    127133        Time start;
     134
    128135#ifdef TIME                                                                                             // too slow for test and generates non-repeatable results
    129136#if 1
    130         unsigned int rseed;
     137        sout | "glib rand" | nl | nl;
     138
     139        size_t rseed;
    131140        if ( seed != 0 ) rseed = seed;
    132141        else rseed = rdtscl();
     
    134143
    135144        sout | sepDisable;
    136         sout | wd(26, "rand()" ) | wd(12, "rand(5)") | wd(12, "rand(0,5)" );
     145        sout | nl | wd(26, "rand()" ) | wd(12, "rand(5)") | wd(12, "rand(0,5)" );
    137146        for ( 20 ) {
    138147                sout | wd(26, rand()) | nonl;
     
    146155        STARTTIME;
    147156        {
    148                 unsigned int * buckets = calloc( BUCKETS );             // too big for task stack
    149                 for ( i; TRIALS / 10 ) {
     157                size_t * buckets = calloc( BUCKETS );                   // too big for task stack
     158                for ( i; TRIALS / 5 ) {
    150159                        buckets[rand() % BUCKETS] += 1;                         // sequential
    151160                } // for
    152                 avgstd( buckets );
     161                avgstd( TRIALS / 5, buckets );
    153162                free( buckets );
    154163        }
    155         ENDTIME( " x 10 " );
     164        ENDTIME( " x 5 " );
    156165
    157166        sout | nl | "Concurrent";
     
    163172                } // wait for threads to complete
    164173        }
    165         ENDTIME( " x 100 " );
     174        ENDTIME( " x 50 " );
    166175#endif // 0
    167176#endif // TIME
     177
     178        sout | nl | "CFA " xstr(PRNG_NAME);
     179
    168180#if 1
    169181        PRNG prng;
     
    184196        STARTTIME;
    185197        {
    186                 unsigned int * buckets = calloc( BUCKETS );             // too big for task stack
     198                size_t * buckets = calloc( BUCKETS );                   // too big for task stack
    187199                for ( TRIALS ) {
    188200                        buckets[prng( prng ) % BUCKETS] += 1;           // sequential
    189201                } // for
    190                 avgstd( buckets );
     202                avgstd( TRIALS, buckets );
    191203                free( buckets );
    192204        }
     
    219231        STARTTIME;
    220232        {
    221                 unsigned int * buckets = calloc( BUCKETS );             // too big for task stack
    222                 for ( TRIALS ) {
     233                size_t * buckets = calloc( BUCKETS );                   // too big for task stack
     234                for ( TRIALS / 5 ) {
    223235                        buckets[prng() % BUCKETS] += 1;
    224236                } // for
    225                 avgstd( buckets );
     237                avgstd( TRIALS / 5, buckets );
    226238                free( buckets );
    227239        }
    228         ENDTIME();
     240        ENDTIME( " x 5 " );
    229241
    230242        sout | nl | "Concurrent";
     
    236248                } // wait for threads to complete
    237249        }
    238         ENDTIME();
     250        ENDTIME( " x 5 " );
    239251#endif // 0
    240252#if 1
  • tests/concurrent/waitfor/parse.cfa

    ra50fdfb r6e1e2d0  
    1 //----------------------------------------------------------------------------------------
    2 //----------------------------------------------------------------------------------------
     1// 
     2// Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo
    33//
    4 //              DEPRECATED TEST
    5 //              DIFFERS BETWEEN DEBUG AND RELEASE
    6 //
    7 //----------------------------------------------------------------------------------------
    8 //----------------------------------------------------------------------------------------
     4// The contents of this file are covered under the licence agreement in the
     5// file "LICENCE" distributed with Cforall.
     6//
     7// waitfor.c --
     8//
     9// Author           : Peter A. Buhr
     10// Created On       : Wed Aug 30 17:53:29 2017
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Mon Apr 10 22:52:18 2023
     13// Update Count     : 64
     14//
    915
    1016#include <monitor.hfa>
     
    1218monitor M {};
    1319
    14 M a;
    15 
    16 void f1( M & mutex a );
    17 void f2( M & mutex a );
    18 void f2( M & mutex a, M & mutex b );
    19 void f3( M & mutex a );
    20 void f3( M & mutex a, M & mutex b );
    21 void f3( M & mutex a, M & mutex b, M & mutex c );
    22 
    23 void foo() {
    24 
    25         //---------------------------------------
    26         waitfor( f1 : a ) {
    27                 1;
    28         }
    29 
    30         //---------------------------------------
    31         waitfor( f1 : a ) {
    32                 2;
    33         }
    34         waitfor( f2 : a ) {
    35                 3;
    36         }
    37 
    38         //---------------------------------------
    39         when( 1 < 3 ) waitfor( f2 : a, a ) {
    40                 4;
    41         }
    42         or timeout( 100 ) {
    43                 5;
    44         }
    45 
    46         //---------------------------------------
    47         when( 2 < 3 ) waitfor( f3 : a ) {
    48                 5;
    49         }
     20void notcalled( M & mutex m1, M & mutex m2 ) {
     21        abort();
     22}
     23void or( M & mutex m ) {
     24        abort();
     25}
     26void timeout( M & mutex m ) {
     27        abort();
     28}
     29
     30void fred( M & mutex m, M & mutex or, M & mutex timeout ) {
     31        // test waitfor and when
     32
     33        waitfor( notcalled : m, m );
     34
     35        waitfor( notcalled : m, m ) {
     36        }
     37
     38        waitfor( notcalled : m, m ) {
     39        }
     40
     41        when( true ) waitfor( notcalled : m, m );
     42
     43        when( true ) waitfor( notcalled : m, m ) {
     44        }
     45
     46        waitfor( notcalled : m, m );
     47        or waitfor( notcalled : m, m );
     48
     49        when( true ) waitfor( notcalled : m, m );
     50        or when( true ) waitfor( notcalled : m, m );
     51
     52        waitfor( notcalled : m, m ) {
     53        } or waitfor( notcalled : m, m ) {
     54        }
     55
     56        waitfor( notcalled : m, m ) {
     57        } or waitfor( notcalled : m, m ) {
     58        }
     59
     60        when( true ) waitfor( notcalled : m, m ) {
     61        } or when( true ) waitfor( notcalled : m, m ) {
     62        }
     63
     64        waitfor( notcalled : m, m );
     65        or waitfor( notcalled : m, m ) {
     66        }
     67
     68        when( true ) waitfor( notcalled : m, m );
     69        or when( true ) waitfor( notcalled : m, m ) {
     70        }
     71
     72        waitfor( notcalled : m, m ) {
     73        } or waitfor( notcalled : m, m );
     74
     75        when( true ) waitfor( notcalled : m, m ) {
     76        } or when( true ) waitfor( notcalled : m, m );
     77
     78        // test when, waitfor and else
     79
     80        waitfor( notcalled : m, m );
     81        or else;
     82
     83        when( true ) waitfor( notcalled : m, m );
     84        or else;
     85
     86        when( true ) waitfor( notcalled : m, m );
     87        or else;
     88
     89        waitfor( notcalled : m, m ) {
     90        } or else {
     91        }
     92
     93        when( true ) waitfor( notcalled : m, m ) {
     94        } or else {
     95        }
     96
     97        waitfor( notcalled : m, m );
    5098        or else {
    51                 6;
    52         }
    53 
    54         //---------------------------------------
    55         when( 3 < 3 ) waitfor( f3 : a, a ) {
    56                 7;
    57         }
    58         or when( 4 < 3 ) timeout( 101 ) {
    59                 8;
    60         }
    61         or when( 5 < 3 ) else {
    62                 9;
    63         }
    64 
    65         //---------------------------------------
    66         when( 6 < 3 ) waitfor( f3 : a, a, a ) {
    67                 10;
    68         }
    69         or when( 7 < 3 ) waitfor( f1 : a  ) {
    70                 11;
    71         }
     99        }
     100
     101        when( true ) waitfor( notcalled : m, m );
    72102        or else {
    73                 12;
    74         }
    75 
    76         //---------------------------------------
    77         when( 8 < 3 ) waitfor( f3 : a, a ) {
    78                 13;
    79         }
    80         or waitfor( f1 : a  ) {
    81                 14;
    82         }
    83         or when( 9 < 3 ) timeout( 102 ) {
    84                 15;
    85         }
    86 
    87         //---------------------------------------
    88         when( 10 < 3 ) waitfor( f1 : a ) {
    89                 16;
    90         }
    91         or waitfor( f2 : a, a ) {
    92                 17;
    93         }
    94         or timeout( 103 ) {
    95                 18;
    96         }
    97         or when( 11 < 3 ) else {
    98                 19;
    99         }
    100 }
    101 
    102 int main() {}
     103        }
     104
     105        when( true ) waitfor( notcalled : m, m );
     106        or else {
     107        }
     108
     109        waitfor( notcalled : m, m ) {
     110        } or else;
     111
     112        when( true ) waitfor( notcalled : m, m ) {
     113        } or else;
     114
     115        waitfor( notcalled : m, m );
     116        or when( true ) else;
     117
     118        when( true ) waitfor( notcalled : m, m );
     119        or when( true ) else;
     120
     121        when( true ) waitfor( notcalled : m, m );
     122        or when( true ) else;
     123
     124        waitfor( notcalled : m, m ) {
     125        } or when( true ) else {
     126        }
     127
     128        when( true ) waitfor( notcalled : m, m ) {
     129        } or when( true ) else {
     130        }
     131
     132        waitfor( notcalled : m, m );
     133        or when( true ) else {
     134        }
     135
     136        when( true ) waitfor( notcalled : m, m );
     137        or when( true ) else {
     138        }
     139
     140        when( true ) waitfor( notcalled : m, m );
     141        or when( true ) else {
     142        }
     143
     144        waitfor( notcalled : m, m ) {
     145        } or when( true ) else;
     146
     147        when( true ) waitfor( notcalled : m, m ) {
     148        } or when( true ) else;
     149
     150        // test when, waitfor and timeout
     151
     152        waitfor( notcalled : m, m );
     153        or timeout( 3 );
     154
     155        waitfor( notcalled : m, m );
     156        or timeout( 3 );
     157
     158        when( true ) waitfor( notcalled : m, m );
     159        or timeout( 3 );
     160
     161        waitfor( notcalled : m, m ) {
     162        } or timeout( 3 ) {
     163        }
     164
     165        when( true ) waitfor( notcalled : m, m ) {
     166        } or timeout( 3 ) {
     167        }
     168
     169        when( true ) waitfor( notcalled : m, m ) {
     170        } or timeout( 3 ) {
     171        }
     172
     173        when( true ) waitfor( notcalled : m, m ) {
     174        } or when ( true ) timeout( 3 ) {
     175        }
     176
     177        when( true ) waitfor( notcalled : m, m ) {
     178        } or when ( true ) timeout( 3 ) {
     179        }
     180
     181        waitfor( notcalled : m, m );
     182        or timeout( 3 ) {
     183        }
     184
     185        when( true ) waitfor( notcalled : m, m );
     186        or timeout( 3 ) {
     187        }
     188
     189        when( true ) waitfor( notcalled : m, m );
     190        or when( true ) timeout( 3 ) {
     191        }
     192
     193        waitfor( notcalled : m, m ) {
     194        } or timeout( 3 );
     195
     196        when( true ) waitfor( notcalled : m, m ) {
     197        } or timeout( 3 );
     198
     199        when( true ) waitfor( notcalled : m, m ) {
     200        } or when( true ) timeout( 3 );
     201
     202        // test when, waitfor, timeout and else
     203
     204        waitfor( notcalled : m, m ) {
     205        } or timeout( 3 ) {
     206        } or when( true ) else {}
     207
     208        when( true ) waitfor( notcalled : m, m ) {
     209        } or timeout( 3 ) {
     210        } or when( true ) else {}
     211
     212        waitfor( notcalled : m, m ) {
     213        } or timeout( 3 ) {
     214        } or when( true ) else {}
     215
     216        waitfor( notcalled : m, m ) {
     217        } or when( true ) timeout( 3 ) {
     218        } or when( true ) else {}
     219
     220        when( true ) waitfor( notcalled : m, m ) {
     221        } or timeout( 3 ) {
     222        } or when( true ) else {}
     223
     224        waitfor( notcalled : m, m ) {
     225        } or when( true ) timeout( 3 ) {
     226        } or when( true ) else {}
     227
     228        when( true ) waitfor( notcalled : m, m ) {
     229        } or when( true ) timeout( 3 ) {
     230        } or when( true ) else {}
     231
     232        // test quasi-keywords "or" and "timeout"
     233
     234        int or = 0, timeout = 0;
     235        waitfor( timeout : timeout ) timeout += 1; or timeout( timeout );
     236        waitfor( notcalled : or, or ) or += 1; or timeout( or ) 3;
     237        when( or ) waitfor( or : m ) { 4; } or timeout( or ) or += 1;
     238        when( timeout ) waitfor( notcalled : timeout, timeout ) or += 1; or else timeout += 1;
     239        when( or + timeout ) waitfor( or : m ) 4; or when( or ) timeout( or ) 4; or when( or ) else timeout += 1;
     240        when( 3 ) waitfor( or : or ) 3; or when( or ) waitfor( notcalled : or, or ) 4; or else 4;
     241        when( timeout ) waitfor( or : timeout ) 3; or waitfor( notcalled : timeout, or ) 4; or when( or ) timeout( timeout ) 4;
     242        when( 3 ) waitfor( or : timeout ) or += 1;
     243        or waitfor( or : or ) timeout += 1;
     244        or timeout( timeout ) or += 1;
     245        or when( 3 ) else or += 1;
     246
     247        // test else selection
     248
     249        if ( or > timeout ) waitfor( or : or ) 3;
     250        else waitfor( timeout : timeout ) 4;
     251}
     252
     253//Dummy main
     254int main( int argc, char const * argv[] ) {
     255    #pragma GCC warning "Compiled"                      // force non-empty .expect file, NO TABS!!!
     256}
     257
     258// Local Variables: //
     259// tab-width: 4 //
     260// compile-command: "cfa waitfor.cfa" //
     261// End: //
  • tests/pybin/settings.py

    ra50fdfb r6e1e2d0  
    126126        global archive
    127127        global install
     128        global invariant
    128129
    129130        global continue_
     
    140141        all_install  = [Install(o)      for o in list(dict.fromkeys(options.install))]
    141142        archive      = os.path.abspath(os.path.join(original_path, options.archive_errors)) if options.archive_errors else None
     143        invariant    = options.invariant
    142144        continue_    = options.continue_
    143145        dry_run      = options.dry_run # must be called before tools.config_hash()
  • tests/test.py

    ra50fdfb r6e1e2d0  
    114114        parser.add_argument('--install', help='Run all tests based on installed binaries or tree binaries', type=comma_separated(yes_no), default='no')
    115115        parser.add_argument('--continue', help='When multiple specifications are passed (debug/install/arch), sets whether or not to continue if the last specification failed', type=yes_no, default='yes', dest='continue_')
     116        parser.add_argument('--invariant', help='Tell the compiler to check invariants while running.', action='store_true')
    116117        parser.add_argument('--timeout', help='Maximum duration in seconds after a single test is considered to have timed out', type=int, default=180)
    117118        parser.add_argument('--global-timeout', help='Maximum cumulative duration in seconds after the ALL tests are considered to have timed out', type=int, default=7200)
     
    172173        test.prepare()
    173174
     175        # extra flags for cfa to pass through make.
     176        cfa_flags = 'CFAFLAGS=--invariant' if settings.invariant else None
     177
    174178        # ----------
    175179        # MAKE
     
    177181        # build, skipping to next test on error
    178182        with Timed() as comp_dur:
    179                 make_ret, _, _ = make( test.target(), output_file=subprocess.DEVNULL, error=out_file, error_file = err_file )
     183                make_ret, _, _ = make(test.target(), flags=cfa_flags, output_file=subprocess.DEVNULL, error=out_file, error_file=err_file)
    180184
    181185        # ----------
Note: See TracChangeset for help on using the changeset viewer.