Skip to content

Commit 6fa8be9

Browse files
committed
[CORE] Various fixes/improvements for unit test
1 parent 7530dfd commit 6fa8be9

25 files changed

+87
-144
lines changed
Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
<environment>
2-
<use name="cppunit"/>
3-
</environment>
4-
<bin name="testDataFormatsFWLiteMakeInput" file="TestRunnerDataFormatsFWLite.cpp">
5-
<flags TEST_RUNNER_ARGS=" /bin/bash DataFormats/FWLite/test RefTest.sh"/>
6-
<use name="FWCore/Utilities"/>
7-
</bin>
1+
<use name="cppunit"/>
2+
<test name="testDataFormatsFWLiteMakeInput" command="RefTest.sh"/>
83

94
<bin name="testDataFormatsFWLite" file="test.cppunit.cpp,format_type_name.cppunit.cpp">
105
<flags PRE_TEST="testDataFormatsFWLiteMakeInput"/>
@@ -13,8 +8,6 @@
138
<use name="DataFormats/TestObjects"/>
149
</bin>
1510

16-
<bin file="TestRunnerDataFormatsFWLite.cpp">
11+
<test name="TestRunnerDataFormatsFWLite" command="run_all_t.sh">
1712
<flags PRE_TEST="testDataFormatsFWLite"/>
18-
<flags TEST_RUNNER_ARGS=" /bin/bash DataFormats/FWLite/test run_all_t.sh"/>
19-
<use name="FWCore/Utilities"/>
20-
</bin>
13+
</test>
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
2-
rm -f ${LOCAL_TEST_DIR}/prod1.root ${LOCAL_TEST_DIR}/prod2.root ${LOCAL_TEST_DIR}/prodmerge.root
2+
rm -f ${SCRAM_TEST_PATH}/prod1.root ${SCRAM_TEST_PATH}/prod2.root ${SCRAM_TEST_PATH}/prodmerge.root
33
rm -f prod1.root prod2.root prodmerge.root
4-
cmsRun ${LOCAL_TEST_DIR}/ProdTest1_cfg.py
5-
cmsRun ${LOCAL_TEST_DIR}/ProdTest2_cfg.py
6-
cmsRun ${LOCAL_TEST_DIR}/ProdTestMerge_cfg.py
4+
cmsRun ${SCRAM_TEST_PATH}/ProdTest1_cfg.py
5+
cmsRun ${SCRAM_TEST_PATH}/ProdTest2_cfg.py
6+
cmsRun ${SCRAM_TEST_PATH}/ProdTestMerge_cfg.py

DataFormats/FWLite/test/RefTest.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ rm -f other_onlyDataFormatsFWLite.root good_delta5DataFormatsFWLite.root
99
rm -f partialEventDataFormatsFWLite.root refTestCopyDropDataFormatsFWLite.root
1010

1111
echo RefTest_cfg.py
12-
cmsRun ${LOCAL_TEST_DIR}/RefTest_cfg.py || die "cmsRun RefTest_cfg.py" $?
12+
cmsRun ${SCRAM_TEST_PATH}/RefTest_cfg.py || die "cmsRun RefTest_cfg.py" $?
1313
echo RefTest2_cfg.py
14-
cmsRun ${LOCAL_TEST_DIR}/RefTest2_cfg.py || die "cmsRun RefTest2_cfg.py" $?
14+
cmsRun ${SCRAM_TEST_PATH}/RefTest2_cfg.py || die "cmsRun RefTest2_cfg.py" $?
1515
echo EmptyFile_cfg.py
16-
cmsRun ${LOCAL_TEST_DIR}/EmptyFile_cfg.py || die "cmsRun EmptyFile_cfg.py" $?
16+
cmsRun ${SCRAM_TEST_PATH}/EmptyFile_cfg.py || die "cmsRun EmptyFile_cfg.py" $?
1717
echo PartialEventTest_cfg.py
18-
cmsRun ${LOCAL_TEST_DIR}/PartialEventTest_cfg.py || die "cmsRun PartialEventTest_cfg.py" $?
18+
cmsRun ${SCRAM_TEST_PATH}/PartialEventTest_cfg.py || die "cmsRun PartialEventTest_cfg.py" $?
1919
echo RefTestCopyDrop_cfg.py
20-
cmsRun ${LOCAL_TEST_DIR}/RefTestCopyDrop_cfg.py || die "cmsRun RefTestCopyDrop_cfg.py" $?
20+
cmsRun ${SCRAM_TEST_PATH}/RefTestCopyDrop_cfg.py || die "cmsRun RefTestCopyDrop_cfg.py" $?
2121

