Commit Graph

151 Commits

Author SHA1 Message Date
Qi Xiao
91bdaaf629 Change how version information is overriden.
The mechanism is now documented in PACKAGING.md.

Also refactor tools/buildall.sh to make it easy to make reproducible builds, and
fix tools/cirrus-deploy.sh.
2021-01-28 14:41:34 +00:00
Qi Xiao
22e4315eb1 Move the main package to cmd/elvish.
Now that the module path is "src.elv.sh", doing a "go get" will install the
Elvish binary as "src.elv.sh"; this is not what we want, so move the main
package into a package called "elvish".

Also update "go get" and "go build" commands accordingly.
2021-01-27 01:35:01 +00:00
Qi Xiao
196eea21d4 Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
Kurtis Rader
ad558b1e0d Include cross-package invocations in test coverage
The default behavior of `go test -cover` ignores coverage by integration
tests. That is, it ignores coverage by tests in a different package. This
penalizes Elvish since Elvish has a lot of integration tests that are
meant to indirectly, but explicitly, exercise code in other packages that
do not have explicit unit tests.

This change makes the test coverage more accurate for the purposes of
this project.

Resolves #1062
Resolves #1187
2021-01-03 02:05:44 +00:00
Kurtis Rader
0c30310167 Produce actual diffs when running make checkstyle
Resolves #1117
2020-10-22 15:26:51 +01:00
Qi Xiao
ce19bca599 Makefile: Don't run go test with -race on Windows.
Running "go test -race" on Windows requires GCC, and it appears not all GCC
builds are compatible. Since we can't reliably determine whether the environment
has a good GCC for running the race detector, just don't enable it.

This resolves #1108.
2020-08-18 21:35:30 +01:00
Qi Xiao
37e36f61be Rename coverage file to "cover". 2020-08-16 17:04:02 +01:00
Kurtis Rader
79973a4aa1 Add make cover target
While working on issue #1062 I found myself wanting to generate coverage
reports on my local system. I wrote a trivial shell script to do that.
This simply converts that script into a `make` target.
2020-08-16 17:02:47 +01:00
Kurtis Rader
1b5ce7f265 Fix the handling of go test -race
The `test-race-works && go test -race || go test` formulation causes
tests to be run twice on platforms that support the `-race` option if
any test fails.

Fixes #1085
2020-08-01 23:05:59 +01:00
Qi Xiao
d2e7201163
Makefile: Simplify the "test" target.
* Call "go env" just once.

* Use grep -x to match whole line.
2020-07-27 12:24:28 +01:00
Qi Xiao
a77261e4ea Makefile: Run tests with -race only on platforms that support it.
This fixes #1075.
2020-07-25 17:03:49 +01:00
Qi Xiao
32328bb48b Simplify Makefile. 2020-07-06 22:28:49 +01:00
Qi Xiao
e2d590e48c Makefile: Split checkstyle into checkstyle-{go md}.
This will make it easy to run those steps in separate containers in Cirrus.
2020-06-24 23:08:12 +01:00
Qi Xiao
5e0ea92b3f Makefile: Add "checkstyle" target. 2020-06-24 23:00:23 +01:00
Qi Xiao
f5a32cd33b Makefile: Resurrect "buildall" as it's used by elves/up. 2020-06-14 14:03:44 +01:00
Qi Xiao
cc9d03588c Deploy to bintray from Cirrus CI, and remove Travis config. 2020-04-03 23:23:23 +01:00
Qi Xiao
08e95e107f Makefile: Update the list of PHONY targets. 2020-04-03 01:32:01 +01:00
Qi Xiao
e14fb18987 Makefile: Add a "style" rule to format Go and Markdown files.
Also document that in CONTRIBUTING.md, and run that to format existing files.
2020-04-03 01:30:49 +01:00
Qi Xiao
c1ad34dea1 Makefile: Only force CGO_ENABLED=1 if testing with -race. 2020-03-29 00:37:20 +00:00
Qi Xiao
5e1b8e9ade Makefile: Improve the test rule.
* Force CGO_ENABLED=1 required by -race.

