tests: add vlib/v/tests/skip_unused/

pull/8591/head
Delyan Angelov 2021-02-05 17:17:17 +02:00
parent 867d96a077
commit 81789ee106
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
7 changed files with 17 additions and 0 deletions

View File

@ -57,6 +57,7 @@ fn test_all() {
module_dir := '$checker_dir/modules' module_dir := '$checker_dir/modules'
global_dir := '$checker_dir/globals' global_dir := '$checker_dir/globals'
run_dir := '$checker_dir/run' run_dir := '$checker_dir/run'
skip_unused_dir := 'vlib/v/tests/skip_unused'
// //
checker_tests := get_tests_in_dir(checker_dir, false) checker_tests := get_tests_in_dir(checker_dir, false)
parser_tests := get_tests_in_dir(parser_dir, false) parser_tests := get_tests_in_dir(parser_dir, false)
@ -64,6 +65,7 @@ fn test_all() {
global_tests := get_tests_in_dir(global_dir, false) global_tests := get_tests_in_dir(global_dir, false)
module_tests := get_tests_in_dir(module_dir, true) module_tests := get_tests_in_dir(module_dir, true)
run_tests := get_tests_in_dir(run_dir, false) run_tests := get_tests_in_dir(run_dir, false)
skip_unused_dir_tests := get_tests_in_dir(skip_unused_dir, false)
// -prod is used for the parser and checker tests, so that warns are errors // -prod is used for the parser and checker tests, so that warns are errors
mut tasks := Tasks{ mut tasks := Tasks{
vexe: vexe vexe: vexe
@ -83,6 +85,9 @@ fn test_all() {
tasks.add('', global_dir, '--enable-globals', '.out', global_tests, false) tasks.add('', global_dir, '--enable-globals', '.out', global_tests, false)
tasks.add('', module_dir, '-prod run', '.out', module_tests, true) tasks.add('', module_dir, '-prod run', '.out', module_tests, true)
tasks.add('', run_dir, 'run', '.run.out', run_tests, false) tasks.add('', run_dir, 'run', '.run.out', run_tests, false)
tasks.add('', skip_unused_dir, 'run', '.run.out', skip_unused_dir_tests, false)
tasks.add('', skip_unused_dir, '-skip-unused run', '.skip_unused.run.out', skip_unused_dir_tests,
false)
tasks.run() tasks.run()
if github_job == 'ubuntu-tcc' { if github_job == 'ubuntu-tcc' {
// these should be run serially, since they depend on setting and using environment variables // these should be run serially, since they depend on setting and using environment variables

View File

@ -0,0 +1 @@
Hello, World!

View File

@ -0,0 +1 @@
Hello, World!

View File

@ -0,0 +1 @@
println('Hello, World!')

View File

@ -0,0 +1 @@
println_os_executable

View File

@ -0,0 +1 @@
println_os_executable

View File

@ -0,0 +1,7 @@
import os
fn main() {
x := os.args[0]
last_segment := x.replace('\\', '/').all_after('vlib/v/tests/skip_unused/')
println(last_segment)
}