2222
exit 0
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
2-
rm -f ${LOCAL_TEST_DIR}/good_a.root ${LOCAL_TEST_DIR}/good_b.root ${LOCAL_TEST_DIR}/empty_a.root
2+
rm -f ${SCRAM_TEST_PATH}/good_a.root ${SCRAM_TEST_PATH}/good_b.root ${SCRAM_TEST_PATH}/empty_a.root
33
rm -f good_a.root good_b.root empty_a.root
4-
cmsRun ${LOCAL_TEST_DIR}/RefTest_a_cfg.py
5-
cmsRun ${LOCAL_TEST_DIR}/RefTest_b_cfg.py
6-
cmsRun ${LOCAL_TEST_DIR}/EmptyFile_a_cfg.py
4+
cmsRun ${SCRAM_TEST_PATH}/RefTest_a_cfg.py
5+
cmsRun ${SCRAM_TEST_PATH}/RefTest_b_cfg.py
6+
cmsRun ${SCRAM_TEST_PATH}/EmptyFile_a_cfg.py

DataFormats/FWLite/test/TestRunnerDataFormatsFWLite.cpp

Lines changed: 0 additions & 3 deletions
This file was deleted.

DataFormats/FWLite/test/VIPTest.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
2-
rm -f ${LOCAL_TEST_DIR}/vectorinttest.root
2+
rm -f ${SCRAM_TEST_PATH}/vectorinttest.root
33
rm -f vectorinttest.root
4-
cmsRun ${LOCAL_TEST_DIR}/vip_cfg.py
4+
cmsRun ${SCRAM_TEST_PATH}/vip_cfg.py

DataFormats/FWLite/test/run_all_t.sh

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,32 @@
44
# Pass in name and status
55
function die { echo $1: status $2 ; exit $2; }
66

7-
${LOCAL_TEST_DIR}/RefTest_a.sh || die 'Failed to create file' $?
8-
root -b -n -q ${LOCAL_TEST_DIR}/event_looping_cint.C || die 'Failed in event_looping_cint.C' $?
9-
root -b -n -q ${LOCAL_TEST_DIR}/event_looping_consumes_cint.C || die 'Failed in event_looping_cint.C' $?
10-
root -b -n -q ${LOCAL_TEST_DIR}/chainevent_looping_cint.C || die 'Failed in chainevent_looping_cint.C' $?
11-
python3 ${LOCAL_TEST_DIR}/chainEvent_python.py || die 'Failed in chainEvent_python.py' $?
12-
#root -b -n -q ${LOCAL_TEST_DIR}/autoload_with_std.C || die 'Failed in autoload_with_std.C' $?
13-
#root -b -n -q ${LOCAL_TEST_DIR}/autoload_with_missing_std.C || die 'Failed in autoload_with_missing_std.C' $?
7+
${SCRAM_TEST_PATH}/RefTest_a.sh || die 'Failed to create file' $?
8+
root -b -n -q ${SCRAM_TEST_PATH}/event_looping_cint.C || die 'Failed in event_looping_cint.C' $?
9+
root -b -n -q ${SCRAM_TEST_PATH}/event_looping_consumes_cint.C || die 'Failed in event_looping_cint.C' $?
10+
root -b -n -q ${SCRAM_TEST_PATH}/chainevent_looping_cint.C || die 'Failed in chainevent_looping_cint.C' $?
11+
python3 ${SCRAM_TEST_PATH}/chainEvent_python.py || die 'Failed in chainEvent_python.py' $?
12+
#root -b -n -q ${SCRAM_TEST_PATH}/autoload_with_std.C || die 'Failed in autoload_with_std.C' $?
13+
#root -b -n -q ${SCRAM_TEST_PATH}/autoload_with_missing_std.C || die 'Failed in autoload_with_missing_std.C' $?
1414

15-
${LOCAL_TEST_DIR}/MergeTest.sh || die 'Failed to create file' $?
16-
root -b -n -q ${LOCAL_TEST_DIR}/runlumi_looping_cint.C || die 'Failed in runlumi_looping_cint.C' $?
17-
root -b -n -q ${LOCAL_TEST_DIR}/productid_cint.C || die 'Failed in productid_cint.C' $?
18-
root -b -n -q ${LOCAL_TEST_DIR}/triggernames_cint.C || die 'Failed in triggernames_cint.C' $?
19-
root -b -n -q ${LOCAL_TEST_DIR}/triggernames_multi_cint.C || die 'Failed in triggernames_multi_cint.C' $?
20-
root -b -n -q ${LOCAL_TEST_DIR}/triggerResultsByName_cint.C || die 'Failed in triggerResultsByName_cint.C' $?
21-
root -b -n -q ${LOCAL_TEST_DIR}/triggerResultsByName_multi_cint.C || die 'Failed in triggerResultsByName_multi_cint.C' $?
15+
${SCRAM_TEST_PATH}/MergeTest.sh || die 'Failed to create file' $?
16+
root -b -n -q ${SCRAM_TEST_PATH}/runlumi_looping_cint.C || die 'Failed in runlumi_looping_cint.C' $?
17+
root -b -n -q ${SCRAM_TEST_PATH}/productid_cint.C || die 'Failed in productid_cint.C' $?
18+
root -b -n -q ${SCRAM_TEST_PATH}/triggernames_cint.C || die 'Failed in triggernames_cint.C' $?
19+
root -b -n -q ${SCRAM_TEST_PATH}/triggernames_multi_cint.C || die 'Failed in triggernames_multi_cint.C' $?
20+
root -b -n -q ${SCRAM_TEST_PATH}/triggerResultsByName_cint.C || die 'Failed in triggerResultsByName_cint.C' $?
21+
root -b -n -q ${SCRAM_TEST_PATH}/triggerResultsByName_multi_cint.C || die 'Failed in triggerResultsByName_multi_cint.C' $?
2222

