*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Thu, 24 Mar 2016 00:15:05 +0100
changeset 3101fecaf68f3b4
parent 309 8061d7da3fc3
child 311 83f952e15a2c
*** empty log message ***
quickSelfTest/SelfTest.st
     1.1 --- a/quickSelfTest/SelfTest.st	Wed Mar 23 23:08:42 2016 +0100
     1.2 +++ b/quickSelfTest/SelfTest.st	Thu Mar 24 00:15:05 2016 +0100
     1.3 @@ -4,7 +4,10 @@
     1.4  "/
     1.5  "/ stx --noBanner -I --execute SelfTest.st
     1.6  "/
     1.7 -"/   use --debug to debug failed test cases.
     1.8 +"/   use
     1.9 +"/      --debug to debug failed test cases.
    1.10 +"/      --skipTests to skip tests
    1.11 +"/      --skipMetrics to metric reports tests
    1.12  "/
    1.13  "/ To use with jenkins (+ jUnit plugin):
    1.14  "/ use the following buildscript (in jenkins):
    1.15 @@ -76,53 +79,78 @@
    1.16      ]
    1.17  ].
    1.18  
    1.19 -Stdout showCR:'Running suite...'.
    1.20 -debugging := (Smalltalk commandLineArgumentNamed:'--debug') notNil.
    1.21 -result := suite
    1.22 -	    run:TestResultStX new beforeEachDo:[:test |
    1.23 -		Stdout showCR:('- running ',test printString).
    1.24 -	    ]
    1.25 -	    afterEachDo:[:test|
    1.26 -		Stdout showCR:('- done ',test printString).
    1.27 -	    ]
    1.28 -	    debug:debugging.
    1.29 +"/
    1.30 +"/ run the suite
    1.31 +"/
    1.32 +(Smalltalk commandLineArgumentNamed:'--skipTests') notNil ifTrue:[
    1.33 +    Stdout showCR:'Skipping suite.'.
    1.34 +] ifFalse:[
    1.35 +    Stdout showCR:'Running suite...'.
    1.36 +    debugging := (Smalltalk commandLineArgumentNamed:'--debug') notNil.
    1.37 +    result := suite
    1.38 +		run:TestResultStX new
    1.39 +		beforeEachDo:[:test |
    1.40 +		    Stdout showCR:('- running ',test printString).
    1.41 +		]
    1.42 +		afterEachDo:[:test|
    1.43 +		    Stdout showCR:('- done ',test printString).
    1.44 +		]
    1.45 +		debug:debugging.
    1.46  
    1.47 -Stdout showCR:'Generating report...'.
    1.48 -TestResultReporter
    1.49 -    report:result
    1.50 -    format:#xml_jUnit
    1.51 -    as:'testresult.xml'.
    1.52 +    Stdout showCR:'Generating report...'.
    1.53 +    TestResultReporter
    1.54 +	report:result
    1.55 +	format:#xml_jUnit
    1.56 +	as:'testresult.xml'.
    1.57  
    1.58 -Stdout showCR:'Summary:'.
    1.59 -Stdout showCR:('  %1 tests;' bindWith:result runCount).
    1.60 -Stdout show:('  %1 passed,' bindWith:result passedCount).
    1.61 -Stdout show:(' %1 failed,' bindWith:result failureCount).
    1.62 -Stdout showCR:(' %1 errors.' bindWith:result errorCount).
    1.63 +    Stdout showCR:'Summary:'.
    1.64 +    Stdout showCR:('  %1 tests;' bindWith:result runCount).
    1.65 +    Stdout show:('  %1 passed,' bindWith:result passedCount).
    1.66 +    Stdout show:(' %1 failed,' bindWith:result failureCount).
    1.67 +    Stdout showCR:(' %1 errors.' bindWith:result errorCount).
    1.68 +].
    1.69  
    1.70 -'metrics.xml' asFilename writingFileDo:[:stream |
    1.71 -    MetricsReporter new
    1.72 -	stream: stream;
    1.73 -	packages:{
    1.74 -	    'stx:libbasic'       .
    1.75 -	    'stx:libbasic2'      .
    1.76 -	    'stx:libbasic3'      .
    1.77 -	    'stx:libcomp'        .
    1.78 -	    'stx:libview'        .
    1.79 -	    'stx:libview2'       .
    1.80 -	    'stx:libwidg'        .
    1.81 -	    'stx:libwidg2'       .
    1.82 -	    'stx:libtool'        .
    1.83 -	    'stx:libtool2'       .
    1.84 -	    'stx:libui'          .
    1.85 -	    'stx:libhtml'        .
    1.86 -	    'stx:goodies/xml/vw' .
    1.87 -	    'stx:goodies/soap'   .
    1.88 -	    'stx:libjavascript'  .
    1.89 -	};
    1.90 -	classMetricNames: #();
    1.91 -	methodMetricNames: #();
    1.92 -	packageMetricNames: #( 'LOC' 'NOM' 'NOC');
    1.93 -	reportXml_metrics.
    1.94 +"/
    1.95 +"/ generate a metrics report
    1.96 +"/
    1.97 +#(
    1.98 +	    'stx:libbasic'
    1.99 +	    'stx:libbasic2'
   1.100 +	    'stx:libbasic3'
   1.101 +	    'stx:libcomp'
   1.102 +	    'stx:libview'
   1.103 +	    'stx:libview2'
   1.104 +	    'stx:libwidg'
   1.105 +	    'stx:libwidg2'
   1.106 +	    'stx:libtool'
   1.107 +	    'stx:libtool2'
   1.108 +	    'stx:libui'
   1.109 +	    'stx:libhtml'
   1.110 +	    'stx:libjavascript'
   1.111 +	    'stx:goodies/xml/stx'
   1.112 +	    'stx:goodies/xml/yaxo'
   1.113 +	    'stx:goodies/xml/xsl'
   1.114 +	    'stx:goodies/xml/xpath'
   1.115 +	    'stx:goodies/net'
   1.116 +	    'stx:goodies/communication'
   1.117 +	    'stx:goodies/webServer'
   1.118 +	    'stx:goodies/soap'
   1.119 +) do:[:p | Smalltalk loadPackage:p].
   1.120 +
   1.121 +(Smalltalk commandLineArgumentNamed:'--skipMetrics') notNil ifTrue:[
   1.122 +    Stdout showCR:'Skipping metrics.'.
   1.123 +] ifFalse:[
   1.124 +    'metrics.xml' asFilename writingFileDo:[:stream |
   1.125 +	MetricsReporter new
   1.126 +	    stream: stream;
   1.127 +	    packages:{
   1.128 +		'stx:*'       .
   1.129 +	    };
   1.130 +	    classMetricNames: #();
   1.131 +	    methodMetricNames: #();
   1.132 +	    packageMetricNames: #( 'LOC' 'NOM' 'NOC');
   1.133 +	    reportXml_metrics.
   1.134 +    ].
   1.135  ].
   1.136  
   1.137  !