- Timestamp:
- Sep 13, 2024, 2:43:22 PM (17 months ago)
- Branches:
- master
- Children:
- 8c79dc3c
- Parents:
- c494b84 (diff), 9739c56f (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. - Location:
- tests
- Files:
-
- 31 added
- 15 edited
- 3 moved
-
Makefile.am (modified) (2 diffs)
-
array-collections/.expect/array-raii-c.txt (modified) (1 diff)
-
array-collections/.expect/array-raii-cfa.txt (modified) (2 diffs)
-
array-collections/array-raii-c.cfa (modified) (1 diff)
-
array-collections/array-raii-cfa.cfa (modified) (2 diffs)
-
array-collections/array-raii.hfa (modified) (3 diffs)
-
configs/.in/parseconfig.all.txt (moved) (moved from tests/configs/.in/parseconfig-all.txt )
-
configs/.in/parseconfig.errors.txt (moved) (moved from tests/configs/.in/parseconfig-errors.txt )
-
configs/.in/parseconfig.missing.txt (moved) (moved from tests/configs/.in/parseconfig-missing.txt )
-
configs/parsebools.cfa (modified) (1 diff)
-
configs/parseconfig.cfa (modified) (7 diffs)
-
configs/parsenums.cfa (modified) (1 diff)
-
configs/usage.cfa (modified) (1 diff)
-
io/.expect/manipulatorsInput-uchunk.txt (added)
-
io/.in/manipulatorsInput-uchunk.default.1.txt (added)
-
io/.in/manipulatorsInput-uchunk.default.10.txt (added)
-
io/.in/manipulatorsInput-uchunk.default.11.txt (added)
-
io/.in/manipulatorsInput-uchunk.default.12.txt (added)
-
io/.in/manipulatorsInput-uchunk.default.13.txt (added)
-
io/.in/manipulatorsInput-uchunk.default.14.txt (added)
-
io/.in/manipulatorsInput-uchunk.default.2.txt (added)
-
io/.in/manipulatorsInput-uchunk.default.3.txt (added)
-
io/.in/manipulatorsInput-uchunk.default.4.txt (added)
-
io/.in/manipulatorsInput-uchunk.default.5.txt (added)
-
io/.in/manipulatorsInput-uchunk.default.6.txt (added)
-
io/.in/manipulatorsInput-uchunk.default.7.txt (added)
-
io/.in/manipulatorsInput-uchunk.default.8.txt (added)
-
io/.in/manipulatorsInput-uchunk.default.9.txt (added)
-
io/.in/manipulatorsInput-uchunk.getline.1.txt (added)
-
io/.in/manipulatorsInput-uchunk.getline.10.txt (added)
-
io/.in/manipulatorsInput-uchunk.getline.11.txt (added)
-
io/.in/manipulatorsInput-uchunk.getline.12.txt (added)
-
io/.in/manipulatorsInput-uchunk.getline.13.txt (added)
-
io/.in/manipulatorsInput-uchunk.getline.14.txt (added)
-
io/.in/manipulatorsInput-uchunk.getline.2.txt (added)
-
io/.in/manipulatorsInput-uchunk.getline.3.txt (added)
-
io/.in/manipulatorsInput-uchunk.getline.4.txt (added)
-
io/.in/manipulatorsInput-uchunk.getline.5.txt (added)
-
io/.in/manipulatorsInput-uchunk.getline.6.txt (added)
-
io/.in/manipulatorsInput-uchunk.getline.7.txt (added)
-
io/.in/manipulatorsInput-uchunk.getline.8.txt (added)
-
io/.in/manipulatorsInput-uchunk.getline.9.txt (added)
-
io/manipulatorsInput-uchunk.cfa (added)
-
io/manipulatorsInput-uchunk.extra.sh (added)
-
meta/fork+exec.cfa (modified) (1 diff)
-
meta/fork+exec.hfa (modified) (2 diffs)
-
pybin/test_run.py (modified) (1 diff)
-
test.py (modified) (2 diffs)
-
time.cfa (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/Makefile.am
rc494b84 r5ef4008 81 81 avltree/avl-private.h \ 82 82 avltree/avl.h \ 83 configs/.in/parseconfig-all.txt \84 configs/.in/parseconfig-errors.txt \85 configs/.in/parseconfig-missing.txt \86 83 exceptions/except-io.hfa \ 87 84 exceptions/with-threads.hfa \ 88 io/.in/io.data \89 io/.in/many_read.data \90 85 meta/fork+exec.hfa \ 91 86 concurrency/clib_tls.c \ … … 100 95 echo "Gathering test files" 101 96 for file in `${TEST_PY} --list-dist`; do \ 102 if test -f ${srcdir}/$${file}; then \97 if ls ${srcdir}/$${file} > /dev/null 2>&1; then \ 103 98 ${MKDIR_P} $$(dirname ${distdir}/$${file}); \ 104 cp -df ${srcdir}/$${file} $ {distdir}/$${file}; \99 cp -df ${srcdir}/$${file} $$(dirname ${distdir}/$${file}); \ 105 100 fi; \ 106 101 done -
tests/array-collections/.expect/array-raii-c.txt
rc494b84 r5ef4008 70 70 dtor 1 71 71 dtor 0 72 === uninit 72 === uninit ( uNoCtor[] ) 73 73 [1] 74 74 before ctors -
tests/array-collections/.expect/array-raii-cfa.txt
rc494b84 r5ef4008 70 70 dtor 1 71 71 dtor 0 72 === uninit 72 === uninit ( uNoCtor[] ) 73 73 [1] 74 74 before ctors … … 108 108 dtor 101 109 109 dtor 100 110 === uninit alt ( uArray ) 111 [1] 112 before ctors 113 ctor 0 114 ctor 999 115 ctor 888 116 ctor 3 117 ctor 4 118 func 0 119 func 999 120 func 888 121 func 3 122 func 4 123 dtor 4 124 dtor 3 125 dtor 888 126 dtor 999 127 dtor 0 128 [2] 129 before ctors 130 ctor 100 131 ctor 101 132 ctor 102 133 ctor 110 134 ctor 999 135 ctor 888 136 func 100 at (0, 0) 137 func 101 at (0, 1) 138 func 102 at (0, 2) 139 func 110 at (1, 0) 140 func 999 at (1, 1) 141 func 888 at (1, 2) 142 dtor 888 143 dtor 999 144 dtor 110 145 dtor 102 146 dtor 101 147 dtor 100 148 === uC++ cheat sheet 149 ctor 0 150 ctor 1 151 ctor 2 152 ctor 3 153 ctor 4 154 0 155 1 156 2 157 3 158 4 159 dtor 4 160 dtor 3 161 dtor 2 162 dtor 1 163 dtor 0 -
tests/array-collections/array-raii-c.cfa
rc494b84 r5ef4008 20 20 21 21 #include "array-raii.hfa" 22 23 void test_extras() {} -
tests/array-collections/array-raii-cfa.cfa
rc494b84 r5ef4008 16 16 // CFA array means like `array(float, 17) x;` 17 17 18 19 #include <fstream.hfa> 18 20 #include <collections/array.hfa> 19 21 … … 22 24 23 25 #include "array-raii.hfa" 26 27 void test_uninit_alt() { 28 printf(" [1]\n"); 29 { 30 array(thing, 5) a = { delay_init }; 31 printf("before ctors\n"); 32 for(i; 5) { 33 if (i == 1) 34 (a[i]){}; // no need for `emplace` bc no-arg ctor call means elem's real ctor 35 else if (i == 2) 36 (a[i]){888}; 37 else 38 (a[i]){i}; 39 } 40 for(i; 5) printf("func %d\n", a[i].mem); 41 } 42 printf(" [2]\n"); 43 { 44 array(thing, 2, 3) a = { delay_init }; 45 printf("before ctors\n"); 46 for(i; 2) for(j; 3) { 47 if (i == 1 && j == 1) 48 (a[i][j]){}; 49 else if (i == 1 && j == 2) 50 (a[i][j]){888}; 51 else 52 (a[i][j]){100 + 10 * i + j}; 53 } 54 for(i; 2) for(j; 3) { 55 printf("func %d at (%d, %d)\n", a[i][j].mem, i, j); 56 } 57 } 58 } 59 60 void test_uCxxCheatSheet() { 61 struct S { 62 int i; 63 }; 64 void ?{}( S & s, int i ) { s.i = i; sout | "ctor" | s.i; } 65 void ^?{}( S & s ) { sout | "dtor" | s.i; } 66 // int main() { 67 enum { N = 5 }; 68 array(S, N) s = { delay_init }; // no constructor calls 69 for ( i; N ) s[i]{ i }; 70 for ( i; N ) sout | s[i].i; 71 // } 72 } 73 74 void test_extras() { 75 76 printf("=== uninit alt ( uArray )\n"); 77 test_uninit_alt(); 78 79 printf("=== uC++ cheat sheet\n"); 80 test_uCxxCheatSheet(); 81 } -
tests/array-collections/array-raii.hfa
rc494b84 r5ef4008 118 118 } 119 119 120 struct thing { int mem; }; 121 void ?{}( thing & this, int i ) { 122 (this.mem){ i }; 123 printf("ctor %d\n", this.mem); 124 } 125 void ?{}( thing & this ) { 126 (this){ 999 }; 127 } 128 void ^?{}( thing & this ) { 129 printf("dtor %d\n", this.mem); 130 } 131 120 132 // Array of uninits sees explicit ctor calls (only), and implied dtor calls 121 133 void test_uninit() { 122 struct thing { int mem; };123 void ?{}( thing & this, int i ) {124 (this.mem){ i };125 printf("ctor %d\n", this.mem);126 }127 void ?{}( thing & this ) {128 (this){ 999 };129 }130 void ^?{}( thing & this ) {131 printf("dtor %d\n", this.mem);132 }133 134 printf(" [1]\n"); 134 135 { … … 163 164 } 164 165 166 void test_extras(); 167 165 168 int main() { 166 169 printf("=== builtins\n"); … … 170 173 test_custom(); 171 174 172 printf("=== uninit \n");175 printf("=== uninit ( uNoCtor[] )\n"); 173 176 test_uninit(); 177 178 test_extras(); 174 179 } -
tests/configs/parsebools.cfa
rc494b84 r5ef4008 50 50 } 51 51 52 int true_main( const char * path, c har * env[] ) {52 int true_main( const char * path, const char * env[] ) { 53 53 printf( "no arg:\n" ); 54 54 if ( pid_t child = strict_fork(); child == 0 ) { -
tests/configs/parseconfig.cfa
rc494b84 r5ef4008 50 50 sout | "Different types of destination addresses"; 51 51 52 parse_config( xstr(IN_DIR) "parseconfig -all.txt", entries, NUM_ENTRIES, parse_tabular_config_format );52 parse_config( xstr(IN_DIR) "parseconfig.all.txt", entries, NUM_ENTRIES, parse_tabular_config_format ); 53 53 54 54 sout | "Stop cost: " | config_params.stop_cost; … … 77 77 sout | "Missing_Config_Entries thrown when config file is missing entries we want"; 78 78 try { 79 parse_config( xstr(IN_DIR) "parseconfig -missing.txt", entries, NUM_ENTRIES, parse_tabular_config_format );79 parse_config( xstr(IN_DIR) "parseconfig.missing.txt", entries, NUM_ENTRIES, parse_tabular_config_format ); 80 80 } catch( Missing_Config_Entries * ex ) { 81 81 msg( ex ); … … 92 92 93 93 try { 94 parse_config( xstr(IN_DIR) "parseconfig -errors.txt", entry, 1, parse_tabular_config_format );94 parse_config( xstr(IN_DIR) "parseconfig.errors.txt", entry, 1, parse_tabular_config_format ); 95 95 } catch( Parse_Failure * ex ) { 96 96 msg( ex ); … … 106 106 107 107 try { 108 parse_config( xstr(IN_DIR) "parseconfig -errors.txt", entries, NUM_ENTRIES, parse_tabular_config_format );108 parse_config( xstr(IN_DIR) "parseconfig.errors.txt", entries, NUM_ENTRIES, parse_tabular_config_format ); 109 109 } catch( Validation_Failure * ex ) { 110 110 msg( ex ); … … 115 115 sout | "No error is thrown when validation succeeds"; 116 116 config_params.stop_cost = -1; // Reset value 117 parse_config( xstr(IN_DIR) "parseconfig -all.txt", entries, NUM_ENTRIES, parse_tabular_config_format );117 parse_config( xstr(IN_DIR) "parseconfig.all.txt", entries, NUM_ENTRIES, parse_tabular_config_format ); 118 118 sout | "Stop cost: " | config_params.stop_cost; 119 119 sout | nl; … … 126 126 127 127 config_params.stop_cost = -1; // Reset value 128 parse_config( xstr(IN_DIR) "parseconfig -all.txt", entries, NUM_ENTRIES, parse_tabular_config_format );128 parse_config( xstr(IN_DIR) "parseconfig.all.txt", entries, NUM_ENTRIES, parse_tabular_config_format ); 129 129 130 130 sout | "Stop cost: " | config_params.stop_cost; … … 139 139 140 140 config_params.stop_cost = -1; // Reset value 141 parse_config( xstr(IN_DIR) "parseconfig -all.txt", entries, NUM_ENTRIES, parse_tabular_config_format );141 parse_config( xstr(IN_DIR) "parseconfig.all.txt", entries, NUM_ENTRIES, parse_tabular_config_format ); 142 142 143 143 sout | "Stop cost: " | config_params.stop_cost; -
tests/configs/parsenums.cfa
rc494b84 r5ef4008 61 61 } 62 62 63 int true_main( const char * path, c har * env[] ) {63 int true_main( const char * path, const char * env[] ) { 64 64 printf( "no arg:\n" ); 65 65 if ( pid_t child = strict_fork(); child == 0 ) { -
tests/configs/usage.cfa
rc494b84 r5ef4008 108 108 109 109 // no used 110 static int true_main( const char * path, c har * env[]) { return 0; }110 static int true_main( const char * path, const char * env[]) { return 0; } -
tests/meta/fork+exec.cfa
rc494b84 r5ef4008 32 32 33 33 34 int true_main(const char * path, c har * env[]) {34 int true_main(const char * path, const char * env[]) { 35 35 printf("no arg:\n"); 36 36 if(pid_t child = strict_fork(); child == 0) { -
tests/meta/fork+exec.hfa
rc494b84 r5ef4008 28 28 } 29 29 30 static int true_main(const char * path, c har * env[]);30 static int true_main(const char * path, const char * env[]); 31 31 32 32 static int do_wait(pid_t pid) { … … 70 70 if(getenv("CFATEST_FORK_EXEC_TEXT")) return; 71 71 72 c har * env[] = { "CFATEST_FORK_EXEC_TEXT=1", 0p};72 const char * env[] = { "CFATEST_FORK_EXEC_TEXT=1", (char*)0 }; 73 73 exit( true_main(path, env) ); 74 74 } -
tests/pybin/test_run.py
rc494b84 r5ef4008 29 29 return os.path.normpath( os.path.join(settings.BUILDDIR, self.path, ".out" , "%s.log" % self.name) ) 30 30 31 # one file that goes to the test's stdin 31 32 def input(self): 32 33 return os.path.normpath( os.path.join(settings.SRCDIR , self.path, ".in" , "%s.txt" % self.name) ) 34 35 # several files available for this test to open 36 def inputs_all(self): 37 return os.path.normpath( os.path.join(settings.SRCDIR , self.path, ".in" , "%s.*" % self.name) ) 33 38 34 39 def target_output(self): -
tests/test.py
rc494b84 r5ef4008 352 352 for t in tests: 353 353 print(os.path.relpath(t.expect(), settings.SRCDIR), end=' ') 354 print(os.path.relpath(t.input () , settings.SRCDIR), end=' ')354 print(os.path.relpath(t.inputs_all() , settings.SRCDIR), end=' ') 355 355 code, out, err = make_recon(t.target()) 356 356 … … 360 360 361 361 print(' '.join(re.findall(r'([^\s]+\.cfa)', out)), end=' ') 362 363 print('')364 362 365 363 # done -
tests/time.cfa
rc494b84 r5ef4008 10 10 // Created On : Tue Mar 27 17:24:56 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Aug 13 09:09:47202413 // Update Count : 7 612 // Last Modified On : Fri Sep 13 00:57:15 2024 13 // Update Count : 77 14 14 // 15 15 … … 18 18 #include <stdlib.h> // putenv 19 19 20 extern "C" size_t malloc_unfreed() { return 2048; } // guess at unfreed storage from putenv/tzset20 extern "C" size_t malloc_unfreed() { return 4096; } // guess at unfreed storage from putenv/tzset 21 21 22 22 int main() {
Note:
See TracChangeset
for help on using the changeset viewer.