-
Notifications
You must be signed in to change notification settings - Fork 4
/
togtest
executable file
·98 lines (76 loc) · 2.47 KB
/
togtest
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#! /usr/bin/env ruby
#Cleanup
system("clear")
system("touch runningtests")
system("rm -r testsettings")
system("mkdir testsettings")
system("rm -r ~/shoots/*togtests")
system("rm ~/.tog.txt")
# Setup togtests to use tog libraries
require 'fileutils'
require 'pathname'
require 'pry'
$togpath = File.dirname(Pathname.new(__FILE__).realpath)
$debuglevel = 5
$settings_path = 'testsettings/'
# Load method libraries
load ($togpath + '/lib/ui.rb')
load ($togpath + '/lib/files.rb')
load ($togpath + '/lib/mods.rb')
load ($togpath + '/lib/sets.rb')
load ($togpath + '/lib/tests.rb')
# Setup global vars
$global_menu = []
$set_menu = []
$power_user_help = {}
$set_roots = []
$post_final_tasks = []
$set_catchall_settings = {}
#Make sure tog loads core modules
system("./tog skipthrough")
if ! is_installed('core')
exittests("INITIALIZE :: Core didn't install")
end
#Install a module through tog install
system("./tog install archiver")
if ! is_installed('archiver')
exittests("tog install archiver :: Archiver didn't install")
end
#UnInstall a module through tog install
system("./tog uninstall archiver")
if is_installed('archiver')
exittests("tog uninstall archiver :: Archiver didn't uninstall")
end
#Now we can install all modules through the code
#Including BETA
#Including CUSTOM
test_install_notinstalledmods
#Create a new set
system("tog create togtests")
$current_set_file = ENV['HOME'] + "/.tog.txt"
test_exists "file", $current_set_file
# Get the current tog environment setup right here
load_mod_settings
load_current_set
#Test Post Processing steps
system("cp tog.jpg " + $current_set + $workflow1_directory)
#Run Post1
system("tog post1")
#Check for tog in finals
test_exists "file", $current_set + $final_image_directory + '/tog.jpg'
test_exists "file", $current_set + 'resized/tog.jpg'
test_exists "file", $current_set + 'instagramed/IG-tog.jpg'
#Run some more modules that are testable
system("tog declutter")
test_notexists "file", $current_set + 'resized/tog.jpg'
test_notexists "file", $current_set + 'instagramed/IG-tog.jpg'
#Cleanup
puts "Cleaning up from tests"
system("rm runningtests")
system("rm -r testsettings")
system("rm -r ~/shoots/*togtests")
system("rm ~/.tog.txt")
puts "=================================================================================="
puts "=================================================================================="
puts "=================================================================================="
puts "If you got here.. things look good"