23-
${LOCAL_TEST_DIR}/VIPTest.sh || die 'Failed to create file' $?
24-
root -b -n -q ${LOCAL_TEST_DIR}/vector_int_cint.C || die 'Failed in vector_int_cint.C' $?
23+
${SCRAM_TEST_PATH}/VIPTest.sh || die 'Failed to create file' $?
24+
root -b -n -q ${SCRAM_TEST_PATH}/vector_int_cint.C || die 'Failed in vector_int_cint.C' $?
2525

26-
python3 ${LOCAL_TEST_DIR}/pyroot_handle_reuse.py || die 'Failed in pyroot_handle_reuse.py' $?
27-
python3 ${LOCAL_TEST_DIR}/pyroot_multichain.py inputFiles=file:prodmerge.root secondaryInputFiles=file:prod1.root,file:prod2.root || die 'Failed in pyroot_multichain.py (non-empty files)' $?
28-
python3 ${LOCAL_TEST_DIR}/pyroot_multichain.py inputFiles=file:empty_a.root secondaryInputFiles=file:good_a.root || die 'Failed in pyroot_multichain.py (empty file)' $?
26+
python3 ${SCRAM_TEST_PATH}/pyroot_handle_reuse.py || die 'Failed in pyroot_handle_reuse.py' $?
27+
python3 ${SCRAM_TEST_PATH}/pyroot_multichain.py inputFiles=file:prodmerge.root secondaryInputFiles=file:prod1.root,file:prod2.root || die 'Failed in pyroot_multichain.py (non-empty files)' $?
28+
python3 ${SCRAM_TEST_PATH}/pyroot_multichain.py inputFiles=file:empty_a.root secondaryInputFiles=file:good_a.root || die 'Failed in pyroot_multichain.py (empty file)' $?
2929

3030
#NOTE: ROOT has a bug which keeps the AssociationVector from running its ioread rule and therefore it never clears its cache
3131
#test AssociationVector reading
32-
#rm -f ${LOCAL_TEST_DIR}/avtester.root
32+
#rm -f ${SCRAM_TEST_PATH}/avtester.root
3333
#rm -f avtester.root
34-
#cmsRun ${LOCAL_TEST_DIR}/make_associationvector_file_cfg.py || die "cmsRun make_associationvector_file_cfg.py " $?
35-
#python ${LOCAL_TEST_DIR}/pyroot_read_associationvector.py || die 'Failed in pyroot_read_associationvector.py'
34+
#cmsRun ${SCRAM_TEST_PATH}/make_associationvector_file_cfg.py || die "cmsRun make_associationvector_file_cfg.py " $?
35+
#python ${SCRAM_TEST_PATH}/pyroot_read_associationvector.py || die 'Failed in pyroot_read_associationvector.py'

FWCore/FWLite/test/BuildFile.xml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
<environment>
2-
<use name="cppunit"/>
3-
</environment>
1+
<use name="cppunit"/>
42
<bin name="testFWCoreFWLite" file="ref_t.cppunit.cpp">
53
<use name="FWCore/FWLite"/>
64
<use name="DataFormats/TestObjects"/>
75
</bin>
86

9-
<bin file="TestRunnerFWCoreFWLite.cpp">
10-
<flags TEST_RUNNER_ARGS=" /bin/bash FWCore/FWLite/test run_all_t.sh"/>
11-
<use name="FWCore/Utilities"/>
12-
</bin>
7+
<test name="TestRunnerFWCoreFWLite" command="run_all_t.sh"/>

FWCore/FWLite/test/RefTest.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
function die { echo Failure $1: status $2 ; exit $2 ; }
44

5-
rm -f ${LOCAL_TEST_DIR}/good.root
6-
rm -f ${LOCAL_TEST_DIR}/good2.root
7-
rm -f ${LOCAL_TEST_DIR}/good_delta5.root
5+
rm -f ${SCRAM_TEST_PATH}/good.root
6+
rm -f ${SCRAM_TEST_PATH}/good2.root
7+
rm -f ${SCRAM_TEST_PATH}/good_delta5.root
88
rm -f good.root
99
rm -f good2.root
1010
rm -f good_delta5.root
1111

12-
cmsRun ${LOCAL_TEST_DIR}/RefTest_cfg.py || die "cmsRun RefTest_cfg.py" $?
12+
cmsRun ${SCRAM_TEST_PATH}/RefTest_cfg.py || die "cmsRun RefTest_cfg.py" $?
1313

14-
cmsRun ${LOCAL_TEST_DIR}/RefTest2_cfg.py || die "cmsRun RefTest2_cfg.py" $?
14+
cmsRun ${SCRAM_TEST_PATH}/RefTest2_cfg.py || die "cmsRun RefTest2_cfg.py" $?

FWCore/FWLite/test/TestRunnerFWCoreFWLite.cpp

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)