Skip to content

Commit

Permalink
skip on V with no .git
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Apr 4, 2024
1 parent 7f7bf8f commit bd29cda
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vlib/v/util/version/version_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import v.util.version
import os

fn test_githash() {
if !os.exists(os.join_path(@VMODROOT, '.git')) {
eprintln('> skipping test due to missing V .git directory')
return
}
sha := version.githash(@VMODROOT)!
assert sha == @VCURRENTHASH

Expand All @@ -25,7 +29,6 @@ fn test_githash() {
os.execute_opt('git commit -m "test1"')!
test_rev := os.execute_opt('git rev-parse HEAD')!.output[..7]
assert test_rev == version.githash(git_proj_path)!

os.write_file('README.md', '')!
os.execute_opt('git add .')!
os.execute_opt('git commit -m "test2"')!
Expand Down

0 comments on commit bd29cda

Please sign in to comment.