Wiki

Ticket #236: cin-test.patch

File cin-test.patch, 2.5 KB (added by hopscc, 14 years ago)
  • Source/Compiler.cobra

     
    335335    def compileFilesNamed(paths as IList<of String>, writeTestInvocation as bool, stopCompilation as Predicate<of Compiler>?) 
    336336        _initBackEnd 
    337337        .defaultOutName = if(.options.buildStandardLibrary, 'Cobra.Lang.dll', paths[0]) 
    338         if .options.boolValue('compile-if-needed') 
     338        if (.options.boolValue('compile') or .options.boolValue('run')) and .options.boolValue('compile-if-needed')  
    339339            outName = .backEnd.computeOutName    
    340340            if not .isCompilationNeeded(outName, paths) 
    341341                return 
  • Tests/700-command-line/115-cin-test.cobra

     
     1# .skip. Run from 115-compile-if-needed-and-test.cobra 
     2# test case for -compile-if-needed and test tkt:236 
     3class P 
     4 
     5    def main is shared 
     6        test 
     7            expect AssertException 
     8                assert false 
     9        body 
     10            print 'hello' 
  • Tests/700-command-line/115-compile-if-needed-and-test.cobra

     
     1# test -compile-if-needed and test tkt:236 
     2class Test 
     3 
     4    def main is shared 
     5        file = '115-cin-test' 
     6        src  = '[file].cobra' 
     7        cobraPath = CobraCore.findCobraExe to ! 
     8        p as System.Diagnostics.Process? 
     9         
     10        .touch(src) 
     11        output = CobraCore.runCobraExe(cobraPath, '-cin -test [src]', out p) 
     12        assert '6 tests run' in output 
     13        assert '6 successes.' in output 
     14        assert '0 failures.' in output 
     15        assert p.exitCode == 0  
     16        #print '.' stop 
     17         
     18         
     19    def touch(fileName as String) is shared 
     20        File.setLastWriteTime(fileName, DateTime.now)    
     21         
  • Developer/IntermediateReleaseNotes.text

     
    477477* Fixed: File and line number are duplicated in some compiler error messages.  ticket:212 
    478478 
    479479* Fixed: Some invariants cause an internal error.  ticket:248 
     480 
     481* Fixed: -cin and -test gets ArgumentOutOfRangeException.  ticket:236 
     482