Skip to content

Commit

Permalink
Prune include directives so each file is included once
Browse files Browse the repository at this point in the history
Files are no longer independent. Only include the top-level IgorUnit.ipf.
Igor appears to deal very poorly with a dependency graph of any
complexity/size, and was loading IgorUnit very slowly. Igor on Mac actually
crashes out of memory while trying to load IgorUnit. This was true despite the
fact that no dependency cycles exis.

Until now, the policy had been to include every file required in each
individual module. The benefit of such a policy, of course, is that files can
be individually loaded because they carry their dependencies along.

Now, the policy is that each file is included only once, which speeds loading
considerably. This results in three subgraphs:

  * igorutils modules (included in IgorUnit.ipf only)
  * assert modules (included in assert.ipf)
  * test suite modules (all accessible by TestSuiteRunner.ipf)
  • Loading branch information
yamad committed May 31, 2012
1 parent 9186d7f commit a9d47ae
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 27 deletions.
2 changes: 0 additions & 2 deletions Assertion.ipf
Expand Up @@ -6,8 +6,6 @@
#ifndef IGORUNIT_ASSERTION
#define IGORUNIT_ASSERTION

#include "stackinfoutils"

// Assertion Status/Result Codes
Constant ASSERTION_UNKNOWN = 0
Constant ASSERTION_SUCCESS = 1
Expand Down
10 changes: 7 additions & 3 deletions IgorUnit.ipf
Expand Up @@ -5,13 +5,17 @@
#ifndef IGORUNIT_INCLUDE
#define IGORUNIT_INCLUDE

#include "booleanutils"
#include "numutils"
#include "waveutils"
#include "listutils"
#include "funcutils"
#include "stringutils"
#include "datafolderutils"
#include "stackinfoutils"

#include "assert"
#include "UnitTest"
#include "TestSuiteRunner"
#include "TestSuite"
#include "TestResult"

Strconstant IGORUNIT_DF = "root:Packages:IgorUnit" // Path to package data folder

Expand Down
2 changes: 0 additions & 2 deletions OutputFormat_Basic.ipf
@@ -1,8 +1,6 @@
#ifndef IGORUNIT_OUTPUTFORMAT_BASIC
#define IGORUNIT_OUTPUTFORMAT_BASIC

#include "stringutils"

Function OFBasic_init(of)
STRUCT OutputFormat &of
of.name = "Basic"
Expand Down
2 changes: 0 additions & 2 deletions TestListener.ipf
Expand Up @@ -6,8 +6,6 @@
#ifndef IGORUNIT_TESTLISTENER
#define IGORUNIT_TESTLISTENER

#include "funcutils"

Constant LISTENERTYPE_DEFAULT = 0
Constant LISTENERTYPE_PRINTER = 1

Expand Down
2 changes: 0 additions & 2 deletions TestOutcome.ipf
Expand Up @@ -6,8 +6,6 @@
#ifndef IGORUNIT_TESTOUTCOME
#define IGORUNIT_TESTOUTCOME

#include "UnitTest"

Structure TestOutcome
STRUCT UnitTest test
Variable duration
Expand Down
4 changes: 0 additions & 4 deletions TestResult.ipf
Expand Up @@ -6,10 +6,6 @@
#ifndef IGORUNIT_TESTRESULT
#define IGORUNIT_TESTRESULT

#include "waveutils"
#include "stackinfoutils"

#include "UnitTest"
#include "TestOutcome"
#include "TestListener_TestPrinter"

Expand Down
6 changes: 0 additions & 6 deletions TestSuite.ipf
Expand Up @@ -6,12 +6,6 @@
#ifndef IGORUNIT_TS
#define IGORUNIT_TS

#include "booleanutils"
#include "stringutils"
#include "listutils"
#include "waveutils"
#include "datafolderutils"

#include "UnitTest"

Structure TestSuite
Expand Down
3 changes: 0 additions & 3 deletions TestSuiteRunner.ipf
Expand Up @@ -6,9 +6,6 @@
#ifndef IGORUNIT_TSR
#define IGORUNIT_TSR

#include "booleanutils"
#include "datafolderutils"

#include "TestSuite"
#include "TestResult"

Expand Down
3 changes: 0 additions & 3 deletions assert.ipf
Expand Up @@ -3,9 +3,6 @@
#ifndef IGORUNIT_ASSERT
#define IGORUNIT_ASSERT

#include "stringutils"
#include "numutils"

#include "Assertion"

Constant TEST_UNKNOWN = 0
Expand Down

0 comments on commit a9d47ae

Please sign in to comment.