Skip to content

Commit 487192e

Browse files
committed
Tests: Unify run/RunWithOpts functions
We now only have one run and RunWithOpts function. We gather the list of test suites via GetDefaultTestSuitesForExperiment.
1 parent 4749d37 commit 487192e

File tree

6 files changed

+209
-507
lines changed

6 files changed

+209
-507
lines changed

Packages/tests/Basic/UTF_Basic.ipf

Lines changed: 0 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -5,137 +5,6 @@
55

66
#include "UTF_Basic_includes"
77

8-
// Entry point for UTF
9-
Function run()
10-
11-
return RunWithOpts(instru = DoInstrumentation())
12-
End
13-
14-
// Examples:
15-
// - RunWithOpts()
16-
// - RunWithOpts(testsuite = "UTF_Configuration.ipf")
17-
// - RunWithOpts(testcase = "TestFindLevel")
18-
Function RunWithOpts([string testcase, string testsuite, variable allowdebug, variable instru, string traceWinList, variable keepDataFolder, variable enableJU, variable enableRegExp])
19-
20-
variable debugMode
21-
string traceOptions
22-
string list = ""
23-
string name = GetTestName()
24-
variable waveTrackingMode = GetWaveTrackingMode()
25-
26-
// speeds up testing to start with a fresh copy
27-
KillWindow/Z HistoryCarbonCopy
28-
29-
if(ParamIsDefault(allowdebug))
30-
debugMode = 0
31-
else
32-
debugMode = IUTF_DEBUG_FAILED_ASSERTION | IUTF_DEBUG_ENABLE | IUTF_DEBUG_ON_ERROR | IUTF_DEBUG_NVAR_SVAR_WAVE
33-
endif
34-
35-
if(ParamIsDefault(testcase))
36-
testcase = ""
37-
endif
38-
39-
if(ParamIsDefault(instru))
40-
instru = 0
41-
else
42-
instru = !!instru
43-
endif
44-
45-
if(ParamIsDefault(enableJU))
46-
enableJU = IsRunningInCI()
47-
else
48-
enableJU = !!enableJU
49-
endif
50-
51-
if(ParamIsDefault(traceWinList))
52-
traceWinList = "MIES_.*\.ipf"
53-
endif
54-
55-
if(ParamIsDefault(keepDataFolder))
56-
keepDataFolder = 0
57-
else
58-
keepDataFolder = !!keepDataFolder
59-
endif
60-
61-
if(ParamIsDefault(enableRegExp))
62-
enableRegExp = 0
63-
else
64-
enableRegExp = !!enableRegExp
65-
endif
66-
67-
if(!instru)
68-
traceWinList = ""
69-
endif
70-
71-
traceOptions = GetDefaultTraceOptions()
72-
73-
// sorted list
74-
list = AddListItem("UTF_Amplifier.ipf", list, ";", Inf)
75-
list = AddListItem("UTF_AnalysisBrowserTest.ipf", list, ";", Inf)
76-
list = AddListItem("UTF_AnalysisFunctionHelpers.ipf", list, ";", Inf)
77-
list = AddListItem("UTF_AnalysisFunctionParameters.ipf", list, ";", Inf)
78-
list = AddListItem("UTF_AnalysisFunctionPrototypes.ipf", list, ";", Inf)
79-
list = AddListItem("UTF_AsynFrameworkTest.ipf", list, ";", Inf)
80-
list = AddListItem("UTF_Debugging.ipf", list, ";", Inf)
81-
list = AddListItem("UTF_Configuration.ipf", list, ";", Inf)
82-
list = AddListItem("UTF_DAEphyswoHardware.ipf", list, ";", Inf)
83-
list = AddListItem("UTF_EpochswoHardware.ipf", list, ";", Inf)
84-
list = AddListItem("UTF_ForeignFunctionInterface.ipf", list, ";", Inf)
85-
list = AddListItem("UTF_GuiUtilities.ipf", list, ";", Inf)
86-
list = AddListItem("UTF_JSONWaveNotes.ipf", list, ";", Inf)
87-
list = AddListItem("UTF_Labnotebook.ipf", list, ";", Inf)
88-
list = AddListItem("UTF_Macros.ipf", list, ";", Inf)
89-
list = AddListItem("UTF_oodDAQ.ipf", list, ";", Inf)
90-
list = AddListItem("UTF_PGCSetAndActivateControl.ipf", list, ";", Inf)
91-
list = AddListItem("UTF_StimsetAPI.ipf", list, ";", Inf)
92-
list = AddListItem("UTF_SweepFormula.ipf", list, ";", Inf)
93-
list = AddListItem("UTF_SweepFormula_Operations.ipf", list, ";", Inf)
94-
list = AddListItem("UTF_SweepFormula_PSX.ipf", list, ";", Inf)
95-
list = AddListItem("UTF_Testpulse.ipf", list, ";", Inf)
96-
list = AddListItem("UTF_TraceUserData.ipf", list, ";", Inf)
97-
list = AddListItem("UTF_ThreadsafeDataSharing.ipf", list, ";", Inf)
98-
list = AddListItem("UTF_UpgradeDataFolderLocation.ipf", list, ";", Inf)
99-
list = AddListItem("UTF_UpgradeWaveLocationAndGetIt.ipf", list, ";", Inf)
100-
list = AddListItem("UTF_Utils_Algorithm.ipf", list, ";", Inf)
101-
list = AddListItem("UTF_Utils_Checks.ipf", list, ";", Inf)
102-
list = AddListItem("UTF_Utils_Conversions.ipf", list, ";", Inf)
103-
list = AddListItem("UTF_Utils_DataFolder.ipf", list, ";", Inf)
104-
list = AddListItem("UTF_Utils_File.ipf", list, ";", Inf)
105-
list = AddListItem("UTF_Utils_GUI.ipf", list, ";", Inf)
106-
list = AddListItem("UTF_Utils_List.ipf", list, ";", Inf)
107-
list = AddListItem("UTF_Utils_Mies_Algorithm.ipf", list, ";", Inf)
108-
list = AddListItem("UTF_Utils_Mies_BackupWaves.ipf", list, ";", Inf)
109-
list = AddListItem("UTF_Utils_Mies_Config.ipf", list, ";", Inf)
110-
list = AddListItem("UTF_Utils_Mies_Logging.ipf", list, ";", Inf)
111-
list = AddListItem("UTF_Utils_Mies_Sweep.ipf", list, ";", Inf)
112-
list = AddListItem("UTF_Utils_Numeric.ipf", list, ";", Inf)
113-
list = AddListItem("UTF_Utils_ProgramFlow.ipf", list, ";", Inf)
114-
list = AddListItem("UTF_Utils_Strings.ipf", list, ";", Inf)
115-
list = AddListItem("UTF_Utils_Settings.ipf", list, ";", Inf)
116-
list = AddListItem("UTF_Utils_System.ipf", list, ";", Inf)
117-
list = AddListItem("UTF_Utils_Time.ipf", list, ";", Inf)
118-
list = AddListItem("UTF_Utils_WaveHandling.ipf", list, ";", Inf)
119-
list = AddListItem("UTF_UtilsChecks.ipf", list, ";", Inf)
120-
list = AddListItem("UTF_WaveAveraging.ipf", list, ";", Inf)
121-
list = AddListItem("UTF_WaveBuilder.ipf", list, ";", Inf)
122-
list = AddListItem("UTF_WaveBuilderRegression.ipf", list, ";", Inf)
123-
list = AddListItem("UTF_WaveVersioning.ipf", list, ";", Inf)
124-
list = AddListItem("UTF_ZeroMQPublishing.ipf", list, ";", Inf)
125-
126-
if(ParamIsDefault(testsuite))
127-
testsuite = list
128-
else
129-
// do nothing
130-
endif
131-
132-
if(IsEmpty(testcase))
133-
RunTest(testsuite, name = name, enableJU = enableJU, enableRegExp = enableRegExp, debugMode = debugMode, traceOptions = traceOptions, traceWinList = traceWinList, keepDataFolder = keepDataFolder, waveTrackingMode = waveTrackingMode)
134-
else
135-
RunTest(testsuite, name = name, enableJU = enableJU, enableRegExp = enableRegExp, debugMode = debugMode, testcase = testcase, traceOptions = traceOptions, traceWinList = traceWinList, keepDataFolder = keepDataFolder, waveTrackingMode = waveTrackingMode)
136-
endif
137-
End
138-
1398
Function TEST_BEGIN_OVERRIDE(string name)
1409

