release.tcl
diff --git a/src/API/python_listener.py b/src/API/python_listener.py new file mode 100644 index 0000000..ef07414 --- /dev/null +++ b/src/API/python_listener.py
@@ -0,0 +1,10 @@ +# Sample listener used to test release tar file, used by release.tcl + +SLregisterNewErrorType("[NOTE :PY0403]", "Module declaration \"%s\"", ""); +SLoverrideSeverity("[NOTE :PY0403]", "INFO") + +def enterModule_nonansi_header(prog, ctx): + SLaddErrorContext(prog, ctx, "[INFO :PY0403]", SLgetText(prog, ctx)) + +def enterModule_ansi_header(prog, ctx): + SLaddErrorContext(prog, ctx, "[INFO :PY0403]", SLgetText(prog, ctx))
diff --git a/src/Testcases/regression.log b/src/Testcases/regression.log index 3431e24..dc1f2fb 100644 --- a/src/Testcases/regression.log +++ b/src/Testcases/regression.log
@@ -1,9 +1,8 @@ Skipping large tests -Run with -mt 0 ************************ START SURELOG REGRESSION -Starts on 11/14/2019 18:11:39 +Starts on 11/14/2019 18:43:03 COMMAND: /usr/bin/time /home/alain/Surelog/src/Testcases/../dist/surelog/surelog Creating release for regression... Skipping ovm_pkg...
diff --git a/src/Testcases/regression.tcl b/src/Testcases/regression.tcl index f1867b4..d19acc6 100755 --- a/src/Testcases/regression.tcl +++ b/src/Testcases/regression.tcl
@@ -164,42 +164,61 @@ cd Testcases } +proc findFiles { basedir pattern } { + + # Fix the directory name, this ensures the directory name is in the + # native format for the platform and contains a final directory seperator + set basedir [string trimright [file join [file normalize $basedir] { }]] + set fileList {} + + # Look in the current directory for matching files, -type {f r} + # means ony readable normal files are looked at, -nocomplain stops + # an error being thrown if the returned list is empty + foreach fileName [glob -nocomplain -type {f r} -path $basedir $pattern] { + lappend fileList $fileName + } + + # Now look for any sub direcories in the current directory + foreach dirName [glob -nocomplain -type {d r} -path $basedir *] { + # Recusively call the routine on the sub directory and append any + # new files to the results + set subDirList [findFiles $dirName $pattern] + if { [llength $subDirList] > 0 } { + foreach subDirFile $subDirList { + lappend fileList $subDirFile + } + } + } + return $fileList + } + proc load_tests { } { global TESTS TESTS_DIR LONGESTTESTNAME TESTTARGET ONETEST LARGE_TESTS LONG_TESTS - set fid [open "../nbproject/launcher.properties"] - set content [read $fid] - close $fid - set lines [split $content "\n"] - set testcommand "" - set LONGESTTESTNAME 1 - set totaltest 0 - foreach line $lines { - if [regexp {launcher[0-9]+\.displayName=([a-zA-Z_0-9]+)} $line tmp testname] { - set testcommand "" - } elseif [regexp {launcher[0-9]+\.runCommand=\"\${PROJECT_DIR}/\${OUTPUT_PATH}\" (.*)} $line tmp testcommand] { - } elseif [regexp {launcher[0-9]+\.runCommand=(.*) \"\${PROJECT_DIR}/\${OUTPUT_PATH}\"} $line tmp testcommand] { - } elseif [regexp {launcher[0-9]+\.runDir=([a-zA-Z_0-9/-]+)} $line tmp testdir] { - incr totaltest - if {($TESTTARGET != "") && ![regexp $TESTTARGET $testname]} { + + set fileList [findFiles . *.sl] + puts $fileList + + foreach file $fileList { + regexp {([a-zA-Z0-9_/])+/([a-zA-Z0-9_/])+\.sl} $file tmp testdir testname + + if {($TESTTARGET != "") && ![regexp $TESTTARGET $testname]} { + continue + } + if {($ONETEST != "") && ($ONETEST != $testname)} { + continue + } + if {($ONETEST == "") && ($LARGE_TESTS == 0)} { + if [info exist LONG_TESTS($testname)] { continue } - if {($ONETEST != "") && ($ONETEST != $testname)} { - continue - } - if {($ONETEST == "") && ($LARGE_TESTS == 0)} { - if [info exist LONG_TESTS($testname)] { - continue - } - } - - if {$LONGESTTESTNAME < [string length $testname]} { - set LONGESTTESTNAME [string length $testname] - } - set TESTS($testname) $testcommand - set TESTS_DIR($testname) $testdir - } else { - set testcommand "$testcommand $line" - } + } + + if {$LONGESTTESTNAME < [string length $testname]} { + set LONGESTTESTNAME [string length $testname] + } + set TESTS($testname) $testcommand + set TESTS_DIR($testname) $testdir + } log "THERE ARE $totaltest tests" log "RUNNING [array size TESTS] tests"
diff --git a/src/release.tcl b/src/release.tcl index 998bc95..2da5029 100755 --- a/src/release.tcl +++ b/src/release.tcl
@@ -168,7 +168,7 @@ catch {exec sh -c "chmod 777 -R surelog_test/"} dummy exec sh -c "rm -rf surelog_test" file mkdir surelog_test - file copy "../python_listener.py" "surelog_test/slSV3_1aPythonListener.py" + file copy "../API/python_listener.py" "surelog_test/slSV3_1aPythonListener.py" cd surelog_test set fid [open "test.v" "w"]