Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1352 from MartinNowak/fixTest
Browse files Browse the repository at this point in the history
output coverage reports to $(ROOT) to avoid test interference
  • Loading branch information
schveiguy committed Aug 25, 2015
2 parents 478b6c5 + d1d9128 commit 64cceb1
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 15 deletions.
14 changes: 7 additions & 7 deletions test/coverage/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ all: $(NORMAL_TESTS) $(MERGE_TESTS)

$(NORMAL_TESTS): $(ROOT)/%.done: $(ROOT)/%
@echo Testing $*
@rm -f src-$*.lst
$(QUIET)$(ROOT)/$* $(RUN_ARGS)
$(QUIET)$(DIFF) src-$*.lst.exp src-$*.lst
@rm -f $(ROOT)/src-$*.lst
$(QUIET)$(ROOT)/$* $(ROOT) $(RUN_ARGS)
$(QUIET)$(DIFF) src-$*.lst.exp $(ROOT)/src-$*.lst
@touch $@

$(MERGE_TESTS): $(ROOT)/%.done: $(ROOT)/%
@echo Testing $*
@rm -f src-$*.lst
$(QUIET)$(ROOT)/$* $(RUN_ARGS)
$(QUIET)$(ROOT)/$* $(RUN_ARGS)
$(QUIET)$(DIFF) src-$*.lst.exp src-$*.lst
@rm -f $(ROOT)/src-$*.lst
$(QUIET)$(ROOT)/$* $(ROOT) $(RUN_ARGS)
$(QUIET)$(ROOT)/$* $(ROOT) $(RUN_ARGS)
$(QUIET)$(DIFF) src-$*.lst.exp $(ROOT)/src-$*.lst
@touch $@

$(ROOT)/%: $(SRC)/%.d
Expand Down
6 changes: 4 additions & 2 deletions test/coverage/src-basic.lst.exp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
|int main()
|import core.runtime;
|
|void main(string[] args)
|{
1| return 0;
1| dmd_coverDestPath(args[1]);
|}
src/basic.d is 100% covered
5 changes: 4 additions & 1 deletion test/coverage/src-merge.lst.exp
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
|int main()
|import core.runtime;
|
|int main(string[] args)
|{
1| dmd_coverDestPath(args[1]);
1| return 0;
|}
src/merge.d is 100% covered
3 changes: 2 additions & 1 deletion test/coverage/src-merge_true.lst.exp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
|import core.runtime;
|
|void main()
|void main(string[] args)
|{
2| dmd_coverDestPath(args[1]);
2| dmd_coverSetMerge(true);
|}
src/merge_true.d is 100% covered
6 changes: 4 additions & 2 deletions test/coverage/src/basic.d
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
int main()
import core.runtime;

void main(string[] args)
{
return 0;
dmd_coverDestPath(args[1]);
}
5 changes: 4 additions & 1 deletion test/coverage/src/merge.d
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
int main()
import core.runtime;

int main(string[] args)
{
dmd_coverDestPath(args[1]);
return 0;
}
3 changes: 2 additions & 1 deletion test/coverage/src/merge_true.d
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import core.runtime;

void main()
void main(string[] args)
{
dmd_coverDestPath(args[1]);
dmd_coverSetMerge(true);
}

0 comments on commit 64cceb1

Please sign in to comment.