14110
TestBeginCommon()

Packages/tests/HardwareAnalysisFunctions/UTF_HardwareAnalysisFunctions.ipf

Lines changed: 0 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -5,110 +5,6 @@
55

66
#include "UTF_HardwareAnalysisFunctions_Includes"
77

8-
// Entry point for UTF
9-
Function run()
10-
11-
return RunWithOpts(instru = DoInstrumentation())
12-
End
13-
14-
// Examples:
15-
// - RunWithOpts()
16-
// - RunWithOpts(testsuite = "UTF_Epochs.ipf")
17-
// - RunWithOpts(testcase = "EP_EpochTest7")
18-
// - RunWithOpts(testcase = "EP_EpochTest7", instru = 1, traceWinList = "MIES_Epochs.ipf")
19-
Function RunWithOpts([string testcase, string testsuite, variable allowdebug, variable instru, string traceWinList, variable ITCXOP2Debug, variable keepDataFolder, variable enableJU, variable enableRegExp])
20-
21-
variable debugMode
22-
string traceOptions
23-
string list = ""
24-
string name = GetTestName()
25-
variable waveTrackingMode = GetWaveTrackingMode()
26-
27-
// speeds up testing to start with a fresh copy
28-
KillWindow/Z HistoryCarbonCopy
29-
30-
if(ParamIsDefault(allowdebug))
31-
debugMode = 0
32-
else
33-
debugMode = IUTF_DEBUG_FAILED_ASSERTION | IUTF_DEBUG_ENABLE | IUTF_DEBUG_ON_ERROR | IUTF_DEBUG_NVAR_SVAR_WAVE
34-
endif
35-
36-
if(ParamIsDefault(testcase))
37-
testcase = ""
38-
endif
39-
40-
if(ParamIsDefault(instru))
41-
instru = 0
42-
else
43-
instru = !!instru
44-
endif
45-
46-
if(ParamIsDefault(traceWinList))
47-
traceWinList = "MIES_.*\.ipf"
48-
endif
49-
50-
if(ParamIsDefault(ITCXOP2Debug))
51-
ITCXOP2Debug = 0
52-
else
53-
ITCXOP2Debug = !!ITCXOP2Debug
54-
endif
55-
56-
if(ParamIsDefault(keepDataFolder))
57-
keepDataFolder = 0
58-
else
59-
keepDataFolder = !!keepDataFolder
60-
endif
61-
62-
if(ParamIsDefault(enableRegExp))
63-
enableRegExp = 0
64-
else
65-
enableRegExp = !!enableRegExp
66-
endif
67-
68-
if(ParamIsDefault(enableJU))
69-
enableJU = IsRunningInCI()
70-
else
71-
enableJU = !!enableJU
72-
endif
73-
74-
if(!instru)
75-
traceWinList = ""
76-
endif
77-
78-
HW_ITC_DebugMode(ITCXOP2Debug)
79-
80-
traceOptions = GetDefaultTraceOptions()
81-
82-
list = AddListItem("UTF_SetControls.ipf", list, ";", Inf)
83-
list = AddListItem("UTF_PatchSeqAccessResistanceSmoke.ipf", list, ";", Inf)
84-
list = AddListItem("UTF_PatchSeqChirp.ipf", list, ";", Inf)
85-
list = AddListItem("UTF_PatchSeqDAScale_Adapt.ipf", list, ";", Inf)
86-
list = AddListItem("UTF_PatchSeqDAScale_Sub.ipf", list, ";", Inf)
87-
list = AddListItem("UTF_PatchSeqDAScale_Supra.ipf", list, ";", Inf)
88-
list = AddListItem("UTF_PatchSeqSealEvaluation.ipf", list, ";", Inf)
89-
list = AddListItem("UTF_PatchSeqSquarePulse.ipf", list, ";", Inf)
90-
list = AddListItem("UTF_PatchSeqRheobase.ipf", list, ";", Inf)
91-
list = AddListItem("UTF_PatchSeqRamp.ipf", list, ";", Inf)
92-
list = AddListItem("UTF_PatchSeqPipetteInBath.ipf", list, ";", Inf)
93-
list = AddListItem("UTF_PatchSeqTrueRestingMembranePotential.ipf", list, ";", Inf)
94-
list = AddListItem("UTF_ReachTargetVoltage.ipf", list, ";", Inf)
95-
list = AddListItem("UTF_MultiPatchSeqFastRheoEstimate.ipf", list, ";", Inf)
96-
list = AddListItem("UTF_MultiPatchSeqDAScale.ipf", list, ";", Inf)
97-
list = AddListItem("UTF_MultiPatchSeqSpikeControl.ipf", list, ";", Inf)
98-
99-
if(ParamIsDefault(testsuite))
100-
testsuite = list
101-
else
102-
// do nothing
103-
endif
104-
105-
if(IsEmpty(testcase))
106-
RunTest(testsuite, name = name, enableRegExp = enableRegExp, enableJU = enableJU, debugMode = debugMode, traceOptions = traceOptions, traceWinList = traceWinList, keepDataFolder = keepDataFolder, waveTrackingMode = waveTrackingMode)
107-
else
108-
RunTest(testsuite, name = name, enableRegExp = enableRegExp, enableJU = enableJU, debugMode = debugMode, testcase = testcase, traceOptions = traceOptions, traceWinList = traceWinList, keepDataFolder = keepDataFolder, waveTrackingMode = waveTrackingMode)
109-
endif
110-
End
111-
1128
Function TEST_BEGIN_OVERRIDE(string name)
1139

