popcorn :: TestPopcorn :: client_test
Redefine this method to implement your test scenario.popcorn :: TestPopcorn :: defaultinit
popcorn :: TestPopcorn :: host_re
Regex to catch and hide the port from the output to get consistent resultspopcorn :: TestPopcorn :: host_re=
Regex to catch and hide the port from the output to get consistent resultspopcorn :: TestPopcorn :: test_path=
Directory of the current test suitepopcorn $ TestPopcorn :: SELF
Type of this instance, automatically specialized in every classcore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
popcorn :: TestPopcorn :: client_test
Redefine this method to implement your test scenario.core :: Object :: defaultinit
popcorn :: TestPopcorn :: defaultinit
popcorn :: TestPopcorn :: host_re
Regex to catch and hide the port from the output to get consistent resultspopcorn :: TestPopcorn :: host_re=
Regex to catch and hide the port from the output to get consistent resultscore :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: output_class_name
Display class name on stdout (debug only).popcorn :: TestPopcorn :: test_path=
Directory of the current test suite
# TestSuite for Popcorn blackbox testing.
class TestPopcorn
# Host used to run App.
var host: String = test_host
# Port used to run App.
var port: Int = test_port
# Directory of the current test suite
#
# Useful when your tested app need to load some external files.
var test_path: String = "NIT_TESTING_PATH".environ.dirname
# Run the test suite on the App.
fun run_test(app: App) do
var server = new AppThread(host, port, app)
server.start
0.1.sleep
var client = new ClientThread(self)
client.start
client.join
0.1.sleep
exit 0
end
# Redefine this method to implement your test scenario.
fun client_test do end
# Regex to catch and hide the port from the output to get consistent results
var host_re: Regex = "localhost:\[0-9\]+".to_re
# Execute a System function.
fun system(cmd: String, title: nullable String)
do
title = title or else cmd
title = title.replace(host_re, "localhost:*****")
print "\n[Client] {title}"
sys.system cmd
end
end
lib/popcorn/pop_tests.nit:126,1--168,3