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

Integrate shunit2 for testing #6

Closed
3 tasks done
jeffhung opened this issue Nov 13, 2019 · 5 comments · Fixed by #7
Closed
3 tasks done

Integrate shunit2 for testing #6

jeffhung opened this issue Nov 13, 2019 · 5 comments · Fixed by #7

Comments

@jeffhung
Copy link
Owner

jeffhung commented Nov 13, 2019

Got the idea to fix issue #5 , but I would like to have more complete testing/evaluation for different scenarios. Therefore, we could integrate shunit2 to build the framework to validate the scenarios.

  • Select the canonical shunit2 version (there are many variant versions in the wild)
  • Integrate into build process
  • Implement some test cases to validate the integration
@jeffhung
Copy link
Owner Author

The shunit2 version recognized by popular package systems:

System Canonical shunit2 version Known Through
Homebrew https://github.com/kward/shunit2 brew info shunit2
NetBSD 8.1 https://github.com/kward/shunit2 link
CentOS 6 http://code.google.com/p/shunit2 link
Fedora 30 http://code.google.com/p/shunit2 link
Debian 10 http://code.google.com/p/shunit2 link
Ubuntu 19.10 http://code.google.com/p/shunit2 link

The kward/shunit2 version is very different from the google code version, according to the folder structure.

We shall also consider whether or not the JUnit XML patch could be applied. See: https://code.google.com/archive/p/shunit2/issues/16

@jeffhung
Copy link
Owner Author

Noticed the announcement on google code:

NOTICE(2015-06-26): shunit2 has moved to GitHub! http://github.com/kward/shunit2

As the google code version is the previous canonical one, based on the announcement, we shall select the kward/shunit2 version.

@sio
Copy link

sio commented Nov 13, 2019

Have you considered using Python for unit testing?

Since this project already implies being familiar with Python that won't be a new dependency, and unit testing frameworks in Python are very advanced.

I understand that going that way will imply a lot of subprocess calls, but those may be abstracted away with a few helper functions for the most common use cases. Shell scripts for unit tests will be rather tricky to get right in regards of whitespace quoting, regex matching, etc - so Python seems like a worthwhile alternative.

@jeffhung
Copy link
Owner Author

As the major use case of python.make is to provision the python environment, I choose to test with shunit2 in order to have no python in prerequisites.

@sio
Copy link

sio commented Nov 13, 2019

Ok, that works too :)

To support my suggestion I was going to add an example of Python-based tests for Makefile before you replied. Now it's too late but here it is anyways (I wrote it for another Makefile project, but the code is easily reusable).

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

Successfully merging a pull request may close this issue.

2 participants