1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

ci: set up pg database to test ORM

This commit is contained in:
Alexander Medvednikov 2019-12-06 02:11:39 +03:00
parent 71c0c4803f
commit be323e2fb6
5 changed files with 48 additions and 37 deletions

View File

@ -29,7 +29,7 @@ jobs:
node-version: 12.x
- name: Install dependencies
run: |
brew install freetype glfw openssl
brew install freetype glfw openssl postgres
export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/opt/openssl/lib/"
- name: Build V
run: make && ./v -o v v.v
@ -37,6 +37,10 @@ jobs:
run: ./v -o v2 v.v && ./v2 -o v3 v.v
- name: Test symlink
run: sudo ./v symlink
- name: Set up pg database
run: |
psql -U postgres -c 'create database customerdb;'
psql -d customerdb -f examples/database/pg/mydb.sql
- name: Test v->c
run: ./v test-compiler
- name: Test v binaries

View File

@ -19,7 +19,7 @@ pub mut:
fail string
}
pub fn new_test_sesion(vargs string) TestSession {
pub fn new_test_session(vargs string) TestSession {
return TestSession{
vexe: vexe_path()
vargs: vargs
@ -50,6 +50,9 @@ pub fn (ts mut TestSession) test() {
$if windows {
if file.contains('sqlite') { continue }
}
$if !macos {
if file.contains('customer') { continue }
}
$if msvc {
if file.contains('asm') { continue }
}
@ -112,7 +115,7 @@ pub fn v_build_failing(zargs string, folder string) bool {
eprintln(main_label)
eprintln(' v compiler args: "$vargs"')
mut session := new_test_sesion( vargs )
mut session := new_test_session( vargs )
files := os.walk_ext(filepath.join(parent_dir, folder),'.v')
mains := files.filter(!it.contains('modules'))
mut rebuildable_mains := mains

View File

@ -48,7 +48,7 @@ fn v_test_compiler(vargs string){
building_tools_failed := testing.v_build_failing(vargs, 'tools')
eprintln('\nTesting all _test.v files...')
mut compiler_test_session := testing.new_test_sesion( vargs )
mut compiler_test_session := testing.new_test_session( vargs )
compiler_test_session.files << os.walk_ext(parent_dir, '_test.v')
compiler_test_session.test()
eprintln( compiler_test_session.benchmark.total_message('running V tests') )

View File

@ -30,7 +30,7 @@ pub fn main() {
exit(1)
}
mut ts := testing.new_test_sesion(args_before)
mut ts := testing.new_test_session(args_before)
for targ in args_after.split(' ') {
if os.exists(targ) && targ.ends_with('_test.v') {
ts.files << targ

View File

@ -285,6 +285,10 @@ const (
N = 5
)
struct Foooj {
a [N]int
}
fn test_fixed() {
mut nums := [4]int
assert nums[0] == 0