# HG changeset patch # User thomask # Date 1097945611 0 # Node ID a53dbc47499b4e5ca2b60dc694b0876863eb7404 # Parent 1f7f839145de4266414fcc3ccdf3bed713e561f5 1) added unittest test cases [complex] 2) added commandline argument test cases [complex] 3) added debug test cases [complex] diff -r 1f7f839145de -r a53dbc47499b complex/command_line/.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/complex/command_line/.d Sat Oct 16 16:53:31 2004 +0000 @@ -0,0 +1,4 @@ +// a dummy used for command line parsing +int main(){ + return 0; +} diff -r 1f7f839145de -r a53dbc47499b complex/command_line/complex.mak --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/complex/command_line/complex.mak Sat Oct 16 16:53:31 2004 +0000 @@ -0,0 +1,80 @@ +# GnuMakefile for DStress http://dmd.kuehne.cn/dstress.html +# Copyright (C) 2004 Thomas Kuehne +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +.PHONY: \ + complex/command_line/warning \ + complex/command_line/$(complex_done) \ + complex/command_line/clean + +complex/command_line/warning : + @echo "don't invoke this file directly, instead use DStress' root Makefile with the target \"complex\" or \"all\"" + + +# +# name__command_line_arguments.cmdrun +# name__command_line_arguments.cmdfail +# all double underscores in the arguments will be replaced by whitespace +# +complex/command_line/raw = \ + complex/command_line/command_line_debug_01__-debug__-od$(OBJ_DIR)__-of$(OBJ_DIR)/dummy.xxx.cmdrun \ + complex/command_line/command_line_debug_02__-debug=1__-od$(OBJ_DIR)__-of$(OBJ_DIR)/dummy.xxx.cmdrun \ + complex/command_line/command_line_debug_03__-debug=abc__-od$(OBJ_DIR)__-of$(OBJ_DIR)/dummy.xxx.cmdrun \ + complex/command_line/command_line_debug_04__-debug=123456789__-od$(OBJ_DIR)__-of$(OBJ_DIR)/dummy.xxx.cmdrun \ + complex/command_line/command_line_debug_05__-debug=1A__-od$(OBJ_DIR)__-of$(OBJ_DIR)/dummy.xxx.cmdfail \ + complex/command_line/command_line_null_source_01__-c.cmdnullfail \ + complex/command_line/command_line_null_source_02__.cmdnullfail \ + complex/command_line/command_line_null_source_03__-c__"".cmdnullfail \ + complex/command_line/command_line_null_source_04__"".cmdnullfail \ + +# the actual target, will be called by root's "all" / "complex" target +complex/command_line/$(complex_done) : $(complex/command_line/raw) + +%.cmdrun : complex/command_line/dummy.$(ext_source) + $(eval z_raw = $(subst __, ,$*)) + $(eval z_name = $(word 1,$(z_raw))) + $(eval z_arg = $(subst $(z_name),,$(z_raw))) + @if $(DMD) $(z_arg) complex/command_line/dummy.$(ext_source) $(to_log); then \ + $(ECHO) "PASS: $(z_name)"; \ + else \ + $(ECHO) "XFAIL: $(z_name)"; \ + fi + +%.cmdfail : complex/command_line/dummy.$(ext_source) + $(eval z_raw = $(subst __, ,$*)) + $(eval z_name = $(word 1,$(z_raw))) + $(eval z_arg = $(subst $(z_name),,$(z_raw))) + @if $(DMD) $(z_arg) complex/command_line/dummy.$(ext_source) $(to_log); then \ + $(ECHO) "XPASS: $(z_name)"; \ + else \ + $(ECHO) "FAIL: $(z_name)"; \ + fi + +%.cmdnullfail : complex/command_line/dummy.$(ext_source) + $(eval z_raw = $(subst __, ,$*)) + $(eval z_name = $(word 1,$(z_raw))) + $(eval z_arg = $(subst $(z_name),,$(z_raw))) + @if $(CD) complex/command_line ; $(DMD) $(z_arg) $(to_log); then \ + $(ECHO) "XPASS: $(z_name)"; \ + else \ + $(ECHO) "FAIL: $(z_name)"; \ + fi + +# this will be called by root's "clean" target +complex/command_line/clean : + $(RM) complex/command_line/*.done + diff -r 1f7f839145de -r a53dbc47499b complex/command_line/dummy.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/complex/command_line/dummy.d Sat Oct 16 16:53:31 2004 +0000 @@ -0,0 +1,4 @@ +// a dummy used for command line parsing +int main(){ + return 0; +} diff -r 1f7f839145de -r a53dbc47499b complex/debug/complex.mak --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/complex/debug/complex.mak Sat Oct 16 16:53:31 2004 +0000 @@ -0,0 +1,69 @@ +# GnuMakefile for DStress http://dmd.kuehne.cn/dstress.html +# Copyright (C) 2004 Thomas Kuehne +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +.PHONY: \ + complex/debug/warning \ + complex/debug/$(complex_done) \ + complex/debug/clean + +complex/debug/warning : + @echo "don't invoke this file directly, instead use DStress' root Makefile with the target \"complex\" or \"all\"" + +# this will be called by root's "all" / "complex" target +complex/debug/$(complex_done) : complex/debug/debug_01.$(ext_run) complex/debug/debug_02.$(ext_run) complex/debug/debug_03.$(ext_run) complex/debug/debug_04.$(ext_nocompile) complex/debug/debug_05.$(ext_nocompile) + +complex/debug/debug_01.$(ext_run) : complex/debug/debug_01.$(ext_source) + $(eval z_name = $(subst .$(ext_run),,$@)) + @if $(DMD) $(DFLAGS) -debug -od$(OBJ_DIR) -of$@ $< $(to_log); then \ + if $@ $(to_log); then \ + $(ECHO) "PASS: $(z_name)"; \ + else \ + $(ECHO) "XFAIL: $(z_name)"; $(RM) $@; \ + fi \ + else \ + $(ECHO) "XFAIL: $(z_name) (compiling error)"; \ + fi + +complex/debug/debug_02.$(ext_run) : complex/debug/debug_02.$(ext_source) complex/debug/$(complex_todo) + $(eval z_name = $(subst .$(ext_run),,$@)) + @if $(DMD) $(DFLAGS) -debug=2 -od$(OBJ_DIR) -of$@ $< $(to_log); then \ + if $@ $(to_log); then \ + $(ECHO) "PASS: $(z_name)"; \ + else \ + $(ECHO) "XFAIL: $(z_name)"; $(RM) $@; \ + fi \ + else \ + $(ECHO) "XFAIL: debug_02 (compiling error)"; \ + fi + +complex/debug/debug_03.$(ext_run) : complex/debug/debug_03.$(ext_source) complex/debug/$(complex_todo) + $(eval z_name = $(subst .$(ext_run),,$@)) + @if $(DMD) $(DFLAGS) -debug=a -od$(OBJ_DIR) -of$@ $< $(to_log); then \ + if $@ $(to_log); then \ + $(ECHO) "PASS: $(z_name)"; \ + else \ + $(ECHO) "XFAIL: $(z_name)"; $(RM) $@; \ + fi \ + else \ + $(ECHO) "XFAIL: $(z_name) (compiling error)"; \ + fi + + +# this will be called by root's "clean" target +complex/debug/clean : + $(RM) complex/debug/$(complex_done) complex/debug/?*.$(ext_run) complex/debug/?*.$(ext_compile) complex/debug/?*.$(ext_nocompile) diff -r 1f7f839145de -r a53dbc47499b complex/debug/debug_01.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/complex/debug/debug_01.d Sat Oct 16 16:53:31 2004 +0000 @@ -0,0 +1,9 @@ +int main(){ + int x; + assert(x==0); + debug{ + x++; + } + assert(x==1); + return 0; +} diff -r 1f7f839145de -r a53dbc47499b complex/debug/debug_02.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/complex/debug/debug_02.d Sat Oct 16 16:53:31 2004 +0000 @@ -0,0 +1,17 @@ +int main(){ + int i=0; + assert(i==0); + debug(1){ + assert(i==0); + } + debug(2){ + i++; + assert(i==1); + } + debug(3){ + i++; + assert(i==2); + } + assert(i==2); + return 0; +} diff -r 1f7f839145de -r a53dbc47499b complex/debug/debug_03.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/complex/debug/debug_03.d Sat Oct 16 16:53:31 2004 +0000 @@ -0,0 +1,15 @@ +int main(){ + int i; + assert(i==0); + debug(a){ + i++; + assert(i==1); + } + debug(b){ + i++; + assert(0); + } + assert(i==1); + return 0; +} + diff -r 1f7f839145de -r a53dbc47499b complex/unittest/complex.mak --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/complex/unittest/complex.mak Sat Oct 16 16:53:31 2004 +0000 @@ -0,0 +1,41 @@ +# GnuMakefile for DStress http://dmd.kuehne.cn/dstress.html +# Copyright (C) 2004 Thomas Kuehne +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +.PHONY: \ + complex/unittest/warning \ + complex/unittest/$(complex_done) \ + complex/unittest/run \ + complex/unittest/nocompile \ + complex/unittest/clean + +ext_unittest_run = unit.$(ext_run) + +complex/unittest/warning : + @echo "don't invoke this file directly, instead use DStress' root Makefile with the target \"complex\" or \"all\"" + +# this will be called by root's "all" / "complex" target +complex/unittest/$(complex_done) : complex/unittest/run complex/unittest/nocompile + +complex/unittest/run : $(sort $(subst .$(ext_source),.$(ext_unittest_run),$(shell $(FIND) complex/unittest/run -regex ".*\\.$(ext_source)" ))) + +complex/unittest/nocompile : $(sort $(subst .$(ext_source),.$(ext_unittest_nocompile),$(shell $(FIND) complex/unittest/nocompile -regex ".*\\.$(ext_source)" ))) + +# this will be called by root's "clean" target +complex/unittest/clean : + $(RM) complex/unittest/$(complex_done) complex/unittest/run/*.$(ext_unittest_run) complex/unittest/nocompile/?*.$(ext_nocompile) + diff -r 1f7f839145de -r a53dbc47499b complex/unittest/run/unittest_01.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/complex/unittest/run/unittest_01.d Sat Oct 16 16:53:31 2004 +0000 @@ -0,0 +1,10 @@ +int status; + +int main(){ + assert(status==1); + return 0; +} + +unittest{ + status++; +}