Where to put test codes for GAE/Go project? [duplicate] - google-app-engine

This question already has answers here:
Testing using local files
(2 answers)
Closed 4 years ago.
I'm developing a project which is using GAE/Go. In Java, you usually put all the test code in ${PROJECT_ROOT}/src/test/java. In Rails, you put them in, for example, ${PROJECT_ROOT}/spec.
Question
Where do I put test codes for GAE/Go project? Is there any recommendation/convention?

Same as when you are creating the folder structure in java to put your tests in, in Go, it is not related to the fact that you have your application deployed in GAE. Go does not use a specific patch for the tests, but specific syntax for the test methods.
Here there is a useful guide on how to get started with testing in Go including good practices, and also the official documentation related to testing, in which they specify
Package testing provides support for automated testing of Go packages. It is intended to be used in concert with the “go test” command, which automates execution of any function of the form func TestXxx(*testing.T)

Well, if you're asking for the convention, you should put the file in the same package as the one being tested, as pointed out here. And 1 package means 1 directory.
You can have something like this:
rootdir/
main.go
main_test.go
feature/
feature.go
feature_test.go

Related

Use commitizen on a code-agnostic project

I would like to start incorporating commitizen in my repository; however, implementation seems to revolve around adding a js dependency on the repository, and calling it independently (and enforcing it with a hook).
My project currently is python, but that's besides the point - it seems to me that commitizen should be able to be orthogonal to the underlying repository.
However, I don't understand how would that be possible. Maybe the instructions don't exist, or I have not yet separated them from the "main usage path".
Good question #Stavros. I have recently been playing with it and started to have the same question. I tried to find an answer from its documentation https://commitizen-tools.github.io/commitizen/ but could not find it. Based on my testing, it seems to me that it only supports Python projects. However by the way it works, it should be able to support all Git projects.

How to create a setup of an Windows application using PowerBuilder

I am a newbie for PowerBuilder and for Windows application. I have few projects which consists corresponding code in it and after merging all that I get the final product. The problem I am facing right now is that I don't know how to make a setup of my Windows app using PowerBuilder. If I can get step by step procedure with tiny explanation, I will be able to achieve it already. Have tried Google but ended up with complex confusion. I have created the .exe, but that .exe does not work on any other computer. So please guys help me out.
Thanks
There are two parts to creating a setup program for your application: defining the files and other resources that need to deployed, and building those resources into a setup executable package.
For defining files and resources, you've made it impossible for anyone to even take a shot by referring to two very different (but similar origins) versions of the product in your tags: PowerBuilder (aka PowerBuilder Classic) and PowerBuilder.NET. The deployment requirements for apps built from each of these is very different. However, even if we knew, the best advice is to go through the manuals and review what is required of the features of your specific application. (e.g. if you don't use rich text, deploying the files required to support it would be a waste). A generic list is, IMHO, just bad advice.
As far as building a setup package goes, the first decision is which package building software to pick (none comes with PowerBuilder). Any Windows setup package builder should do. I've used InstallShield and Inno, vastly preferring the latter (after many years of using the former). I know you want steps to walk you through, but a walk through is impossible before picking the software, and frankly, walk throughs of these setup building software has been done elsewhere much better than I'd do.
The bottom line is that the answer isn't as simple as you seem to have been hoping, but it is attainable.
Good luck,
Terry.

node.js powered by C libxml & libxslt

Unfortunately I'm neither able to write C-code nor to implement available (and proven) libraries like the common libxml and libxslt used by PHP. I wonder if it is so hart to implement them in node.js? As far as I know C libraries could (easily) be implemented for a usage in node.js.
I'm looking forward to see something like this http://www.w3schools.com/xsl/xsl_client.asp on the server's JS.
I'd love to contribute and migrate / implement these two libs into node. Does anyone know how to do this or is there a quick link explaining this? Remember I've never worked with C, but I'm a PHP-, Java- and JS-developer for about 8 years now.
Maybe someone wants to join me and realize this.
If you take a look at the node_xslt source code. You can see it's already interacting with libxslt.
So either use that module, or draw inspiration from it and improve it.
For future reference I used the npm search registry and searched for "xslt"

Xcode 4 - how does it know what build configuration to use for nested projects?

First time poster, this site is invaluable for answering my questions - so thanks to everyone who contributes!
I have an Xcode 4 project with multiple nested projects (which build as libraries for the main project). Everything is working fine but one step baffles me:
How does it know what configuration to build (and link) for the nested projects? For example my main app has a Distribution configuration. I want it to build and link against the nested projects' Release configurations. And it does!!! but how does it know that? I can't find anywhere where I would specify it.
After scouring the internet to no avail - I'm thinking it might be using magic...
I may have a solution to your question:
If you look at the scheme settings of your included frameworks, they by default have defined Release as configuration to use when you build for Archive. Would be possible that Xcode uses this setting when you build your main project for Archive (and would actually make sense).
(For me this doesn't work, won't find the headers, maybe you have an idea?)

How to create dynamic HTML pages using C? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
How to create DHTML pages using C language? Please give me some web site where I can find the step by step procedure to create DHTML pages using C.
Regards,
NM
Assuming your application will be executed as a CGI of apache or another HTTP server, you only need to print the HTTP headers and the content of the page to stdout.
The minimal headers expected are:
Content-type: text/html\r\n\r\n
(do not forget the double \r\n)
then write your page.
C? Not so suitable language for that.
But, someone did CMS with that, called Tokyopromenade, Opensource
http://1978th.net/tokyopromenade/
Just for your information
For using C to generate (D|X)HTML, you will have to write CGI programs. CGI programs should output the Content-type: text/html or equivalent before HTML is output.
After that, you can upload the program to the cgi-bin/ or equivalent directory. Remember to set the execution bit on the file.
Have your C program write Content-type: text/html\n\n to stdout before anything else, and you can then generate whatever HTML you wish. The empty line is critical!
"DHTML" is mostly used to describe client-side functionality, and you use Javascript for that.
But if you mean dynamic web pages (server-side functionality), and you must use C, you can use CGI (Common Gateway Interface, RFC3875):
http://hoohoo.ncsa.illinois.edu/cgi/primer.html
However, using C for web pages is not a good choice. It would be better to use a scripting language like Python or Ruby, and either study the CGI support in that language or go for a framework like Ruby on Rails.
To create dynamic webpages using C, there are a couple of ways you can go about this (this is not an exhaustive list):
You use CGI, an old standard for creating dynamic webpages. The way this works is that for each request to your site, your webserver creates a new process, invokes your program (passing information about the request to your program using environmental variables and stdin), and feeds the output from your program to the web browser. As other replies have noted, CGI requires your program to specify the HTTP response headers to the browser.
If you're interesting in using C for performance reasons when developing webpages (this is sort of diving into insanity), CGI clearly isn't an option. If you're this much of a masochist, you should probably look into linking with FastCGI or creating an Apache module. In fact, since you like pain this much, you might as well just start with thttpd and insert your code where needed.
Good luck. You might also consider seeing a shrink.
Search "C library for web applications" here on stackoverflow, it has some good answers.
I haven't tried it, maybe someone would find it usefull: klone.
It is a framework for building standalone web serververs and html templating with
embedded C.

Resources