-
Notifications
You must be signed in to change notification settings - Fork 161
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
testing for libgap saving/loading workspaces #2833
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2833 +/- ##
==========================================
+ Coverage 83.79% 83.79% +<.01%
==========================================
Files 682 682
Lines 346236 346236
==========================================
+ Hits 290135 290143 +8
+ Misses 56101 56093 -8
|
With #2840 the workspace loading test works - I'll polish it a bit more. |
OK, so now it's ready for reviewing. I've also split the only previously present in tst/testlibgap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I definitely think we need a more viable approach to testing libgap, for example (a) script(s) in the testdirectory that is executed instead of multiple make targets (and essentially shell scripts that are hidden in the Makefile).
Certainly, copy-pasting make targets is far from ideal. However, the workspace test is somewhat special, as we want to execute two applications in the correct order. Perhaps we might also want to test that libgap-generated workspace loads in a "normal" GAP, and the other way around? One way or another, the makefile rules probably would need to be adapted to become crossplatforms, taking filename suffixes into account. |
Have a look at the |
Building would still need to be done by make. A part of the issue is that we'd like a generic rule to make an executable FOO linked against libgap and common.lo, something like:
However I'd rather leave it for an expert in GAP makefiles (@fingolfin ?) to implement. Once this is there, writing a script invoking make and running tests won't be a problem. We can also have a Makefile in tst/testlibgap/ to build tests. |
I will try putting |
I already added such a build rule to this PR on friday, while you were sitting next to me. It is still there, and in use. |
You added the build rule, yes. I am talking about extending it to run tests,
as well.
…On Sun, 23 Sep 2018, 15:42 Max Horn, ***@***.***> wrote:
I already added such a build rule to this PR on friday, while you were
sitting next to me. It is still there, and in use.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2833 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABN8HGA5QQo5FfePUorC6bLiLxP5QhHjks5ud53dgaJpZM4WwCfw>
.
|
@dimpase My bad: I got a notification for your new comment on my smartphone, but it showed me the comment from before (from Friday 11 AM), due to that also being unread in my inbox; and I mistook that as being the comment you just had posted. But of course you really posted about the use of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed that this PR is still around, and hasn't really been reviewed. So here are some remarks. Perhaps @markuspf has more.
Perhaps this should be squashed into a single commit? Not sure how useful the history in this PR is at this point?
Makefile.rules
Outdated
tst/testlibgap/%: obj/tst/testlibgap/%.lo obj/tst/testlibgap/common.lo libgap.la | ||
$(QUIET_LINK)$(LINK) $(GAP_LDFLAGS) $^ -o $@ | ||
$(LINK) $(GAP_LDFLAGS) $^ -o $@ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the QUIET_LINK dropped?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops. Just forgot to put it back...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added back
Makefile.rules
Outdated
$(QUIET_LINK)$(LINK) $(GAP_LDFLAGS) $^ -o $@ | ||
$(LINK) $(GAP_LDFLAGS) $^ -o $@ | ||
$@ -A -l $(top_srcdir) -m 32m -q -T --nointeract > [email protected] | ||
diff $(top_srcdir)/[email protected] [email protected] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree with this part of the change: IMHO, the build rules for the test executables should be separate from the (PHONY) rules that run the tests.
Indeed, right now these targets are not marked as .PHONY, so I expect (but did not try) that running make testlibgap
twice will not actually run any tests the second time around.
One way to do this should be to remove the above two lines here again; and instead have a for loop in testlibgap
which iterates over $^
(resp. tst/testlibgap/basic tst/testlibgap/wscreate tst/testlibgap/wsload
) and for each executes the above code. That way, you also automatically get the order right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in the latest commit
Makefile.rules
Outdated
$@ -A -l $(top_srcdir) -m 32m -q -T --nointeract > [email protected] | ||
diff $(top_srcdir)/[email protected] [email protected] | ||
|
||
# rm -f [email protected] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@fingolfin : hopefully this addresses all your concerns; (I'd squash the commits then). |
Makefile.rules
Outdated
|
||
# run all the tests in tst/testlibgap | ||
testlibgap: ${LIBGAPTESTS} | ||
$(foreach v,$^,$(v) -A -l $(top_srcdir) -m 32m -q -T --nointeract >$(v).out; diff $(top_srcdir)/$(v).expect $(v).out;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why set a minimum workspace size?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general this line seems very... clever. I have no idea at all what it's doing. If foreach a make thing? bash thing? While this isn't a requirement, I'd prefer this be a script in tst/testlibgap (but others might prefer it in here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's make's foreach. I can probably format this line better, split it, if you like...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minimum workspace size has been set in @markuspf 's original line in Makefile.rules
to run the only available libgap's test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think reformatting this to cover multiple lines would improve the readability. I'd also drop the -m 32m
-- if there was a reason for it, then it can be added back, but that time with a comment explaining it.
Other than that, this PR seems ready to me. Thank you for your persistence!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed in the latest commit.
LGTM; perhaps do some squashing, though? |
rebasing all this properly is a bit beyond my git skills, with all these interleaving commits that creeped in while pulling from master, sorry. I get weird-looking errors, like |
Hu, that's odd; just doing a |
Currently loading does not work due to GAP issue gap-system#2832
took `-L ...` out of the command line allow to build and run all the tests with just one makefile rule. tests in testlibgap to run each time testlibgap target is made also defined the list of tests and used it throughout. Added a TODO in wscreate regarding workspace file naming better formatting, remove -m option in libgap test calls
OK, I've managed to squeeze it to 4 commits. |
Currently loading does not work due to GAP issue #2832