mirror of
https://github.com/dlang/dmd.git
synced 2025-04-25 20:50:41 +03:00
Reduce coverage load
This commit is contained in:
parent
4339176142
commit
3180131028
3 changed files with 21 additions and 2 deletions
7
.codecov.yml
Normal file
7
.codecov.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
# Documentation: https://github.com/codecov/support/wiki/codecov.yml
|
||||
|
||||
codecov:
|
||||
# CodeCov should only wait for CI's that run coverage tests
|
||||
# DAutoTester and auto-tester are not in the default list
|
||||
ci:
|
||||
- !travis
|
|
@ -1,3 +1,4 @@
|
|||
#!/usr/bin/env rdmd
|
||||
module d_do_test;
|
||||
|
||||
import std.algorithm;
|
||||
|
@ -80,6 +81,7 @@ struct EnvData
|
|||
string model;
|
||||
string required_args;
|
||||
bool dobjc;
|
||||
bool coverage_build;
|
||||
}
|
||||
|
||||
bool findTestParameter(string file, string token, ref string result)
|
||||
|
@ -446,6 +448,7 @@ int main(string[] args)
|
|||
envData.model = environment.get("MODEL");
|
||||
envData.required_args = environment.get("REQUIRED_ARGS");
|
||||
envData.dobjc = environment.get("D_OBJC") == "1";
|
||||
envData.coverage_build = environment.get("DMD_TEST_COVERAGE") == "1";
|
||||
|
||||
string result_path = envData.results_dir ~ envData.sep;
|
||||
string input_file = input_dir ~ envData.sep ~ test_name ~ "." ~ test_extension;
|
||||
|
@ -465,6 +468,10 @@ int main(string[] args)
|
|||
return 1;
|
||||
}
|
||||
|
||||
// running & linking costs time - for coverage builds we can save this
|
||||
if (envData.coverage_build && testArgs.mode == TestMode.RUN)
|
||||
testArgs.mode = TestMode.COMPILE;
|
||||
|
||||
if (envData.ccompiler.empty)
|
||||
{
|
||||
switch (envData.os)
|
||||
|
@ -632,7 +639,7 @@ int main(string[] args)
|
|||
|
||||
fThisRun.close();
|
||||
|
||||
if (testArgs.postScript)
|
||||
if (testArgs.postScript && !envData.coverage_build)
|
||||
{
|
||||
f.write("Executing post-test script: ");
|
||||
string prefix = "";
|
||||
|
|
|
@ -52,8 +52,13 @@ if [ "${CIRCLECI}" != "true" ] ; then
|
|||
make -j$N -C ../phobos -f posix.mak MODEL=$MODEL unittest
|
||||
fi
|
||||
|
||||
QUICK_BUILD=0
|
||||
if [ "$TRAVIS_PULL_REQUEST" == "false" ] || [ "$CIRCLECI" == "true" ]; then
|
||||
QUICK_BUILD=1
|
||||
fi
|
||||
|
||||
# test fewer compiler argument permutations for PRs to reduce CI load
|
||||
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
|
||||
if [ $QUICK_BUILD -eq 1 ]; then
|
||||
make -j$N -C test MODEL=$MODEL
|
||||
else
|
||||
make -j$N -C test MODEL=$MODEL ARGS="-O -inline -release"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue