Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

Automatic code testing in c upon execution -


each source file has function:

unsigned char test(){     //return true if tests succceed false otherwise } 

everytime sourcefile gets recompiled want test function of file run on execution of executable , if tests return false halt. however, want code test code hasnt been run since build.

i thinking use makefile system problem since makefiles recompile changed code want. therefore, thinking of adding command line arguments. saw example in used echo , date add time last modified. code write time last modified save file on successful execution of test code compare next time.

is there better way? 1 doesnt rely on make? @ least there way without relying on spefic unix commands? lastly, if isnt possible, command line addition file like.

yes, make file.t target dependant on file.c.
file.t generated based on successful completion of test.

it'll easier if call test function "main" , wrap in #ifdef's this:

#ifdef test int main() {     if (test_something() == 1)         return 0;     else         return 1; } #endif 

of course, can other trickier things if want.

an example makefile (using gnu make syntax)

all: foo.t  %.t: %.c     gcc -dtest $< -o $@.tmp     if ./$@.tmp ; echo "1" > $@; rm $@.tmp ; fi 

however! you'll better off adopting cutest (http://cutest.sourceforge.net/).


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -