Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
ion
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Enzo Cioppettini
ion
Commits
8a3dc9be
Commit
8a3dc9be
authored
5 years ago
by
AdminXVII
Committed by
Michael Aaron Murphy
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Condense testing and only test for params with feature
parent
c836dc8b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/run_examples.sh
+24
-38
24 additions, 38 deletions
tests/run_examples.sh
with
24 additions
and
38 deletions
tests/run_examples.sh
+
24
−
38
View file @
8a3dc9be
...
...
@@ -31,26 +31,13 @@ function test {
# Replace .ion with .out in file name
EXPECTED_OUTPUT_FILE
=
$(
echo
$1
|
sed
's/\..\+/\.out/'
)
# Run script and redirect stdout into tmp file
$PROJECT_DIR
/target/debug/ion
"
${
@
:2
}
"
>
$EXAMPLES_DIR
/tmp.out 2>&1
# Compare real and expected output
diff
"
$EXAMPLES_DIR
"
/tmp.out
"
$EXPECTED_OUTPUT_FILE
"
>
"
$EXAMPLES_DIR
"
/diff_tmp
local
RET
=
$?
# Clean up the mess
rm
-f
$EXAMPLES_DIR
/tmp.out
# Write result
if
[[
"
$RET
"
-ne
"0"
]]
;
then
cat
"
$EXAMPLES_DIR
"
/diff_tmp
rm
"
$EXAMPLES_DIR
"
/diff_tmp
echo
-e
"Test
${
1
}
${
TAGFAIL
}
"
;
return
1
;
else
rm
"
$EXAMPLES_DIR
"
/diff_tmp
if
diff <
(
$PROJECT_DIR
/target/debug/ion
"
${
@
:2
}
"
2>&1
)
"
$EXPECTED_OUTPUT_FILE
"
;
then
echo
-e
"Test
${
1
}
${
TAGPASS
}
"
;
return
0
;
else
echo
-e
"Test
${
1
}
${
TAGFAIL
}
"
;
return
1
;
fi
}
...
...
@@ -76,32 +63,31 @@ function check_return_value {
test
$1
$1
1
}
function
perform_testing
{
set
+e
# Iterate over every Ion script in examples directory
for
i
in
$EXAMPLES_DIR
/
*
.ion
;
do
check_return_value
$i
;
if
[[
$?
-ne
0
]]
;
then
EXIT_VAL
=
1
;
fi
done
# Iterate over every parameter set
for
i
in
$EXAMPLES_DIR
/
*
.params
;
do
test_cli
$i
;
if
[[
$?
-ne
0
]]
;
then
EXIT_VAL
=
1
;
fi
done
}
# Build debug binary
cargo +
$TOOLCHAIN
build
perform_testing
set
+e
# Iterate over every Ion script in examples directory
for
i
in
$EXAMPLES_DIR
/
*
.ion
;
do
if
!
check_return_value
$i
;
then
EXIT_VAL
=
1
;
fi
done
# Iterate over every parameter set
for
i
in
$EXAMPLES_DIR
/
*
.params
;
do
if
!
test_cli
$i
;
then
EXIT_VAL
=
1
;
fi
done
# Build debug binary for testing structopt argument parsing
cargo +
$TOOLCHAIN
build
--features
=
advanced_arg_parsing
perform_testing
# Iterate over every parameter set
for
i
in
$EXAMPLES_DIR
/
*
.params
;
do
if
!
test_cli
$i
;
then
EXIT_VAL
=
1
;
fi
done
set
-e
exit
$EXIT_VAL
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment