-
-
Notifications
You must be signed in to change notification settings - Fork 12.2k
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
libtecla: test added #11844
libtecla: test added #11844
Conversation
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 for your contribution! The test is a very good idea.
Formula/libtecla.rb
Outdated
ENV.deparallelize | ||
system "./configure", "--prefix=#{prefix}", "--mandir=#{man}" | ||
system "make", "install" | ||
ENV.deparallelize do |
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.
ENV.deparallelize
was already present, and making it into a block is a no-op.
Formula/libtecla.rb
Outdated
system "./configure", "--prefix=#{prefix}", "--mandir=#{man}" | ||
system "make", "install" | ||
ENV.deparallelize do | ||
system "./configure", "prefix=#{prefix}", "mandir=#{man}" |
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.
This is a traditional configure
, the options need to be of the form --prefix
Formula/libtecla.rb
Outdated
|
||
test do | ||
(testpath/"test.c").write <<-EOS.undent | ||
#include <stdio.h> |
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.
stdio.h
and string.h
should not be necessary
Thanks, can you squash the commits into one, with commit message |
Formula/libtecla.rb
Outdated
if(!gl) | ||
return 1; | ||
|
||
gl = del_GetLine(gl); |
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.
what value is gl
assigned to in case of a failure? can you add something similar to lines 35-36 above?
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 always returns NULL, says the doc.
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 don't think this matters. 35 - 36 cover failure enough for test. Line 38 deleting as not doing anything of significance.
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.
then just don't assign this to gl
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 fine…
I've done something horribly wrong... gulp |
You have picked up an unrelated commit. |
Sorry for the trouble. |
How about making this a tad more compact? test do
(testpath/"test.c").write <<-EOS.undent
#include <locale.h>
#include <libtecla.h>
int main(int argc, char *argv[]) {
GetLine *gl;
setlocale(LC_CTYPE, "");
gl = new_GetLine(1024, 2048);
if (!gl) return 1;
return 0;
}
EOS
system ENV.cc, "test.c", "-L#{lib}", "-ltecla", "-o", "test"
system "./test"
end |
Please let me know if you would like further changes. If not I believe ready to merge. |
I think it is worth combining lines 28 and 30 |
Thanks @lordqwerty for your contribution! |
brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingbrew install <formula>
)?