Changeset 68:3a737e06dc50

Show
Ignore:
Timestamp:
07/04/08 13:49:16 (6 months ago)
Author:
Diggory Hardy <diggory.hardy@gmail.com>
branch:
default
Message:

Unittests: fixes and changes. Plus some doc changes.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • data/conf/input.mtt

    r15 r68  
    33{Default} 
    44<uint[][uint]|B=[ 0x8800001B : [[0x1000, 0x0]] ]> 
    5 {UnitTest} 
    6 <uint[][uint]|B=[ 
    7     0x88000124 : [[0x1000, 0x00F0]], 
    8     0x40000003 : [[0x1000, 0x01F0]], 
    9     0x20002005 : [ [0x1000,0x02F0],[0x1000,0x03F0] ], 
    10     0x110D600C : [[0x1000,0x04F0]], 
    11     0x120D600C : [[0x1000,0x05F0]], 
    12     0x140D600C : [[0x1000,0x06F0]], 
    13     0x180D600C : [[0x1000,0x07F0]] ]> 
    14 <uint[][uint]|A=[0x80001008 : [[0x1000,0x20F0]],0x130D600C : [[0x1000,0x21F0]] , 0x1C0D600C : [[0x1000,0x22F0]]]> 
    15 <uint[][uint]|M=[ 0x88000000 : [[0x1000, 0x10F0], [0x1000, 0x11F0]], 0x40016064:[[0x1000,0x12F0]]]> 
  • doc/Readme.txt

    r54 r68  
    22License: GNU General Public License version 2 or later (see COPYING) 
    33 
    4 Some brief info: 
     4--- Some brief info --- 
    55 
    6 Platforms: 
    7 I work on mde using linux and perform most testing on this platform. 
    8 I have done a little testing on Windows, but currently it's highly likely there may be problems on this platform. 
     6-- Platforms -- 
     7Linux: My development platform. 
     8Windows: Poorly tested; dsss.conf needs some adjusting. 
     9 
     10-- Dependencies -- 
     11Compile-time: 
     12tango (at least r3697) 
     13tango.scrapple (newer than current r58!) 
     14derelict (at least r300) 
     15 
     16Run-time: 
     17Sdl 
     18FreeType 2.3.5 (2.3.0 might work; older versions probably won't due to the binding not finding some (unneeded) symbols). 
     19OpenGL 1.3 or higher 
     20 
    921 
    1022Build instructions: 
     
    1527Testing: 
    1628dsss clean      (this is important if a previous build exists!) 
    17 dsss build bin/mdeTest 
     29dsss build -debug -debug=mdeUnitTest -C-unittest 
     30bin/mde or bin\mde 
    1831 
    1932Credits: 
  • dsss.conf

    r56 r68  
    1717[util/mtcp.d] 
    1818target=bin/mtcp 
    19  
    20 [test/mdeTest.d] 
    21 buildflags=-debug -debug=mdeUnitTest -unittest 
    22 target=bin/mdeTest 
    23 noinstall 
    24 version (Posix) { 
    25     buildflags+=-L-ldl 
    26 } 
  • mde/input/Config.d

    r67 r68  
    155155            else        file.read();            // otherwise read all 
    156156        } 
    157         catch (MT.MTException) { 
    158             logger.fatal ("Unable to load configs from: " ~ filename); 
     157        catch (MT.MTException e) { 
     158            logger.fatal ("Unable to load configs from: " ~ filename ~ ":"); 
     159            logger.fatal (e.msg); 
    159160            throw new ConfigLoadException; 
    160161        } 
  • mde/input/Input.d

    r63 r68  
    350350    * Throws: ConfigLoadException if unable to load any configs or the requested config id wasn't 
    351351    *   found. */ 
    352     void loadConfig (char[] profile = "Default") { 
    353         Config.load("input");  // FIXME: filename 
     352    void loadConfig (char[] file, char[] profile = "Default") { 
     353        Config.load(file); 
    354354        Config* c_p = profile in Config.configs; 
    355355        if (c_p) config = *c_p; 
     
    546546     
    547547    /* This unittest covers input.config.Config and input.input.Input for some events of all types. 
    548     * It is not bullet-proof, and does not cover the steam-functions other than the direct output 
     548    * It is not bullet-proof, and does not cover the stream-functions other than the direct output 
    549549    * ones (largely because these may get added at any time and tested via input tests). 
    550550    * 
     
    558558    debug (mdeUnitTest) unittest { 
    559559        Input ut = new Input(); 
    560         ut.loadConfig ("UnitTest"); 
     560        ut.loadConfig ("unittest/InputConfig"); 
    561561             
    562562        int[6] counters;    // counters for callbacks 
  • mde/mde.d

    r64 r68  
    4141    //BEGIN Initialisation 
    4242    Logger logger = Log.getLogger ("mde.mde"); 
     43    debug (mdeUnitTest) { 
     44        logger.info ("Compiled unittests have completed; terminating."); 
     45        return 0; 
     46    } 
    4347     
    4448    // Create instances now, so they can be used during init (if necessary) 
  • mde/setup/init2.d

    r63 r68  
    7272void initInput () { // init func 
    7373    try { 
    74         imde.input.loadConfig ();         // (may also create instance) 
     74        imde.input.loadConfig ("input"); 
    7575         
    7676        // Quit on escape. NOTE: quit via SDL_QUIT event is handled completely independently! 
  • mde/setup/paths.d

    r67 r68  
    132132    } body { 
    133133        FilePath[] ret; 
     134         
     135        debug (mdeUnitTest) { 
     136        /* Alternate approach - just try from current directory. 
     137        * Really just for unittests, but with the if condition it shouldn't break anything else. */ 
     138            if (pathsLen == 0) { 
     139                FilePath file = findFile (filename); 
     140                if (file !is null) 
     141                    ret ~= file; 
     142                return ret; 
     143            } 
     144        } 
     145         
    134146        if (readOrder == PRIORITY.LOW_HIGH) { 
    135147            for (size_t i = 0; i < pathsLen; ++i) {