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

Migrate to JUnit 5 #123

Open
jacobperron opened this issue Jul 24, 2020 · 0 comments
Open

Migrate to JUnit 5 #123

jacobperron opened this issue Jul 24, 2020 · 0 comments
Labels

Comments

@jacobperron
Copy link
Contributor

@jacobperron jacobperron commented Jul 24, 2020

Currently, unit tests depend on JUnit 4 explicitly (downloading it if it is not available):

find_jar(JUNIT_JAR NAMES junit VERSIONS 4)
if(${JUNIT_JAR})
list(APPEND exported_jars ${JUNIT_JAR})
else()
set(junit_version "4.12")
set(junit_sha256 "59721f0805e223d84b90677887d9ff567dc534d7c502ca903c0c2b17f05c116a")
set(junit_url "https://repo1.maven.org/maven2/junit/junit/${junit_version}/junit-${junit_version}.jar")
set(junit_jar_path "${CMAKE_CURRENT_BINARY_DIR}/jars/junit-${junit_version}.jar")
file(DOWNLOAD ${junit_url} ${junit_jar_path} EXPECTED_HASH SHA256=${junit_sha256})

By switching to JUnit 5, we can take advantage of new features and the extensibility of it's modular architecture.

At the moment, there aren't many instances I can point to that would justify switching, besides this TODO:

// TODO(jacobperron): Replace with JUnit's assertThrows method when we switch to JUnit 5
// See: https://junit.org/junit5/docs/5.0.1/api/org/junit/jupiter/api/Assertions.html

I haven't investigated how easy it would be to switch; it may be as simple as update the CMake snippet referenced above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.