Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
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
SWIFT
SWIFTsim
Commits
96a2c2b1
Commit
96a2c2b1
authored
7 years ago
by
James Willis
Browse files
Options
Downloads
Patches
Plain Diff
Build a separate exe for test27cells that runs the subset functions and add it to the test suite.
parent
c9b11f99
No related branches found
No related tags found
1 merge request
!445
Doself subset vec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/Makefile.am
+5
-1
5 additions, 1 deletion
tests/Makefile.am
tests/test27cells.sh.in
+56
-49
56 additions, 49 deletions
tests/test27cells.sh.in
with
61 additions
and
50 deletions
tests/Makefile.am
+
5
−
1
View file @
96a2c2b1
...
...
@@ -30,7 +30,7 @@ TESTS = testGreetings testMaths testReading.sh testSingle testKernel testSymmetr
# List of test programs to compile
check_PROGRAMS
=
testGreetings testReading testSingle testTimeIntegration
\
testSPHStep testActivePair test27cells test125cells testParser
\
testSPHStep testActivePair test27cells
test27cells_subset
test125cells testParser
\
testKernel testFFT testInteractions testMaths
\
testSymmetry testThreadpool
\
testAdiabaticIndex testRiemannExact testRiemannTRRS
\
...
...
@@ -60,6 +60,10 @@ testActivePair_SOURCES = testActivePair.c
test27cells_SOURCES
=
test27cells.c
test27cells_subset_SOURCES
=
test27cells.c
test27cells_subset_CFLAGS
=
$(
AM_CFLAGS
)
-DDOSELF_SUBSET
testPeriodicBC_SOURCES
=
testPeriodicBC.c
test125cells_SOURCES
=
test125cells.c
...
...
This diff is collapsed.
Click to expand it.
tests/test27cells.sh.in
+
56
−
49
View file @
96a2c2b1
#!/bin/bash
# Test for particles with the same smoothing length
for
v
in
{
0..3
}
# List each test that should be run
declare
-a
TEST_LIST
=(
test27cells test27cells_subset
)
# Run same test for each executable
for
TEST
in
"
${
TEST_LIST
[@]
}
"
do
# Test for particles with the same smoothing length
for
v
in
{
0..3
}
do
echo
""
rm
-f
brute_force_27_standard.dat swift_dopair_27_standard.dat
echo
"Running ./
test27cells
-n 6 -r 1 -d 0 -f standard -v
$v
"
./
test27cells
-n
6
-r
1
-d
0
-f
standard
-v
$v
echo
"Running ./
$TEST
-n 6 -r 1 -d 0 -f standard -v
$v
"
./
$TEST
-n
6
-r
1
-d
0
-f
standard
-v
$v
if
[
-e
brute_force_27_standard.dat
]
then
if
python @srcdir@/difffloat.py brute_force_27_standard.dat swift_dopair_27_standard.dat @srcdir@/tolerance_27_normal.dat 6
then
echo
"Accuracy test passed"
else
echo
"Accuracy test failed"
exit
1
fi
if
python @srcdir@/difffloat.py brute_force_27_standard.dat swift_dopair_27_standard.dat @srcdir@/tolerance_27_normal.dat 6
then
echo
"Accuracy test passed"
else
echo
"Accuracy test failed"
exit
1
fi
else
echo
"Error Missing test output file"
exit
1
echo
"Error Missing test output file"
exit
1
fi
echo
"------------"
done
# Test for particles with random smoothing lengths
for
v
in
{
0..3
}
do
done
# Test for particles with random smoothing lengths
for
v
in
{
0..3
}
do
echo
""
rm
-f
brute_force_27_standard.dat swift_dopair_27_standard.dat
echo
"Running ./
test27cells
-n 6 -r 1 -d 0 -f standard -v
$v
-p 1.1"
./
test27cells
-n
6
-r
1
-d
0
-f
standard
-v
$v
-p
1.1
echo
"Running ./
$TEST
-n 6 -r 1 -d 0 -f standard -v
$v
-p 1.1"
./
$TEST
-n
6
-r
1
-d
0
-f
standard
-v
$v
-p
1.1
if
[
-e
brute_force_27_standard.dat
]
then
if
python @srcdir@/difffloat.py brute_force_27_standard.dat swift_dopair_27_standard.dat @srcdir@/tolerance_27_perturbed_h.dat 6
then
echo
"Accuracy test passed"
else
echo
"Accuracy test failed"
exit
1
fi
if
python @srcdir@/difffloat.py brute_force_27_standard.dat swift_dopair_27_standard.dat @srcdir@/tolerance_27_perturbed_h.dat 6
then
echo
"Accuracy test passed"
else
echo
"Accuracy test failed"
exit
1
fi
else
echo
"Error Missing test output file"
exit
1
echo
"Error Missing test output file"
exit
1
fi
echo
"------------"
done
# Test for particles with random smoothing lengths
for
v
in
{
0..3
}
do
done
# Test for particles with random smoothing lengths
for
v
in
{
0..3
}
do
echo
""
rm
-f
brute_force_27_standard.dat swift_dopair_27_standard.dat
echo
"Running ./
test27cells
-n 6 -r 1 -d 0 -f standard -v
$v
-p 1.3"
./
test27cells
-n
6
-r
1
-d
0
-f
standard
-v
$v
-p
1.3
echo
"Running ./
$TEST
-n 6 -r 1 -d 0 -f standard -v
$v
-p 1.3"
./
$TEST
-n
6
-r
1
-d
0
-f
standard
-v
$v
-p
1.3
if
[
-e
brute_force_27_standard.dat
]
then
if
python @srcdir@/difffloat.py brute_force_27_standard.dat swift_dopair_27_standard.dat @srcdir@/tolerance_27_perturbed_h2.dat 6
then
echo
"Accuracy test passed"
else
echo
"Accuracy test failed"
exit
1
fi
if
python @srcdir@/difffloat.py brute_force_27_standard.dat swift_dopair_27_standard.dat @srcdir@/tolerance_27_perturbed_h2.dat 6
then
echo
"Accuracy test passed"
else
echo
"Accuracy test failed"
exit
1
fi
else
echo
"Error Missing test output file"
exit
1
echo
"Error Missing test output file"
exit
1
fi
echo
"------------"
done
done
exit
$?
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