11410
HardwareTestBeginCommon(name)

Packages/tests/HardwareBasic/UTF_HardwareBasic.ipf

Lines changed: 0 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -5,111 +5,6 @@
55

66
#include "UTF_HardwareBasic_Includes"
77

8-
// Entry point for UTF
9-
Function run()
10-
11-
return RunWithOpts(instru = DoInstrumentation())
12-
End
13-
14-
// Examples:
15-
// - RunWithOpts()
16-
// - RunWithOpts(testsuite = "UTF_Epochs.ipf")
17-
// - RunWithOpts(testcase = "EP_EpochTest7")
18-
// - RunWithOpts(testcase = "EP_EpochTest7", instru = 1, traceWinList = "MIES_Epochs.ipf")
19-
Function RunWithOpts([string testcase, string testsuite, variable allowdebug, variable instru, string traceWinList, variable ITCXOP2Debug, variable keepDataFolder, variable enableJU, variable enableRegExp])
20-
21-
variable debugMode
22-
string traceOptions
23-
string list = ""
24-
string name = GetTestName()
25-
variable waveTrackingMode = GetWaveTrackingMode()
26-
27-
// speeds up testing to start with a fresh copy
28-
KillWindow/Z HistoryCarbonCopy
29-
30-
if(ParamIsDefault(allowdebug))
31-
debugMode = 0
32-
else
33-
debugMode = IUTF_DEBUG_FAILED_ASSERTION | IUTF_DEBUG_ENABLE | IUTF_DEBUG_ON_ERROR | IUTF_DEBUG_NVAR_SVAR_WAVE
34-
endif
35-
36-
if(ParamIsDefault(testcase))
37-
testcase = ""
38-
endif
39-
40-
if(ParamIsDefault(instru))
41-
instru = 0
42-
else
43-
instru = !!instru
44-
endif
45-
46-
if(ParamIsDefault(keepDataFolder))
47-
keepDataFolder = 0
48-
else
49-
keepDataFolder = !!keepDataFolder
50-
endif
51-
52-
if(ParamIsDefault(traceWinList))
53-
traceWinList = "MIES_.*\.ipf"
54-
endif
55-
56-
if(ParamIsDefault(ITCXOP2Debug))
57-
ITCXOP2Debug = 0
58-
else
59-
ITCXOP2Debug = !!ITCXOP2Debug
60-
endif
61-
62-
if(ParamIsDefault(enableJU))
63-
enableJU = IsRunningInCI()
64-
else
65-
enableJU = !!enableJU
66-
endif
67-
68-
if(ParamIsDefault(enableRegExp))
69-
enableRegExp = 0
70-
else
71-
enableRegExp = !!enableRegExp
72-
endif
73-
74-
if(!instru)
75-
traceWinList = ""
76-
endif
77-
78-
HW_ITC_DebugMode(ITCXOP2Debug)
79-
80-
traceOptions = GetDefaultTraceOptions()
81-
82-
list = AddListItem("UTF_VeryBasicHardwareTests.ipf", list, ";", Inf)
83-
list = AddListItem("UTF_TrackSweepCounts.ipf", list, ";", Inf)
84-
list = AddListItem("UTF_BasicHardwareTests.ipf", list, ";", Inf)
85-
list = AddListItem("UTF_ConfigurationHardware.ipf", list, ";", Inf)
86-
list = AddListItem("UTF_SweepSkipping.ipf", list, ";", Inf)
87-
list = AddListItem("UTF_TestPulseAndTPDuringDAQ.ipf", list, ";", Inf)
88-
list = AddListItem("UTF_DAEphys.ipf", list, ";", Inf)
89-
list = AddListItem("UTF_Dashboard.ipf", list, ";", Inf)
90-
list = AddListItem("UTF_Databrowser.ipf", list, ";", Inf)
91-
list = AddListItem("UTF_Epochs.ipf", list, ";", Inf)
92-
list = AddListItem("UTF_SweepFormulaHardware.ipf", list, ";", Inf)
93-
list = AddListItem("UTF_AnalysisFunctionManagement.ipf", list, ";", Inf)
94-
list = AddListItem("UTF_AutoTestpulse.ipf", list, ";", Inf)
95-
list = AddListItem("UTF_VeryLastTestSuite.ipf", list, ";", Inf)
96-
97-
// tests which BUG out must come after the test-all tests in UTF_VeryLastTestSuite.ipf
98-
list = AddListItem("UTF_HardwareTestsWithBUG.ipf", list, ";", Inf)
99-
100-
if(ParamIsDefault(testsuite))
101-
testsuite = list
102-
else
103-
// do nothing
104-
endif
105-
106-
if(IsEmpty(testcase))
107-
RunTest(testsuite, name = name, enableJU = enableJU, enableRegExp = enableRegExp, debugMode = debugMode, traceOptions = traceOptions, traceWinList = traceWinList, keepDataFolder = keepDataFolder, waveTrackingMode = waveTrackingMode)
108-
else
109-
RunTest(testsuite, name = name, enableJU = enableJU, enableRegExp = enableRegExp, debugMode = debugMode, testcase = testcase, traceOptions = traceOptions, traceWinList = traceWinList, keepDataFolder = keepDataFolder, waveTrackingMode = waveTrackingMode)
110-
endif
111-
End
112-
1138
Function TEST_BEGIN_OVERRIDE(string name)
1149

11510
HardwareTestBeginCommon(name)

0 commit comments

Comments
 (0)