diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000000..819532d2b7 --- /dev/null +++ b/.codecov.yml @@ -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 diff --git a/test/d_do_test.d b/test/d_do_test.d index 8eaba218af..588a5f95ef 100755 --- a/test/d_do_test.d +++ b/test/d_do_test.d @@ -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 = ""; diff --git a/travis.sh b/travis.sh index 0e1d29bcb1..fe9b93b817 100755 --- a/travis.sh +++ b/travis.sh @@ -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"