Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
machine:
environment:
DMD_VERSION: 2.071.1
PATH: "${HOME}/dmd2/linux/bin64:${PATH}"
LD_LIBRARY_PATH: "${HOME}/dmd2/linux/lib64:${LD_LIBRARY_PATH}"
SELF_COMPILE: 2
SELF_DMD_TEST_COVERAGE: 1
DC: dmd
DMD: dmd
dependencies:
pre:
- sudo apt-get update; sudo apt-get install g++-multilib
override:
- curl -fsSL --retry 3 "http://downloads.dlang.org/releases/2.x/${DMD_VERSION}/dmd.${DMD_VERSION}.linux.tar.xz" | tar -C ~ -Jxf -
- dmd --version
test:
override:
- case $CIRCLE_NODE_INDEX in 0) MODEL=32 ./travis.sh ;; 1) MODEL=64 ./travis.sh ;; esac:
parallel: true
post:
- bash <(curl -s https://codecov.io/bash)
20 changes: 20 additions & 0 deletions src/mars.d
Original file line number Diff line number Diff line change
Expand Up @@ -1582,6 +1582,26 @@ int main()
{
GC.disable();
}
version(D_Coverage)
{
// for now we need to manually set the source path
string dirName(string path, char separator)
{
for (size_t i = path.length - 1; i > 0; i--)
{
if (path[i] == separator)
return path[0..i];
}
return path;
}
version (Windows)
enum sourcePath = dirName(__FILE_FULL_PATH__, `\`);
else
enum sourcePath = dirName(__FILE_FULL_PATH__, '/');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary? Couldn't you just run the script that parses the coverage results from the src folder so that the relative paths work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't you just run the script that parses the coverage results from the src folder so that the relative paths work.

Well the script just runs the normal test_runner without modifications, the only change is that dmd has been compiled with -cov.
I am not very familiar with the dmd setup, so if you have better ideas, shoot! ;-)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not about the test runner, but about the resulting coverage files (*.lst). Wouldn't it work if you upload them after changing into the src folder? That folder is our compilation root.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I am not mistaken, If Druntime can't find the source files, it will just produce empty .lst files.

Wouldn't it work if you upload them after changing into the src folder?

It turns out that we don't need to set the dest directory, because the issue was on CodeCov's side and one can manually set mapping patterns.
(the dest directory change is a later follow-up)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I am not mistaken, If Druntime can't find the source files, it will just produce empty .lst files.

Yes, sounds true.


dmd_coverSourcePath(sourcePath);
dmd_coverSetMerge(true);
}

auto args = Runtime.cArgs();
return tryMain(args.argc, cast(const(char)**)args.argv);
Expand Down
2 changes: 2 additions & 0 deletions src/posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ endif
DFLAGS=
# Enable D warnings
DFLAGS += -wi
# Enable coverage statistics if requested
DFLAGS += $(if $(DMD_TEST_COVERAGE),-cov,)

ifneq (,$(DEBUG))
ENABLE_DEBUG := 1
Expand Down
13 changes: 11 additions & 2 deletions travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ make -j$N -C ../druntime -f posix.mak MODEL=$MODEL
make -j$N -C ../phobos -f posix.mak MODEL=$MODEL

while [ $SELF_COMPILE -gt 0 ]; do
if [ $SELF_COMPILE -eq 1 ] && [ $DMD = "dmd" ] && ! [ -z "$SELF_DMD_TEST_COVERAGE" ] ; then
echo "Building with coverage statistics"
export DMD_TEST_COVERAGE=1
fi

# rebuild dmd using the just build dmd as host compiler
mv src/dmd src/host_dmd
make -j$N -C src -f posix.mak MODEL=$MODEL HOST_DMD=./host_dmd clean
Expand All @@ -30,8 +35,12 @@ while [ $SELF_COMPILE -gt 0 ]; do
SELF_COMPILE=$(($SELF_COMPILE - 1))
done

make -j$N -C ../druntime -f posix.mak MODEL=$MODEL unittest
make -j$N -C ../phobos -f posix.mak MODEL=$MODEL unittest
# Only run runtime + phobos tests on Travis
if [ "${CIRCLECI}" != "true" ] ; then
make -j$N -C ../druntime -f posix.mak MODEL=$MODEL unittest
make -j$N -C ../phobos -f posix.mak MODEL=$MODEL unittest
fi

# test fewer compiler argument permutations for PRs to reduce CI load
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
make -j$N -C test MODEL=$MODEL
Expand Down