Changeset 692

Show
Ignore:
Timestamp:
07/23/07 12:34:39 (1 year ago)
Author:
Gregor
Message:

Added --test option to test built libraries.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/docs/ChangeLog

    r685 r692  
     1SVN from 0.68: 
     2    - Added --test option to test built libraries. 
     3 
    140.68 from 0.67: 
    25        - Rebuild: -of<name> now converts / to \ on Windows (see ticket #85). 
  • trunk/dsss.conf

    r600 r692  
    2929# Install this as a sourcelibrary, so it will work on any platform/compiler combination 
    3030type = sourcelibrary 
     31exclude = sss/dsss_lib_test.d sss/dsssdll.d sss/main.d sss/stub.d 
     32buildflags = -Irebuild 
     33 
     34# dsss_lib_test is special, so put it in share/ 
     35postinstall = install sss/dsss_lib_test.d $PREFIX/share/dsss 
    3136 
    3237version (Windows) { 
  • trunk/sss/build.d

    r642 r692  
    234234            // if we should, build the library 
    235235            if ((type == "library" && libsSafe()) || 
    236                 doDocs /* need to build the library to get docs */ ) { 
     236                doDocs /* need to build the library to get docs */ || 
     237                testLibs /* need to build the ilbrary to test it */) { 
    237238                 
    238239                if (targetGNUOrPosix()) { 
     
    241242                    char[] stbl = bl ~ docbl ~ bflags ~ " -explicit -lib -full " ~ fileList ~ " -oflibS" ~ target ~ ".a"; 
    242243                    saySystemRDie(stbl, "-rf", target ~ "_static.rf", deleteRFiles); 
     244 
     245                    // perhaps test the static library 
     246                    if (testLibs) { 
     247                        writefln("Testing %s", target); 
     248                        char[] tbl = bl ~ bflags ~ " -unittest -full " ~ fileList ~ " " ~ dsssLibTestDPrefix ~ " -oftest_" ~ target; 
     249                        saySystemRDie(tbl, "-rf", target ~ "_test.rf", deleteRFiles); 
     250                        saySystemDie("./test_" ~ target); 
     251                    } 
    243252                     
    244253                    if (shLibSupport() && 
     
    258267                    char[] stbl = bl ~ docbl ~ bflags ~ " -explicit -lib -full " ~ fileList ~ " -ofS" ~ target ~ ".lib"; 
    259268                    saySystemRDie(stbl, "-rf", target ~ "_static.rf", deleteRFiles); 
     269 
     270                    // perhaps test the static library 
     271                    if (testLibs) { 
     272                        writefln("Testing %s", target); 
     273                        char[] tbl = bl ~ bflags ~ " -unittest -full " ~ fileList ~ " " ~ dsssLibTestDPrefix ~ " -oftest_" ~ target ~ ".exe"; 
     274                        saySystemRDie(tbl, "-rf", target ~ "_test.rf", deleteRFiles); 
     275                        saySystemDie("test_" ~ target ~ ".exe"); 
     276                    } 
     277 
    260278                } else { 
    261279                    assert(0); 
  • trunk/sss/clean.d

    r653 r692  
    106106                // first remove the static library 
    107107                tryRemove("libS" ~ target ~ ".a"); 
     108 
     109                // then any testing binary 
     110                tryRemove("test_" ~ target); 
    108111                 
    109112                // then remove the shared libraries 
     
    119122                // first remove the static library 
    120123                tryRemove("S" ~ target ~ ".lib"); 
     124 
     125                // then any testing binary 
     126                tryRemove("test_" ~ target); 
    121127                 
    122128                // then remove the shared libraries 
  • trunk/sss/conf.d

    r682 r692  
    109109char[] candyDocPrefix; 
    110110 
     111/** The location of dsss_lib_test.d */ 
     112char[] dsssLibTestDPrefix; 
     113 
    111114/** Are we doing documentation? */ 
    112115bool doDocs = false; 
     
    114117/** Should we delete response files? */ 
    115118bool deleteRFiles = true; 
     119 
     120/** Should we generate test binaries? */ 
     121bool testLibs = false; 
    116122 
    117123/** The prefix for scratch work */ 
     
    196202                installPrefix ~ std.path.sep ~ 
    197203                "candydoc.tar.gz"); 
     204        if (!dsssLibTestDPrefix.length) 
     205            dsssLibTestDPrefix = canonPath( 
     206                installPrefix ~ std.path.sep ~ 
     207                "sss" ~ std.path.sep ~ 
     208                "dsss_lib_test.d"); 
    198209    } else { 
    199210        inSourceDir = false; 
     
    258269                "dsss" ~ std.path.sep ~ 
    259270                "candydoc.tar.gz"); 
     271        if (!dsssLibTestDPrefix.length) 
     272            dsssLibTestDPrefix = canonPath( 
     273                installPrefix ~ std.path.sep ~ 
     274                ".." ~ std.path.sep ~ 
     275                "share" ~ std.path.sep ~ 
     276                "dsss" ~ std.path.sep ~ 
     277                "dsss_lib_test.d"); 
    260278    } 
    261279     
  • trunk/sss/main.d

    r685 r692  
    206206                       arg[0] == '-') { 
    207207                // perhaps specific to a command 
    208                 if (command == cmd_t.NET) { 
     208                if (command == cmd_t.BUILD) { 
     209                    if (parseArg(arg, "test", false)) { 
     210                        testLibs = true; 
     211                    } else { 
     212                        dsss_buildOptions ~= arg ~ " "; 
     213                    } 
     214 
     215                } else if (command == cmd_t.NET) { 
    209216                    if (parseArg(arg, "source", true, &val)) { 
    210217                        forceMirror = val; 
     
    315322    } else if (command == cmd_t.BUILD) { 
    316323        writefln( 
    317 `Usage: dsss [dsss options] build [build options] [sources, binaries or packages]` 
     324`Usage: dsss [dsss options] build [build options] [sources, binaries or packages] 
     325  Build options: 
     326    --test: test compiled libraries` 
    318327            ); 
    319328         
     
    346355        writefln( 
    347356`Usage: dsss [dsss options] net <net command> [options] <package name> 
    348   Net Commands: 
     357  Net commands: 
    349358    deps:    install (from the network source) dependencies of the present 
    350359             package