Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:12:28

0001 #!/bin/bash
0002 
0003 LOCAL_TEST_DIR="${CMSSW_BASE}/src/FWCore/Framework/test"
0004 source "${LOCAL_TEST_DIR}/help_cmsRun_tests.sh"
0005 
0006 # test cmsRun help
0007 doTest 1 "cmsRun --help ${LOCAL_TEST_DIR}/test_argparse.py" "cmsRun [options] [--] config_file [python options]"
0008 
0009 # test python help
0010 doTest 2 "cmsRun ${LOCAL_TEST_DIR}/test_argparse.py --help" "usage: test_argparse.py"
0011 
0012 # test nonexistent flag
0013 doTest 3 "cmsRun ${LOCAL_TEST_DIR}/test_argparse.py --nonexistent" "usage: test_argparse.py" "unrecognized arguments: --nonexistent" 1
0014 
0015 # test cmsRun args
0016 TEST4_OUT1="Namespace(maxEvents=1, jobreport='UNSET', enablejobreport='UNSET', mode='UNSET', numThreads='UNSET', sizeOfStackForThreadsInKB='UNSET', strict='UNSET', command='UNSET')"
0017 TEST4_OUT2="setting # threads 2"
0018 doTest 4 "cmsRun -n 2 ${LOCAL_TEST_DIR}/test_argparse.py" "$TEST4_OUT1" "$TEST4_OUT2"
0019 
0020 # test python args
0021 TEST=5
0022 TEST5_OUT1="Namespace(maxEvents=1, jobreport='UNSET', enablejobreport='UNSET', mode='UNSET', numThreads='2', sizeOfStackForThreadsInKB='UNSET', strict='UNSET', command='UNSET')"
0023 doTest $TEST "cmsRun ${LOCAL_TEST_DIR}/test_argparse.py -n 2" "$TEST5_OUT1"
0024 (grep -vqF "$TEST4_OUT2" log_test$TEST.log) || die "Test $TEST: incorrect output from $CMD" $?
0025 
0026 # test cmsRun args and python args together
0027 TEST=6
0028 TEST6_OUT1="Namespace(maxEvents=1, jobreport='UNSET', enablejobreport='UNSET', mode='UNSET', numThreads='3', sizeOfStackForThreadsInKB='UNSET', strict='UNSET', command='UNSET')"
0029 TEST6_OUT2="setting # threads 2"
0030 doTest $TEST "cmsRun -n 2 ${LOCAL_TEST_DIR}/test_argparse.py -n 3" "$TEST6_OUT1" "$TEST6_OUT2"