* Disable the -race flag on Windows; AppVeyor does not like it.
2020-03-29 00:35:25 +00:00
Qi Xiao
100671b511 Makefile: Run tests with -race.
This addresses #73.
2020-03-29 00:22:20 +00:00
Qi Xiao
fccdcb2ff5 Makefile: Use -trimpath in the "get" rule now that we require Go >= 1.13. 2020-01-14 09:19:57 -05:00
Qi Xiao
ea19b903f8 Makefile: Stick to tabs. 2020-01-02 22:11:15 +00:00
Qi Xiao
02828b6505 Makefile: Do not fail CI if codecov fails. 2019-12-30 23:59:59 +00:00
Qi Xiao
34b0afe32f Fix path of the buildinfo package in build commands. 2019-12-29 23:03:19 +00:00
Qi Xiao
d76ffe0173 Makefile: _cover/ -> cover/. 2019-12-23 20:01:55 +00:00
Qi Xiao
e799b62c8c _tools: Move non-Go tools into a new tools/, and go tool into a new cmd/. 2019-12-23 19:53:10 +00:00
Qi Xiao
5348b98e3d Makefile: Ditch substitution of \ to /.
AppVeyor now only uploads to codecov, which seems to handle the path
separator fine.
2019-11-05 01:27:21 +01:00
Qi Xiao
6c36081808 Makefile: Fix substitution of \ to /. 2019-11-05 01:23:11 +01:00
Qi Xiao
3f468fa194 Fix coverage upload for real. 2019-11-05 01:13:59 +01:00
Qi Xiao
b76d59d8c0 Makefile: Set -service when uploading to coveralls. 2019-11-05 00:37:33 +01:00
Qi Xiao
a17043abec Makefile: force the use of / instead of \ in cover files.
This makes sure that coverage reports from Windows can be merged correctly.
2019-11-05 00:32:17 +01:00
Qi Xiao
38b2a72f4e Makefile: refactor coverage rules. 2019-11-05 00:13:08 +01:00
Qi Xiao
e065170ae1 Merge branch 'master' into cliedit 2019-11-04 00:36:41 +01:00
Qi Xiao
03a333d939 Fixup for last commit:
* Fix output of elvish -buildinfo -json.

* Move Makefile comment out of the command.
2019-10-26 23:22:16 +01:00
Qi Xiao
dc8dc2f3d7 Remove buildinfo.Go{Root,Path}.
This fixes #862.
2019-10-26 23:20:54 +01:00
Qi Xiao
340326b7a0 Makefile: Simplify commands to build package names. 2019-08-31 17:51:59 +01:00
Qi Xiao
ea9fe4876b Simplify coverage deployment scripts for Travis.
The condition is guarded in .travis.yml now, so we don't need the
explicit output of whether coverage is being sent.
2018-09-14 13:48:34 +01:00
Qi Xiao
a8644560ac Makefile: simplify deploy scripts for AppVeyor.
Deployment does not run for pull requests, so we don't need to check.
2018-09-14 13:44:42 +01:00
Qi Xiao
589a47ee27 Use "binaries" for the job of building binaries on Travis.
We now use "deploy" to mean both the coverage job and the
binary-building job.
2018-09-14 13:37:29 +01:00
Qi Xiao
4dd0682e09 Separate test and deploy stages on AppVeyor. 2018-09-14 13:36:39 +01:00
Qi Xiao
ce8dee72bb Deploy to bintray in Travis deploy stage. 2018-09-14 00:12:05 +01:00
Qi Xiao
6126cabbc1 .travis.yml: Upload coverage on OSX build too. 2018-09-13 01:30:02 +01:00
Qi Xiao
3c27f941d6 Simplify Travis config. 2018-09-13 01:17:05 +01:00
Qi Xiao
0927701d76 covers/ -> _covers; move tool into _tools/. 2018-08-27 21:16:39 +01:00
Qi Xiao
9b53f3bacf Send coverage when building with 1.10 on Travis. 2018-06-28 00:47:02 +01:00
Qi Xiao
4f28506304 Remove code for uploading binary from CI.
Binaries are now built on Elvish's own infrastructure using elves/up.
2018-06-15 02:36:14 +01:00
Qi Xiao
a03ac1c3f5 Add -dirty to version string if git repo is dirty. 2018-06-15 00:41:25 +01:00
Qi Xiao
84377247a6 build -> buildinfo; include GOROOT and GOPATH and remove builder. 2018-06-15 00:35:10 +01:00
Qi Xiao
d2c720263d Add a POSIX-sh buildall script. 2018-06-14 23:29:10 +01:00