File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 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+ g++ - std= c+ +20 " $PSScriptRoot \anagrams.cpp" && . $run rats |
15+ Compare-Object (Get-Content " $PSScriptRoot \..\test\rats_heap_expected" ) |
16+ Assert-MatchTests &&
17+ g++ - std= c+ +20 " $PSScriptRoot \animals.cpp" && . $run &&
18+ g++ - std= c+ +20 " $PSScriptRoot \basic_types.cpp" && . $run &&
19+ g++ - std= c+ +20 " $PSScriptRoot \if_then_else.cpp" && . $run &&
20+ g++ - std= c+ +20 " $PSScriptRoot \maps.cpp" && . $run &&
21+ g++ - std= c+ +20 " $PSScriptRoot \permutations.cpp" && . $run I like carrots |
22+ Compare-Object (Get-Content " $PSScriptRoot \..\test\carrots_expected" ) |
23+ Assert-MatchTests &&
24+ g++ - std= c+ +20 " $PSScriptRoot \smart_pointers.cpp" && . $run &&
25+ g++ - std= c+ +20 " $PSScriptRoot \sum_of_even_squares.cpp" && . $run &&
26+ g++ - std= c+ +20 " $PSScriptRoot \top_ten_scorers.cpp" && Get-Content " $PSScriptRoot \..\test\wnba_input" | . $run |
27+ Compare-Object (Get-Content " $PSScriptRoot \..\test\wnba_expected" ) |
28+ Assert-MatchTests &&
29+ g++ - std= c+ +20 " $PSScriptRoot \triple.cpp" && . $run |
30+ Compare-Object (Get-Content " $PSScriptRoot \..\test\triple_expected" ) |
31+ Assert-MatchTests &&
32+ ForEach-Object ' foo'
33+
34+ if ($Error -or ! $? ) {
35+ " *** C++ TESTS FAILED ***"
36+ }
37+ else {
38+ " C++ TESTS PASSED"
39+ }
You can’t perform that action at this time.
0 commit comments