Changeset 2010 for trunk/Cbc/test


Ignore:
Timestamp:
Feb 23, 2014 3:43:03 PM (6 years ago)
Author:
mlubin
Message:

Include CInterfaceTest in build script

Location:
trunk/Cbc/test
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/test/CInterfaceTest.c

    r2009 r2010  
    1 // $Id$
    2 // Copyright (C) 2014, International Business Machines
    3 // Corporation and others.  All Rights Reserved.
    4 // This code is licensed under the terms of the Eclipse Public License (EPL).
     1/* $Id$ */
     2/* Copyright (C) 2014, International Business Machines
     3  Corporation and others.  All Rights Reserved.
     4   This code is licensed under the terms of the Eclipse Public License (EPL). */
    55
    6 #include <coin/Cbc_C_Interface.h>
     6#include "Cbc_C_Interface.h"
    77#include <assert.h>
    88#include <math.h>
     
    1313    Cbc_Model *model = Cbc_newModel();
    1414
    15     // Simple knapsack problem
    16     // Minimize -5x[1] - 3x[2] - 2x[3] - 7x[4] - 4x[5]
    17     // s.t.      2x[1] + 8x[2] + 4x[3] + 2x[4] + 5x[5] <= 10
    18     // All x binary
     15    /* Simple knapsack problem
     16       Minimize -5x[1] - 3x[2] - 2x[3] - 7x[4] - 4x[5]
     17       s.t.      2x[1] + 8x[2] + 4x[3] + 2x[4] + 5x[5] <= 10
     18       All x binary
     19       */
    1920   
    2021    CoinBigIndex start[] = {0, 1, 2, 3, 4, 5, 6};
  • trunk/Cbc/test/Makefile.am

    r1714 r2010  
    1616
    1717if COIN_HAS_CLP
    18   CBC_TEST_TGTS += test_cbc
     18  CBC_TEST_TGTS += test_cbc ctests
    1919endif
    2020if CBC_BUILD_CBC_GENERIC
     
    5757.PHONY: test
    5858
    59 bin_PROGRAMS = gamsTest osiUnitTest
     59bin_PROGRAMS = gamsTest osiUnitTest CInterfaceTest
    6060
    6161gamsTest_SOURCES = gamsTest.cpp
     
    8787
    8888########################################################################
     89#                         unitTest for CbcCInterface                   #
     90########################################################################
     91
     92CInterfaceTest_SOURCES = CInterfaceTest.c
     93
     94CInterfaceTest_LDADD = ../src/libCbc.la $(CBCLIB_LIBS)
     95
     96CInterfaceTest_DEPENDENCIES = ../src/libCbc.la $(CBCLIB_DEPENDENCIES)
     97
     98ctests: CInterfaceTest$(EXEEXT)
     99        ./CInterfaceTest$(EXEEXT)
     100
     101########################################################################
    89102#                          Cleaning stuff                              #
    90103########################################################################
  • trunk/Cbc/test/Makefile.in

    r1979 r2010  
    4343build_triplet = @build@
    4444host_triplet = @host@
    45 @COIN_HAS_CLP_TRUE@am__append_1 = test_cbc
     45@COIN_HAS_CLP_TRUE@am__append_1 = test_cbc ctests
    4646@CBC_BUILD_CBC_GENERIC_TRUE@@COIN_HAS_SAMPLE_TRUE@am__append_2 = test_cbc_generic
    4747@COIN_HAS_SAMPLE_TRUE@am__append_3 = -dirSample `$(CYGPATH_W) $(SAMPLE_DATA)`
     
    4949@COIN_HAS_MIPLIB3_TRUE@am__append_5 = -dirMiplib `$(CYGPATH_W) $(MIPLIB3_DATA)` -miplib
    5050@COIN_HAS_NETLIB_TRUE@am__append_6 = -netlibDir=`$(CYGPATH_W) $(NETLIB_DATA)` -testOsiSolverInterface
    51 bin_PROGRAMS = gamsTest$(EXEEXT) osiUnitTest$(EXEEXT)
     51bin_PROGRAMS = gamsTest$(EXEEXT) osiUnitTest$(EXEEXT) \
     52        CInterfaceTest$(EXEEXT)
    5253subdir = test
    5354DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
     
    6465binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
    6566PROGRAMS = $(bin_PROGRAMS)
     67am_CInterfaceTest_OBJECTS = CInterfaceTest.$(OBJEXT)
     68CInterfaceTest_OBJECTS = $(am_CInterfaceTest_OBJECTS)
     69am__DEPENDENCIES_1 =
    6670am_gamsTest_OBJECTS = gamsTest.$(OBJEXT)
    6771gamsTest_OBJECTS = $(am_gamsTest_OBJECTS)
    68 am__DEPENDENCIES_1 =
    6972am_osiUnitTest_OBJECTS = osiUnitTest.$(OBJEXT) \
    7073        OsiCbcSolverInterfaceTest.$(OBJEXT)
     
    7275depcomp = $(SHELL) $(top_srcdir)/depcomp
    7376am__depfiles_maybe = depfiles
     77COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
     78        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
     79LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
     80        $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
     81        $(AM_CFLAGS) $(CFLAGS)
     82CCLD = $(CC)
     83LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
     84        $(AM_LDFLAGS) $(LDFLAGS) -o $@
    7485CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
    7586        $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
     
    8091CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
    8192        $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
    82 SOURCES = $(gamsTest_SOURCES) $(osiUnitTest_SOURCES)
    83 DIST_SOURCES = $(gamsTest_SOURCES) $(osiUnitTest_SOURCES)
     93SOURCES = $(CInterfaceTest_SOURCES) $(gamsTest_SOURCES) \
     94        $(osiUnitTest_SOURCES)
     95DIST_SOURCES = $(CInterfaceTest_SOURCES) $(gamsTest_SOURCES) \
     96        $(osiUnitTest_SOURCES)
    8497ETAGS = etags
    8598CTAGS = ctags
     
    438451
    439452########################################################################
     453#                         unitTest for CbcCInterface                   #
     454########################################################################
     455CInterfaceTest_SOURCES = CInterfaceTest.c
     456CInterfaceTest_LDADD = ../src/libCbc.la $(CBCLIB_LIBS)
     457CInterfaceTest_DEPENDENCIES = ../src/libCbc.la $(CBCLIB_DEPENDENCIES)
     458
     459########################################################################
    440460#                          Cleaning stuff                              #
    441461########################################################################
     
    447467
    448468.SUFFIXES:
    449 .SUFFIXES: .cpp .lo .o .obj
     469.SUFFIXES: .c .cpp .lo .o .obj
    450470$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
    451471        @for dep in $?; do \
     
    505525          rm -f $$p $$f ; \
    506526        done
     527CInterfaceTest$(EXEEXT): $(CInterfaceTest_OBJECTS) $(CInterfaceTest_DEPENDENCIES)
     528        @rm -f CInterfaceTest$(EXEEXT)
     529        $(LINK) $(CInterfaceTest_LDFLAGS) $(CInterfaceTest_OBJECTS) $(CInterfaceTest_LDADD) $(LIBS)
    507530gamsTest$(EXEEXT): $(gamsTest_OBJECTS) $(gamsTest_DEPENDENCIES)
    508531        @rm -f gamsTest$(EXEEXT)
     
    518541        -rm -f *.tab.c
    519542
     543@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CInterfaceTest.Po@am__quote@
    520544@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiCbcSolverInterfaceTest.Po@am__quote@
    521545@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gamsTest.Po@am__quote@
    522546@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/osiUnitTest.Po@am__quote@
     547
     548.c.o:
     549@am__fastdepCC_TRUE@    if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
     550@am__fastdepCC_TRUE@    then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
     551@AMDEP_TRUE@@am__fastdepCC_FALSE@       source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
     552@AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     553@am__fastdepCC_FALSE@   $(COMPILE) -c $<
     554
     555.c.obj:
     556@am__fastdepCC_TRUE@    if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
     557@am__fastdepCC_TRUE@    then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
     558@AMDEP_TRUE@@am__fastdepCC_FALSE@       source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
     559@AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     560@am__fastdepCC_FALSE@   $(COMPILE) -c `$(CYGPATH_W) '$<'`
     561
     562.c.lo:
     563@am__fastdepCC_TRUE@    if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
     564@am__fastdepCC_TRUE@    then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
     565@AMDEP_TRUE@@am__fastdepCC_FALSE@       source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
     566@AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     567@am__fastdepCC_FALSE@   $(LTCOMPILE) -c -o $@ $<
    523568
    524569.cpp.o:
     
    742787ositests: osiUnitTest$(EXEEXT)
    743788        ./osiUnitTest$(EXEEXT) $(ositestsflags)
     789
     790ctests: CInterfaceTest$(EXEEXT)
     791        ./CInterfaceTest$(EXEEXT)
    744792# Tell versions [3.59,3.63) of GNU make to not export all variables.
    745793# Otherwise a system limit (for SysV at least) may be exceeded.
Note: See TracChangeset for help on using the changeset viewer.