aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVirgil Dupras <vdupras@gentoo.org>2019-01-02 11:43:01 -0500
committerVirgil Dupras <vdupras@gentoo.org>2019-01-02 11:47:04 -0500
commitf84663baa99dfd4883a022ec57fb1169a70d04b5 (patch)
tree9baf436e59c48460514fca28443744c7b9cb3a2d
parentcollect test logs when tests fail (diff)
downloadtatt-f84663baa99dfd4883a022ec57fb1169a70d04b5.tar.gz
tatt-f84663baa99dfd4883a022ec57fb1169a70d04b5.tar.bz2
tatt-f84663baa99dfd4883a022ec57fb1169a70d04b5.zip
Remove (broken) tatt-tests
This has no meaning, doesn't work (non-relative import style) and hasn't in years (since 888142961ab804ae10ffefe354bd1e5c6a1e5a1f to be exact). Why keep it there?
-rw-r--r--tatt-tests/__init__.py2
-rw-r--r--tatt-tests/packageFinder-test.py50
-rw-r--r--tatt-tests/scriptwrite-tests.py7
-rwxr-xr-xtatt-tests/tatt-test.py185
-rw-r--r--tatt-tests/test.py26
-rw-r--r--tatt-tests/tinderbox-test.py13
6 files changed, 0 insertions, 283 deletions
diff --git a/tatt-tests/__init__.py b/tatt-tests/__init__.py
deleted file mode 100644
index cd69e1a..0000000
--- a/tatt-tests/__init__.py
+++ /dev/null
@@ -1,2 +0,0 @@
-import sys
-sys.path.append('../tatt')
diff --git a/tatt-tests/packageFinder-test.py b/tatt-tests/packageFinder-test.py
deleted file mode 100644
index e5c06d9..0000000
--- a/tatt-tests/packageFinder-test.py
+++ /dev/null
@@ -1,50 +0,0 @@
-import sys
-sys.path.append('../tatt')
-
-from packageFinder import findPackages as fP
-import re
-atomre = re.compile("=?[^\s:,;<>]+/\S+-?[0-9]?\S+[0-9][^\s:,;<>]?[a-z]*")
-s1 = "Stabilize games-strategy/freeciv-2.2.1"
-s2 = """media-fonts/mikachan-font-otf-9.1-r1 ppc64
-media-fonts/mikachan-font-ttf-8.9-r2 ppc64
-x11-apps/beforelight-1.0.1 ppc ppc64 sparc
-x11-apps/grandr-0.1 arm
-x11-apps/ico-1.0.2 ppc ppc64 sparc
-x11-apps/mkfontscale-1.0.6 ppc64
-x11-apps/oclock-1.0.1 ia64
-x11-apps/rstart-1.0.3 sparc
-x11-apps/scripts-1.0.1 ppc ppc64 sparc
-x11-apps/smproxy-1.0.3 ppc64
-x11-apps/xdbedizzy-1.0.2 sparc
-x11-apps/xdm-1.1.9 alpha ia64 ppc64 s390 sh sparc
-x11-apps/xf86dga-1.0.2 ppc64
-x11-apps/xkbcomp-1.1.0 ppc64
-x11-apps/xkbprint-1.0.2 sparc
-x11-apps/xmore-1.0.1-r1 sparc
-x11-apps/xstdcmap-1.0.1 sparc
-x11-apps/xtrap-1.0.2 sparc
-x11-drivers/linuxwacom-0.8.4_p1 ppc ppc64
-x11-drivers/xf86-input-joystick-1.5.0 hppa
-x11-drivers/xf86-video-ati-6.12.1-r1 alpha
-x11-drivers/xf86-video-radeonhd-1.2.5 ppc64
-x11-drivers/xf86-video-xgi-1.5.1 ppc ppc64
-x11-libs/libXCalibrate-0.1_pre20081207-r1 ppc64
-x11-libs/libXxf86misc-1.0.2 ppc
-x11-libs/libdrm-2.4.15 ppc64
-x11-misc/driconf-0.9.1 sparc
-x11-misc/rendercheck-1.3 sparc
-x11-misc/transset-0.1_pre20040821 sparc
-x11-misc/xtermcontrol-2.9 sparc
-x11-proto/evieext-1.1.0 hppa ppc
-x11-proto/xf86miscproto-0.9.3 ppc
-x11-proto/xproto-7.0.15 ppc64
-x11-themes/xcursor-themes-1.0.2 hppa
-"""
-
-for p in fP(s1, atomre):
- print(p.packageString())
-
-print("\n ----------- \n ------------ \n")
-for p in fP(s2, atomre):
- print(p.packageString())
-
diff --git a/tatt-tests/scriptwrite-tests.py b/tatt-tests/scriptwrite-tests.py
deleted file mode 100644
index 210c367..0000000
--- a/tatt-tests/scriptwrite-tests.py
+++ /dev/null
@@ -1,7 +0,0 @@
-import sys
-sys.path.append('../tatt')
-
-from scriptwriter import *
-from gentooPackage import gentooPackage as gP
-
-print(useCombiTestString(gP("=media-sound/amarok-2.3.1-r2"),[]))
diff --git a/tatt-tests/tatt-test.py b/tatt-tests/tatt-test.py
deleted file mode 100755
index cd94bf8..0000000
--- a/tatt-tests/tatt-test.py
+++ /dev/null
@@ -1,185 +0,0 @@
-#!/usr/bin/env python
-
-import sys
-sys.path.append('../tatt')
-
-# Global Modules
-from subprocess import *
-import sys
-import re
-import os
-
-# from configobj
-from configobj import ConfigObj
-from validate import Validator
-# To access the specfile:
-from pkg_resources import resource_filename
-
-
-from gentooPackage import gentooPackage as gP
-from packageFinder import *
-from scriptwriter import writeusecombiscript as writeUSE
-from scriptwriter import writerdepscript as writeRdeps
-from scriptwriter import writesucessreportscript as writeSuccess
-
-########### Generate a global config obj #################
-
-# resource_filename will give us platform-independent access to the specfile
-specfile = resource_filename('tatt', 'dot-tatt-spec')
-config = ConfigObj("~/.tatt", configspec=specfile)
-
-# this validator will also do type conversion according to the spec file!
-validator = Validator()
-result = config.validate(validator)
-
-if result != True:
- print('Config file validation failed!')
- sys.exit(1)
-
-######### Main program starts here ###############
-
-### USAGE and OPTIONS ###
-from optparse import OptionParser
-
-parser=OptionParser()
-parser.add_option("-d", "--depend",
- help="Determine stable rdeps",
- dest="depend",
- action="store_true",
- default = False)
-parser.add_option("-u", "--use", "--usecombis",
- help="Determine use flag combinations",
- dest="usecombi",
- action="store_true",
- default = False)
-parser.add_option("-f", "--file",
- help="Input File containing packages",
- dest="infile",
- action="store"
- )
-# parser.add_option("-t", "--test",
-# help="run emerge commands with FEATURES=\"test\"",
-# dest="feature_test",
-# action="store_true",
-# default = True)
-parser.add_option("-j", "--jobname",
- help="name for the job, prefix of output files",
- dest="jobname",
- action="store")
-parser.add_option("-b", "--bug",
- help="do the full program for a given stable request bug",
- dest="bugnum",
- action="store")
-parser.add_option("-s", "--success",
- help="Comment that the program was successfully tested",
- dest="succbugnum",
- action="store")
-
-(options,args) = parser.parse_args()
-
-if (Popen(['whoami'], stdout=PIPE).communicate()[0].rstrip() == 'root'):
- isroot=True
-else:
- print("You're not root!")
- isroot=False
-
-## -s and a bugnumber was given ?
-if options.succbugnum:
- print("Reporting success for bug number " + options.succbugnum)
- retcode = call(['bugz', 'modify', options.succbugnum, '-c', config['successmessage']])
- if retcode == 0:
- print("Success!");
- exit (0)
- else:
- print("Failure commenting on Bugzilla")
- exit(1)
-
-# Will eventuall contain packages to handle:
-packs=None
-
-## -b and a bugnumber was given ?
-if options.bugnum:
- print("Working on bug number " + options.bugnum)
- # For the time being we search only in the title
- p1 = Popen(['bugz', 'get', options.bugnum, '-n', '--skip-auth'], stdout=PIPE)
- bugraw = Popen(['grep', 'Title'], stdin=p1.stdout, stdout=PIPE).communicate()[0]
- if not re.search('[Ss][Tt][Aa][Bb]', bugraw):
- print("Does not look like a stable request bug !")
- print(bugraw)
- # Let's not exit here, maybe we still want to work on the bug
- # exit (1)
- packs = findPackages(bugraw, re.compile(config['atom-regexp']))
-
-## or maybe -f and a filename have been given:
-elif options.infile:
- try:
- bugfile=open(options.infile, 'r')
- except IOError:
- print("Given filename not found !")
- exit(1)
- bugraw = bugfile.read()
- bugfile.close()
- packs = findPackages(bugraw, re.compile(config['atom-regexp']))
-
-# joint code for -f and -b
-##########################
-
-if not packs==None:
-
- ## Assigning jobname
- if options.jobname:
- jobname = options.jobname
- elif options.infile:
- jobname = options.infile
- else:
- jobname = packs[0].packageName()
- print(("Jobname: " + jobname))
-
- for p in packs:
- print("Found the following package atom : " + p.packageString())
-
- # Unmasking:
- if isroot:
- # If we are root, then we can write to package.keywords
- try:
- keywordfile=open("/etc/portage/package.keywords/arch", 'r+')
- except IOError:
- # create an empty file, this should be beautified
- keywordfile=open("/etc/portage/package.keywords/arch", 'w')
- keywordfile.write(" ")
- keywordfile.close()
- keywordfile=open("/etc/portage/package.keywords/arch", 'r+')
-
- keywordfilecontent = keywordfile.read()
- for p in packs:
- # Test if keywordfile already contains the atom
- if re.search(p.packageString(), keywordfilecontent):
- print((p.packageString() + " already in package.keywords."))
- else:
- keywordfile.write("\n" + p.packageString() + "\n")
- print(("Appended " + p.packageString()+ " to /etc/portage/package.keywords/arch"))
- keywordfile.close()
- else:
- print("You are not root, your unmaskstring would be:")
- print(("\n".join([p.packageString() for p in packs]) + "\n"))
- ## Write the scripts
- writeUSE(jobname, packs, config["ignoreprefix"])
- writeRdeps(jobname, packs)
- if options.bugnum:
- writeSuccess(jobname, options.bugnum, config["successmessage"])
- exit (0)
-
-## If we arrive here then a package atom should be given
-try:
- pack = gP(args[0])
-except IndexError:
- print("Please call with package atom as argument")
- exit (1)
-
-if options.depend:
- writerdepscript(pack)
-
-if options.usecombi:
- writeusecombiscript(pack)
-
-## That's all folks ##
diff --git a/tatt-tests/test.py b/tatt-tests/test.py
deleted file mode 100644
index 29cd6a9..0000000
--- a/tatt-tests/test.py
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/python
-
-from gentooPackage import gentooPackage as gP
-from subprocess import *
-import sys
-import re
-import random
-import os
-
-############### GET THE CONFIGURATION ####################
-import configparser
-
-def readConfig(file="~/.tatt"):
- config = configparser.SafeConfigParser()
- config.read(file)
- print(config.sections())
- atomre = config.get("general", "aromregexp")
- ## A list of useflagsprefixes to be ignored
- ignoreprefix= config.get("general", "ignoreprefix")
- ## Success Message:
- successmessage = config.get("general", "successmessage")
- print(aromre)
-##########################################################
-
-readConfig()
-print(successmessage)
diff --git a/tatt-tests/tinderbox-test.py b/tatt-tests/tinderbox-test.py
deleted file mode 100644
index 5eaea25..0000000
--- a/tatt-tests/tinderbox-test.py
+++ /dev/null
@@ -1,13 +0,0 @@
-import sys
-sys.path.append('../tatt')
-
-import tinderbox
-from gentooPackage import gentooPackage as gp
-
-# Has a stable rdep:
-p = gp("=media-sound/amarok-2.3.1-r2")
-print(tinderbox.stablerdeps (p))
-
-# A pacakge without stable rdeps:
-p = gp("=app-portage/tatt-9999")
-print(tinderbox.stablerdeps (p))