Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/windows-msvs-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
git
zip
path-type: inherit
msystem: mingw64
msystem: ucrt64
- name: Fetch project
run: |
ADD_ARGS=()
Expand Down
16 changes: 16 additions & 0 deletions MSVisualStudio/v17/Cbc.sln
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
..\..\.github\workflows\linux-ci.yml = ..\..\.github\workflows\linux-ci.yml
..\..\.github\workflows\release.yml = ..\..\.github\workflows\release.yml
..\..\.github\workflows\windows-ci.yml = ..\..\.github\workflows\windows-ci.yml
..\..\.github\workflows\windows-msvs-ci.yml = ..\..\.github\workflows\windows-msvs-ci.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{8611E933-9020-4D93-A72B-984AAB27425C}"
ProjectSection(SolutionItems) = preProject
CbcTest.cmd = CbcTest.cmd
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CbcMakeTest", "CbcMakeTest\CbcMakeTest.vcxproj", "{FB60CCAF-A0F0-4557-9586-58524835E2BF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand Down Expand Up @@ -199,6 +202,18 @@ Global
{22911998-FEDD-44AC-902F-CFEFA060C36A}.ReleaseParallel|x64.Build.0 = Release|x64
{22911998-FEDD-44AC-902F-CFEFA060C36A}.ReleaseParallel|x86.ActiveCfg = Release|Win32
{22911998-FEDD-44AC-902F-CFEFA060C36A}.ReleaseParallel|x86.Build.0 = Release|Win32
{FB60CCAF-A0F0-4557-9586-58524835E2BF}.Debug|x64.ActiveCfg = Debug|x64
{FB60CCAF-A0F0-4557-9586-58524835E2BF}.Debug|x64.Build.0 = Debug|x64
{FB60CCAF-A0F0-4557-9586-58524835E2BF}.Debug|x86.ActiveCfg = Debug|Win32
{FB60CCAF-A0F0-4557-9586-58524835E2BF}.Debug|x86.Build.0 = Debug|Win32
{FB60CCAF-A0F0-4557-9586-58524835E2BF}.Release|x64.ActiveCfg = Release|x64
{FB60CCAF-A0F0-4557-9586-58524835E2BF}.Release|x64.Build.0 = Release|x64
{FB60CCAF-A0F0-4557-9586-58524835E2BF}.Release|x86.ActiveCfg = Release|Win32
{FB60CCAF-A0F0-4557-9586-58524835E2BF}.Release|x86.Build.0 = Release|Win32
{FB60CCAF-A0F0-4557-9586-58524835E2BF}.ReleaseParallel|x64.ActiveCfg = ReleaseParallel|x64
{FB60CCAF-A0F0-4557-9586-58524835E2BF}.ReleaseParallel|x64.Build.0 = ReleaseParallel|x64
{FB60CCAF-A0F0-4557-9586-58524835E2BF}.ReleaseParallel|x86.ActiveCfg = ReleaseParallel|Win32
{FB60CCAF-A0F0-4557-9586-58524835E2BF}.ReleaseParallel|x86.Build.0 = ReleaseParallel|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -207,6 +222,7 @@ Global
{EAF01AC1-8D19-4E37-9852-736DCFF67865} = {8611E933-9020-4D93-A72B-984AAB27425C}
{02DAC099-45E6-4442-BA79-684D98557861} = {FAA08B0C-E9D4-4A64-AB36-B18DB3112D87}
{8611E933-9020-4D93-A72B-984AAB27425C} = {FAA08B0C-E9D4-4A64-AB36-B18DB3112D87}
{FB60CCAF-A0F0-4557-9586-58524835E2BF} = {8611E933-9020-4D93-A72B-984AAB27425C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {58BF7BE6-13A3-455C-B63E-2799224131D5}
Expand Down
122 changes: 122 additions & 0 deletions MSVisualStudio/v17/CbcMakeTest/CbcMakeTest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
// This code is licensed under the terms of the Eclipse Public License (EPL).

/*! \file CbcMakeTest.cpp
\brief Main routine for running quick tests that need no tools beyond the build environment, similar to 'make test'.
*/

// The cbc 'make test' builds multiple executables and runs them.
// For MSVS builds, the CbcMakeTest project is a single executable that calls each of the unit tests in turn.
// This file is the main routine for that executable.
// As in cbc make QUICK_TESTS, the following tests are run in order,
// and the first failure aborts the test suite with a non-zero exit code:
//
// lazy-constraint-test
// mipstart-test
// coefstr-test
// row-activity-test

#pragma once

#include "..\src\CbcConfig.h"

#include <cstdio>

#include "CoinError.hpp"

// The following #defines rename the global variables and functions in each test file
// so that they do not conflict with each other when linked into a single executable.

#define g_failures g_failureslazy_constraint_test
#define check checklazy_constraint_test
#define checkClose checkCloselazy_constraint_test
#define checkEqInt checkEqIntlazy_constraint_test
#define main mainlazy_constraint_test
#include "..\test\lazy-constraint-test.cpp"

#define g_failures g_failuresmipstart_test
#define check checkmipstart_test
#define checkClose checkClosemipstart_test
#define checkEqInt checkEqIntmipstart_test
#define main mainmipstart_test
#include "..\test\mipstart-test.cpp"

#define g_failures g_failurescoefstr_test
#define check checkcoefstr_test
#define checkClose checkClosecoefstr_test
#define checkEqInt checkEqIntcoefstr_test
#define main maincoefstr_test
#include "..\test\coefstr-test.cpp"

#define g_failures g_failuresrow_activity_test
#define check checkrow_activity_test
#define checkClose checkCloserow_activity_test
#define checkEqInt checkEqIntrow_activity_testt
#define main mainrow_activity_test
#include "..\test\row-activity-test.cpp"


#undef g_failures
#undef check
#undef checkClose
#undef checkEqInt
#undef main

// Run the 'test' suite in order, aborting on the first failure.
int test(int argc, char **argv)
{
int returnCode = 0;

//"Exit code: 0 = all checks passed, 1 = one or more failed.\n");
printf("Running lazy-contraint-test");
returnCode = ::mainlazy_constraint_test(argc, argv);
if (returnCode != 0)
return returnCode;

printf("Running mipstart-test");
returnCode = ::mainmipstart_test(argc, argv);
if (returnCode != 0)
return returnCode;

printf("Running coefstr-test");
returnCode = ::maincoefstr_test(argc, argv);
if (returnCode != 0)
return returnCode;

printf("Running row-activity-test");
returnCode = ::mainrow_activity_test(argc, argv);
if (returnCode != 0)
return returnCode;

return returnCode;
}

int main(int argc, char **argv)
{
// With MSVC, make a crash or failed assertion end the program instead of
// opening a dialog that waits for a click (and hangs scripts and CI).
WindowsErrorPopupBlocker();

for (int i = 1; i < argc; ++i) {
std::string arg(argv[i]);
if (arg == "--help" || arg == "-h") {
printf(
"CbcMakeTest - Runs tests for Cbc aligned to 'make test'.\n"
"\n"
"Usage: CbcMakeTest [--help]\n"
"\n"
"Runs the 'test' suite of tests.\n"
"The 'sanity-test' suite is not supported.\n"
"\n"
"Exit code: 0 = all checks passed, 1 = one or more checks failed.\n");
return 0;
}
fprintf(stderr, "CbcMakeTest: unrecognized argument '%s' "
"(try --help)\n",
arg.c_str());
return 1;
}

return test(argc, argv);
}


Loading
Loading