bundle ngircd config with test resources
Signed-off-by: observer <admin@shr4pnel.com>
This commit is contained in:
@@ -29,12 +29,16 @@ class IrcClientTest {
|
||||
@BeforeAll
|
||||
fun setup() {
|
||||
val logFile = File("src/test/resources/logs/ngircd.log")
|
||||
val ngircdConfigPath = javaClass.classLoader.getResource("ngircd.conf")!!.path
|
||||
logFile.createNewFile()
|
||||
processes = ProcessBuilder.startPipeline(
|
||||
listOf<ProcessBuilder>(
|
||||
ProcessBuilder("ngircd", "-dn").redirectErrorStream(true),
|
||||
ProcessBuilder("ts", "(%H:%M:%S)").redirectErrorStream(true),
|
||||
ProcessBuilder("sed", "-ue", "s/\\[[^][]*\\]//g").redirectOutput(logFile)
|
||||
// Run IRC server in [-d] debug log mode, with [-n] no daemon, using config [-f] file at path
|
||||
ProcessBuilder("ngircd", "-dnf", ngircdConfigPath).redirectErrorStream(true),
|
||||
// Remove unhelpful default ngircd info [PID. relative time, GID?]
|
||||
ProcessBuilder("sed", "-ue", "s/\\[[^][]*\\]//g"),
|
||||
// Add relative timestamp
|
||||
ProcessBuilder("ts", "-s", "%H:%M:%.S").redirectOutput(logFile)
|
||||
)
|
||||
)
|
||||
client.scope.launch {
|
||||
|
||||
Reference in New Issue
Block a user