Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SST-info Update #1104

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/sst/core/sstinfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ parseInput(std::string input)
"- Help : Displays this help message\n"
"- List {element.subelement} : Displays element libraries and component information\n"
"- Find {field} {search string} : Displays all components with the given search string in its field\n\n"
"- Quit : Exits the program\n\n"
"To see more detailed instructions, type in a command without additional parameters.\n\n";
}
else if ( command == "list" ) {
Expand Down Expand Up @@ -260,6 +261,9 @@ parseInput(std::string input)
"find CATEGORY UNCATEGORIZED\n"
"find parameters rng";
}
else if ( command == "quit" ) {
return command;
}
else {
text = getErrorText(command);
}
Expand Down Expand Up @@ -1118,8 +1122,10 @@ InteractiveWindow::getInput()
if ( input != "" ) {
g_prevInput.push_front(input);
output = parseInput(input);
setInfoText(output);

if ( output == "quit" ) { break; }

setInfoText(output);
g_window.draw();
g_window.printInfo();
input = "";
Expand Down Expand Up @@ -1188,6 +1194,7 @@ InteractiveWindow::getInput()
// Make sure the cursor resets to the correct place
g_window.resetCursor(input.size() + 1);
}
endwin();
}

void
Expand Down
1 change: 1 addition & 0 deletions src/sst/core/testingframework/sst_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import sys
import os
import platform
import unittest
import threading
import time
Expand Down
14 changes: 10 additions & 4 deletions tests/testsuite_default_sstinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,14 @@ def tearDown(self):
#####

def test_sstinfo_coretestelement(self):
self.sstinfo_test_template("coreTestElement")
self.sstinfo_test_template("coreTestElement", "-q")

def test_sstinfo_interactive(self):
self.sstinfo_test_template("interactive", "-i")

#####

def sstinfo_test_template(self, testtype):
def sstinfo_test_template(self, testtype, flags):
testsuitedir = self.get_testsuite_dir()
outdir = test_output_get_run_dir()

Expand All @@ -67,9 +70,12 @@ def sstinfo_test_template(self, testtype):
err_str = "Path to SST-INFO {0}; does not exist...".format(sst_app_path)
self.assertTrue(os.path.isdir(sst_app_path), err_str)

cmd = '{0}/sst-info -q {1}'.format(sst_app_path, testtype)
if platform.system() == "Linux":
cmd = 'timeout 1 {0}/sst-info coreTestElement {1}'.format(sst_app_path, flags)
else:
cmd = "perl -e 'alarm shift; exec @ARGV' 1 {0}/sst-info coreTestElement {1}".format(sst_app_path, flags)
rtn = OSCommand(cmd, output_file_path = outfile, error_file_path = errfile).run()
if rtn.result() != 0:
if rtn.result() != (0 or 124):
self.assertEquals(rtn.result(), 0, "sst-info Test failed running cmdline {0} - return = {1}".format(cmd, rtn.result()))
with open(outfile, 'r') as f:
log_failure("FAILURE: sst-info cmdline {0}; output =\n{1}".format(cmd, f.read()))
Expand Down
Loading