Skip to content

Commit

Permalink
Add convenience function for creating test input/output files
Browse files Browse the repository at this point in the history
  • Loading branch information
cacay committed Feb 14, 2022
1 parent b998046 commit 03fc892
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import org.apache.logging.log4j.Level
import org.apache.logging.log4j.core.config.Configurator
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.ArgumentsSource
import org.springframework.util.SocketUtils
Expand Down Expand Up @@ -39,6 +40,22 @@ internal class RunExamplesTest {
}
}

/** Convenience function that creates empty input/output files for new test programs. */
@Disabled
@ParameterizedTest
@ArgumentsSource(ViaductProgramProvider::class)
fun createEmptyInputOutputFiles(program: ViaductGeneratedProgram) {
fun createFile(file: File) {
println("Creating $file.")
file.parentFile.mkdirs()
file.createNewFile()
}
program.hosts.forEach { host ->
createFile(inputFile(program, host))
createFile(outputFile(program, host))
}
}

companion object {
@BeforeAll
@JvmStatic
Expand Down

0 comments on commit 03fc892

Please sign in to comment.