-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-gigs.do
44 lines (39 loc) · 1.38 KB
/
test-gigs.do
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// -- Testing gigs package --
// 0. Load in all scripts as most recent version --> i.e. NOT a version of gigs
// from `net install'.
clear all
foreach file in "_gclassify_sfga.ado" "_gclassify_svn.ado" ///
"_gclassify_stunting.ado" "_gclassify_wasting.ado" ///
"_gclassify_wfa.ado" ///
"_gig_nbs.ado" "_gig_png.ado" "_gwho_gs.ado" "_gig_fet.ado" ///
"gigs_ipolate_coeffs.mata" {
run "`file'"
}
// Install rsource (R from Stata) if not already installed
// cap ssc install rsource, replace
// 1. Generate .dta files with standards using "z2v/c2v" conversions
local outputs "tests/outputs"
cap mkdir "`outputs'"
foreach standard in "who_gs" "ig_nbs" "ig_png" "ig_fet" "interpolation" {
cap mkdir "`outputs'/`standard'"
noi di "Running .dta file generation for `standard'"
run "tests/test-`standard'.do"
}
// 2. Compare to standards in gigs R package
local test_rscript "tests/test_stata_outputs.R"
if "`c(os)'"=="MacOSX" | "`c(os)'"=="UNIX" {
noi rsource using "`test_rscript'", ///
noloutput ///
rpath("/usr/local/bin/R") ///
roptions(`"--vanilla"')
}
else if "`c(os)'"=="Windows" {
// Windows
local rversion "4.3.2" // Set to version on own system
noi rsource using "`test_rscript'", ///
noloutput ///
rpath("C:\Program Files\R\R-`rversion'\bin\x64\Rterm.exe") ///
roptions("--vanilla")
}
// 3. Test classification functions
run "tests/test-classification.do"