|
| 1 | +function Assert-MatchTests { |
| 2 | + param ( |
| 3 | + [Parameter(Mandatory = $true, ValueFromPipeline)] $TestResult |
| 4 | + ) |
| 5 | + |
| 6 | + if ($TestResult) { |
| 7 | + Write-Error "Output does not match expected results." |
| 8 | + } |
| 9 | +} |
| 10 | + |
| 11 | +$run = "$PSScriptRoot\a.exe" |
| 12 | + |
| 13 | +$Error.clear() |
| 14 | +# gcc -std=c2x "$PSScriptRoot\anagrams.c" && . $run rats | |
| 15 | +# Compare-Object (Get-Content "$PSScriptRoot\..\test\rats_heap_expected") | |
| 16 | +# Assert-MatchTests && |
| 17 | +gcc -std=c2x "$PSScriptRoot\array_in_struct.c" && . $run && |
| 18 | +gcc -std=c2x "$PSScriptRoot\assignment.c" && . $run && |
| 19 | +gcc -std=c2x "$PSScriptRoot\cheating_with_pointers.c" && . $run && |
| 20 | +gcc -std=c2x "$PSScriptRoot\clockhands_time.c" && . $run | |
| 21 | + Compare-Object (Get-Content "$PSScriptRoot\..\test\clockhands_expected") | |
| 22 | + Assert-MatchTests && |
| 23 | +gcc -std=c2x "$PSScriptRoot\clockhands.c" && . $run | |
| 24 | + Compare-Object (Get-Content "$PSScriptRoot\..\test\clockhands_expected") | |
| 25 | + Assert-MatchTests && |
| 26 | +gcc -std=c2x "$PSScriptRoot\const.c" && . $run && |
| 27 | +gcc -std=c2x "$PSScriptRoot\directives.c" && . $run && |
| 28 | +gcc -std=c2x -c "$PSScriptRoot\hashmap.c" && |
| 29 | +gcc -std=c2x "$PSScriptRoot\indexing.c" && . $run && |
| 30 | +gcc -std=c2x "$PSScriptRoot\memory.c" && . $run && |
| 31 | +gcc -std=c2x "$PSScriptRoot\permutations.c" && . $run I like carrots | |
| 32 | + Compare-Object (Get-Content "$PSScriptRoot\..\test\carrots_expected") | |
| 33 | + Assert-MatchTests && |
| 34 | +gcc -std=c2x "$PSScriptRoot\reinterpret_cast.c" && . $run && |
| 35 | +gcc -std=c2x "$PSScriptRoot\simple_macro.c" && . $run && |
| 36 | +gcc -std=c2x "$PSScriptRoot\sizeof.c" && . $run && |
| 37 | +gcc -std=c2x "$PSScriptRoot\sum_of_even_squares.c" && . $run && |
| 38 | +gcc -std=c2x "$PSScriptRoot\sum.c" && . $run && |
| 39 | +# gcc -std=c2x "$PSScriptRoot\top_ten_scorers.c" && Get-Content "$PSScriptRoot\..\test\wnba_input" | . $run | |
| 40 | +# Compare-Object (Get-Content "$PSScriptRoot\..\test\wnba_expected") | |
| 41 | +# Assert-MatchTests && |
| 42 | +gcc -std=c2x "$PSScriptRoot\triple.c" && . $run | |
| 43 | + Compare-Object (Get-Content "$PSScriptRoot\..\test\triple_expected") | |
| 44 | + Assert-MatchTests && |
| 45 | +gcc -std=c2x "$PSScriptRoot\ugly_pointer_arithmetic.c" && . $run && |
| 46 | +gcc -std=c2x "$PSScriptRoot\union.c" && . $run && |
| 47 | +# gcc -std=c2x "$PSScriptRoot\wordcount.c" && Get-Content "$PSScriptRoot\..\test\wordcount_ascii_input" | . $run | |
| 48 | +# Compare-Object (Get-Content "$PSScriptRoot\..\test\wordcount_ascii_expected") | |
| 49 | +# Assert-MatchTests && |
| 50 | +gcc -std=c2x "$PSScriptRoot\x_is_x.c" && . $run && |
| 51 | +ForEach-Object 'foo' |
| 52 | + |
| 53 | +if ($Error -or !$?) { |
| 54 | + "*** C TESTS FAILED ***" |
| 55 | +} |
| 56 | +else { |
| 57 | + "C TESTS PASSED" |
| 58 | +} |
0 commit comments