File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,14 +23,16 @@ jobs:
2323 os : osx
2424 osx_image : xcode10
2525 script :
26+ # On macOS swift test (i.e. XCTest) outputs to stderr so we need to redirect pipes.
2627 - swift test -c release -Xswiftc -enable-testing --filter BitByteDataBenchmarks 2>&1 | ./ppbenchmarks.py
2728 - language : generic
2829 os : linux
2930 dist : trusty
3031 install :
3132 - eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"
3233 script :
33- - swift test -c release -Xswiftc -enable-testing --filter BitByteDataBenchmarks 2>&1 | ./ppbenchmarks.py
34+ # On Linux swift test outputs to stdout so we don't need to do anything.
35+ - swift test -c release -Xswiftc -enable-testing --filter BitByteDataBenchmarks | ./ppbenchmarks.py
3436 - stage : deploy
3537 if : tag IS present
3638 language : generic
Original file line number Diff line number Diff line change 88for line in sys .stdin :
99 line = line .rstrip ()
1010 print (line )
11- p = re .compile ("Test Case '-\[BitByteDataBenchmarks\.(.+Benchmarks) (test.+)\]'.+average: (\d+.\d+), relative standard deviation: (\d+.\d+)\%" )
11+ p = None
12+ # Output format of 'swift test' differs between macOS and Linux platforms.
13+ if sys .platform == "darwin" :
14+ p = re .compile ("Test Case '-\[BitByteDataBenchmarks\.(.+Benchmarks) (test.+)\]'.+average: (\d+.\d+), relative standard deviation: (\d+.\d+)\%" )
15+ elif sys .platform == "linux" :
16+ p = re .compile ("Test Case '(.+Benchmarks)\.(test.+)'.+average: (\d+.\d+), relative standard deviation: (\d+.\d+)\%" )
17+ else :
18+ raise Exception ("Unknown platform: " + sys .platform )
19+
1220 matches = p .findall (line )
1321 if len (matches ) == 1 and len (matches [0 ]) == 4 :
1422 benchmark_name = matches [0 ][0 ]
You can’t perform that action at this time.
0 commit comments